Clear Filters
Clear Filters

How to do galois multiplication?

5 views (last 30 days)
Suppose I have 2 cell array inputs as shown below:
A={'fe' 'ff' 'e9' '92' '86' '65' '73' '1c' '6d' '6a' '8f' '94' '67' '30' '83' '08'};
H={'b8' '3b' '53' '37' '08' 'bf' '53' '5d' '0a' 'a6' 'e5' '29' '80' 'd5' '3b' '78';
How to muliply these inputs using galois field multiplication?? Can somebody helpme?

Accepted Answer

Akira Agata
Akira Agata on 28 Dec 2017
If you have the Communications System Toolbox, please try the following script.
% Convert to GF(2^8)
gfA = gf(hex2dec(A),8);
gfH = gf(hex2dec(H),8);
% Multiplication in GF(2^8) field
gfAH = gfA .* gfH;
  10 Comments
Darsana P M
Darsana P M on 9 Jan 2018
What might be the issue?
Walter Roberson
Walter Roberson on 9 Jan 2018
GFRefArray = gf([0:(2^1)-1]);
contains only 0 and 1 because that is what you asked for. It would need to be
function DECout = gf2dec(HA)
N = 8;
c = 0 : (2^N)-1;
GFRefarray = gf(c, N);
for i = 1:length(HA)
for k = c
if isequal(HA(i),GFRefarray(k+1));
DECout(i)=k;
end
end
end

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!