Add more SM4 modes

This commit is contained in:
Zhi Guan
2024-02-19 14:16:49 +08:00
parent 8ae03e8105
commit c9c26aca44
12 changed files with 1092 additions and 61 deletions

View File

@@ -27,14 +27,6 @@ void sm4_ofb_encrypt(const SM4_KEY *key, uint8_t iv[16], const uint8_t *in, size
}
}
typedef struct {
SM4_KEY sm4_key;
uint8_t iv[SM4_BLOCK_SIZE];
uint8_t block[SM4_BLOCK_SIZE];
size_t block_nbytes;
} SM4_OFB_CTX;
int sm4_ofb_encrypt_init(SM4_OFB_CTX *ctx,
const uint8_t key[SM4_BLOCK_SIZE], const uint8_t iv[SM4_BLOCK_SIZE])
{