mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-07 00:46:17 +08:00
Add args checking to GCM mode
This commit is contained in:
@@ -112,6 +112,8 @@ void aes_ctr_encrypt(const AES_KEY *key, uint8_t ctr[AES_BLOCK_SIZE],
|
||||
#define AES_GCM_MIN_PLAINTEXT_SIZE 0
|
||||
#define AES_GCM_MAX_PLAINTEXT_SIZE ((((uint64_t)1 << 39) - 256) >> 3)
|
||||
|
||||
#define AES_GCM_MAX_TAG_SIZE 16
|
||||
|
||||
int aes_gcm_encrypt(const AES_KEY *key, const uint8_t *iv, size_t ivlen,
|
||||
const uint8_t *aad, size_t aadlen, const uint8_t *in, size_t inlen,
|
||||
uint8_t *out, size_t taglen, uint8_t *tag);
|
||||
|
||||
@@ -121,6 +121,8 @@ void sm4_ctr_encrypt(const SM4_KEY *key, uint8_t ctr[SM4_BLOCK_SIZE],
|
||||
#define SM4_GCM_MIN_PLAINTEXT_SIZE 0
|
||||
#define SM4_GCM_MAX_PLAINTEXT_SIZE ((((uint64_t)1 << 39) - 256) >> 3)
|
||||
|
||||
#define SM4_GCM_MAX_TAG_SIZE 16
|
||||
|
||||
int sm4_gcm_encrypt(const SM4_KEY *key, const uint8_t *iv, size_t ivlen,
|
||||
const uint8_t *aad, size_t aadlen, const uint8_t *in, size_t inlen,
|
||||
uint8_t *out, size_t taglen, uint8_t *tag);
|
||||
|
||||
Reference in New Issue
Block a user