Fix ZUC out-of-bounds read

This commit is contained in:
Zhi Guan
2026-06-14 15:36:02 +08:00
parent 5c67b5963d
commit f6f049256c
4 changed files with 13 additions and 7 deletions

View File

@@ -92,9 +92,10 @@ typedef struct ZUC256_MAC_CTX_st {
} ZUC256_MAC_CTX;
void zuc256_mac_init(ZUC256_MAC_CTX *ctx, const uint8_t key[ZUC256_KEY_SIZE],
const uint8_t iv[ZUC256_IV_SIZE], int macbits);
const uint8_t iv[ZUC256_IV_SIZE], int macbits); // macbits should be 32, 64, or 128
void zuc256_mac_update(ZUC256_MAC_CTX *ctx, const uint8_t *data, size_t len);
void zuc256_mac_finish(ZUC256_MAC_CTX *ctx, const uint8_t *data, size_t nbits, uint8_t mac[ZUC_MAC_SIZE]);
void zuc256_mac_finish(ZUC256_MAC_CTX *ctx, const uint8_t *data, size_t nbits,
uint8_t *mac); // mac size should be 4, 8 or 16
typedef struct {