mirror of
https://github.com/cryb-to/cryb-to.git
synced 2024-12-22 04:21:08 +00:00
The spec says XOR here, not OR. Interestingly, it doesn't seem to
make any difference.
This commit is contained in:
parent
cc13b6a16a
commit
dffacacccf
1 changed files with 2 additions and 2 deletions
|
@ -87,11 +87,11 @@ sha1_compute(sha1_ctx *ctx, const uint8_t *block)
|
|||
e = ctx->h[4];
|
||||
for (int t = 0; t < 80; ++t) {
|
||||
if (t < 20)
|
||||
f = (b & c) | ((~b) & d);
|
||||
f = (b & c) ^ ((~b) & d);
|
||||
else if (t < 40)
|
||||
f = b ^ c ^ d;
|
||||
else if (t < 60)
|
||||
f = (b & c) | (b & d) | (c & d);
|
||||
f = (b & c) ^ (b & d) ^ (c & d);
|
||||
else
|
||||
f = b ^ c ^ d;
|
||||
temp = rol(a, 5) + f + e + w[t] + sha1_k[t/20];
|
||||
|
|
Loading…
Reference in a new issue