mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
x2t - update crypto++
This commit is contained in:
@ -33,7 +33,7 @@ void RC6::Base::UncheckedSetKey(const byte *k, unsigned int keylen, const NameVa
|
||||
|
||||
for (unsigned h=0; h < n; h++)
|
||||
{
|
||||
a = sTable[h % sTable.size()] = rotlFixed((sTable[h % sTable.size()] + a + b), 3);
|
||||
a = sTable[h % sTable.size()] = rotlConstant<3>((sTable[h % sTable.size()] + a + b));
|
||||
b = l[h % c] = rotlMod((l[h % c] + a + b), (a+b));
|
||||
}
|
||||
}
|
||||
@ -52,8 +52,8 @@ void RC6::Enc::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byt
|
||||
|
||||
for(unsigned i=0; i<r; i++)
|
||||
{
|
||||
t = rotlFixed(b*(2*b+1), 5);
|
||||
u = rotlFixed(d*(2*d+1), 5);
|
||||
t = rotlConstant<5>(b*(2*b+1));
|
||||
u = rotlConstant<5>(d*(2*d+1));
|
||||
a = rotlMod(a^t,u) + sptr[0];
|
||||
c = rotlMod(c^u,t) + sptr[1];
|
||||
t = a; a = b; b = c; c = d; d = t;
|
||||
@ -81,13 +81,12 @@ void RC6::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byt
|
||||
{
|
||||
sptr -= 2;
|
||||
t = a; a = d; d = c; c = b; b = t;
|
||||
u = rotlFixed(d*(2*d+1), 5);
|
||||
t = rotlFixed(b*(2*b+1), 5);
|
||||
u = rotlConstant<5>(d*(2 * d + 1));
|
||||
t = rotlConstant<5>(b*(2 * b + 1));
|
||||
c = rotrMod(c-sptr[1], t) ^ u;
|
||||
a = rotrMod(a-sptr[0], u) ^ t;
|
||||
}
|
||||
|
||||
sptr -= 2;
|
||||
d -= sTable[1];
|
||||
b -= sTable[0];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user