Merge pull request #104 from brandonhamilton/master

Correct XSalsa20 initialization when using 8/12 rounds
This commit is contained in:
Vincent Hanquez 2016-11-07 14:27:48 +00:00 committed by GitHub
commit 47cb6ebdea

View File

@ -57,7 +57,7 @@ void cryptonite_xsalsa_init(cryptonite_salsa_context *ctx, uint8_t nb_rounds,
/* Compute (z0, z1, . . . , z15) = doubleround ^(r/2) (x0, x1, . . . , x15) */
block hSalsa;
memset(&hSalsa, 0, sizeof(block));
cryptonite_salsa_core_xor(20, &hSalsa, &ctx->st);
cryptonite_salsa_core_xor(nb_rounds, &hSalsa, &ctx->st);
/* Build a new 512-bit input block (x0, x1, . . . , x15):
(x0, x5, x10, x15) is the Salsa20 constant