Round up the size of the secret parts after splitting it in two.

This commit is contained in:
Guus Sliepen 2011-07-04 07:51:47 +02:00
parent 95e1cc36d3
commit b99656d84a

View file

@ -71,6 +71,6 @@ bool prf(char *secret, size_t secretlen, char *seed, size_t seedlen, char *out,
memset(out, 0, outlen);
return prf_xor(NID_sha512, secret, secretlen / 2, seed, seedlen, out, outlen)
&& prf_xor(NID_whirlpool, secret, secretlen / 2, seed, seedlen, out, outlen);
return prf_xor(NID_sha512, secret, (secretlen + 1) / 2, seed, seedlen, out, outlen)
&& prf_xor(NID_whirlpool, secret + secretlen / 2, (secretlen + 1) / 2, seed, seedlen, out, outlen);
}