diff options
author | Mattias Andrée <maandree@kth.se> | 2019-02-10 20:57:56 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2019-02-10 20:57:56 +0100 |
commit | 15f132722cae63775dd7b2fef866d477c54c7b8e (patch) | |
tree | 27359241e0a1a0b6f304060bc0a9e7c9287efd06 /process.c | |
parent | First commit (diff) | |
download | libsha1-15f132722cae63775dd7b2fef866d477c54c7b8e.tar.gz libsha1-15f132722cae63775dd7b2fef866d477c54c7b8e.tar.bz2 libsha1-15f132722cae63775dd7b2fef866d477c54c7b8e.tar.xz |
Implement SHA-0 and remove .chunk_size1.0
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -36,8 +36,13 @@ libsha1_process(struct libsha1_state *restrict state, const unsigned char *restr state->w[i] |= (uint32_t)chunk[4 * i + 2] << 8; state->w[i] |= (uint32_t)chunk[4 * i + 3]; } - for (; i < 80; i++) - state->w[i] = rorl(state->w[i - 3] ^ state->w[i - 8] ^ state->w[i - 14] ^ state->w[i - 16], 1); + if (state->algorithm == LIBSHA1_1) { + for (; i < 80; i++) + state->w[i] = rorl(state->w[i - 3] ^ state->w[i - 8] ^ state->w[i - 14] ^ state->w[i - 16], 1); + } else { + for (; i < 80; i++) + state->w[i] = state->w[i - 3] ^ state->w[i - 8] ^ state->w[i - 14] ^ state->w[i - 16]; + } a = state->h[0]; b = state->h[1]; c = state->h[2]; |