-#ifdef ARRAY
- uint32_t v[5];
- memcpy(v, ctx->hash, 5 * sizeof(uint32_t));
-#else
- uint32_t v0, v1, v2, v3, v4;
- v0 = ctx->hash[0]; v1 = ctx->hash[1];
- v2 = ctx->hash[2]; v3 = ctx->hash[3];
- v4 = ctx->hash[4];
-#endif
-
-#define hf(i) w[i]
-
- five_cycle(v, ch, 0x5a827999, 0);
- five_cycle(v, ch, 0x5a827999, 5);
- five_cycle(v, ch, 0x5a827999, 10);
- one_cycle(v,0,1,2,3,4, ch, 0x5a827999, hf(15)); \
-
-#undef hf
-#define hf(i) (w[(i) & 15] = rotl32( \
- w[((i) + 13) & 15] ^ w[((i) + 8) & 15] \
- ^ w[((i) + 2) & 15] ^ w[(i) & 15], 1))
-
- one_cycle(v,4,0,1,2,3, ch, 0x5a827999, hf(16));
- one_cycle(v,3,4,0,1,2, ch, 0x5a827999, hf(17));
- one_cycle(v,2,3,4,0,1, ch, 0x5a827999, hf(18));
- one_cycle(v,1,2,3,4,0, ch, 0x5a827999, hf(19));
-
- five_cycle(v, parity, 0x6ed9eba1, 20);
- five_cycle(v, parity, 0x6ed9eba1, 25);
- five_cycle(v, parity, 0x6ed9eba1, 30);
- five_cycle(v, parity, 0x6ed9eba1, 35);
-
- five_cycle(v, maj, 0x8f1bbcdc, 40);
- five_cycle(v, maj, 0x8f1bbcdc, 45);
- five_cycle(v, maj, 0x8f1bbcdc, 50);
- five_cycle(v, maj, 0x8f1bbcdc, 55);
-
- five_cycle(v, parity, 0xca62c1d6, 60);
- five_cycle(v, parity, 0xca62c1d6, 65);
- five_cycle(v, parity, 0xca62c1d6, 70);
- five_cycle(v, parity, 0xca62c1d6, 75);
-
-#ifdef ARRAY
- ctx->hash[0] += v[0]; ctx->hash[1] += v[1];
- ctx->hash[2] += v[2]; ctx->hash[3] += v[3];
- ctx->hash[4] += v[4];
-#else
- ctx->hash[0] += v0; ctx->hash[1] += v1;
- ctx->hash[2] += v2; ctx->hash[3] += v3;
- ctx->hash[4] += v4;
-#endif
-}
-
-void sha1_begin(sha1_ctx ctx[1])