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

@@ -63,14 +63,6 @@ void sm4_cfb_decrypt(const SM4_KEY *key, size_t sbytes, uint8_t iv[16],
}
}
typedef struct {
SM4_KEY sm4_key;
uint8_t iv[SM4_BLOCK_SIZE];
uint8_t block[SM4_BLOCK_SIZE];
size_t block_nbytes;
size_t sbytes;
} SM4_CFB_CTX;
int sm4_cfb_encrypt_init(SM4_CFB_CTX *ctx, size_t sbytes,
const uint8_t key[SM4_BLOCK_SIZE], const uint8_t iv[SM4_BLOCK_SIZE])
{