search for: sm3block

Displaying 1 result from an estimated 1 matches for "sm3block".

Did you mean: ms_block
2024 Aug 06
1
[PATCH] Add SM3 secure hash algorithm
...(63), W2(67)); + + ctx->state[0] ^= a; + ctx->state[1] ^= b; + ctx->state[2] ^= c; + ctx->state[3] ^= d; + ctx->state[4] ^= e; + ctx->state[5] ^= f; + ctx->state[6] ^= g; + ctx->state[7] ^= h; +} +#undef R +#undef R1 +#undef R2 +#undef I +#undef W1 +#undef W2 + +static void +SM3Block(SM3_CTX *ctx, u_int8_t const *data, size_t blocks, u_int32_t W[16]) +{ + while (blocks--) { + SM3Transform(ctx, data, W); + data += SM3_BLOCK_LENGTH; + } +} + + +void +SM3Init(SM3_CTX *ctx) +{ + ctx->state[0] = 0x7380166f; + ctx->state[1] = 0x4914b2b9; + ctx->state[2] = 0x172442d7; + ctx...