fix usage of cryptonite_chacha_init
This commit is contained in:
parent
06832d678d
commit
087a2f118a
@ -207,11 +207,11 @@ void cryptonite_chacha_random(uint32_t rounds, uint8_t *dst, cryptonite_chacha_s
|
|||||||
for (; bytes >= 16; bytes -= 16, dst += 16) {
|
for (; bytes >= 16; bytes -= 16, dst += 16) {
|
||||||
chacha_core(rounds, &out, st);
|
chacha_core(rounds, &out, st);
|
||||||
memcpy(dst, out.b + 40, 16);
|
memcpy(dst, out.b + 40, 16);
|
||||||
cryptonite_chacha_init(st, out.b, 32, out.b + 32, 8);
|
cryptonite_chacha_init(st, 32, out.b, 8, out.b + 32);
|
||||||
}
|
}
|
||||||
if (bytes) {
|
if (bytes) {
|
||||||
chacha_core(rounds, &out, st);
|
chacha_core(rounds, &out, st);
|
||||||
memcpy(dst, out.b + 40, bytes);
|
memcpy(dst, out.b + 40, bytes);
|
||||||
cryptonite_chacha_init(st, out.b, 32, out.b + 32, 8);
|
cryptonite_chacha_init(st, 32, out.b, 8, out.b + 32);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user