📄 rs_mul.m
字号:
% a function to realize multiplication in field GF(2^5)
% input 'a','b' are two decimal numbers range from 0 to 31 corresponding to numbers of GF(2^5)
% output 'y' is a decimal number range from 0 to 31 corresponding to a number of GF(2^5)
function y=rs_mul(a,b)
T=[1,2,4,8,16,5,10,20,13,26,17,7,14,28,29,31,27,19,3,6,12,24,21,15,30,25,23,11,22,9,18];
% for 'a' or 'b' is 0, output 'y' is 0
if a*b==0
y=0;
% by check the table, represent the decimal numbers as powers of primitive root
% so multiplication turn to addition of the power of primitive root
% then check the table again to get the result of multiplication as a
% decimal number
else
a1=find(T==a)-1;
b1=find(T==b)-1;
c=mod((a1+b1),31);
y=T(c+1);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -