mirror of
https://github.com/aicodix/code.git
synced 2026-04-27 22:35:44 +00:00
don't need to recompute degree of r
This commit is contained in:
parent
4a24450351
commit
9f07a27eaf
1 changed files with 5 additions and 2 deletions
|
|
@ -403,13 +403,16 @@ GaloisFieldReference<M, POLY, TYPE> rcp(GaloisFieldReference<M, POLY, TYPE> a)
|
|||
++d;
|
||||
return d;
|
||||
};
|
||||
int j = M - degree(r);
|
||||
int k = degree(r);
|
||||
int j = M - k;
|
||||
newr ^= r << j;
|
||||
newt ^= t << j;
|
||||
while (newr != 1) {
|
||||
int j = degree(newr) - degree(r);
|
||||
int l = degree(newr);
|
||||
int j = l - k;
|
||||
if (j < 0) {
|
||||
j = -j;
|
||||
k = l;
|
||||
std::swap(newr, r);
|
||||
std::swap(newt, t);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue