Multiplications by powers of two are supposed to be shifts.
It was not clear how we were ignoring the MSB of curve25519 points.
FOR (i, 0, nb_words) {
store64_le(hash + i*8, ctx->hash[i]);
}
- FOR (i, nb_words * 8, ctx->hash_size) {
+ FOR (i, nb_words << 3, ctx->hash_size) {
hash[i] = (ctx->hash[i >> 3] >> (8 * (i & 7))) & 0xff;
}
WIPE_CTX(ctx);
i64 t6 = load24_le(s + 20) << 7;
i64 t7 = load24_le(s + 23) << 5;
i64 t8 = load24_le(s + 26) << 4;
- i64 t9 = (load24_le(s + 29) & 8388607) << 2;
+ i64 t9 = (load24_le(s + 29) & 0x7fffff) << 2;
FE_CARRY;
}