Fixed minor error in offset calculation.

pull/1237/head
DoZ10 7 years ago
parent 264ec951c2
commit f31f057113

@ -111,7 +111,7 @@ void chacha20_transform (const u32x w0[4], const u32x w1[4], const u32 position[
x[14] += ctx[14];
x[15] += ctx[15];
if (offset > 36)
if (offset > 56)
{
/**
* Generate a second 64 byte keystream
@ -171,6 +171,10 @@ void chacha20_transform (const u32x w0[4], const u32x w1[4], const u32 position[
x[31] += ctx[15];
}
/**
* Encrypt plaintext with keystream
*/
u32 index = offset / 4;
u32 remain = offset % 4;

@ -111,7 +111,7 @@ void chacha20_transform (const u32x w0[4], const u32x w1[4], const u32 position[
x[14] += ctx[14];
x[15] += ctx[15];
if (offset > 36)
if (offset > 56)
{
/**
* Generate a second 64 byte keystream
@ -171,6 +171,10 @@ void chacha20_transform (const u32x w0[4], const u32x w1[4], const u32 position[
x[31] += ctx[15];
}
/**
* Encrypt plaintext with keystream
*/
u32 index = offset / 4;
u32 remain = offset % 4;

@ -109,7 +109,7 @@ void chacha20_transform (const u32x w0[4], const u32x w1[4], const u32 position[
x[14] += ctx[14];
x[15] += ctx[15];
if (offset > 36)
if (offset > 56)
{
/**
* Generate a second 64 byte keystream
@ -169,6 +169,10 @@ void chacha20_transform (const u32x w0[4], const u32x w1[4], const u32 position[
x[31] += ctx[15];
}
/**
* Encrypt plaintext with keystream
*/
u32 index = offset / 4;
u32 remain = offset % 4;

Loading…
Cancel
Save