summaryrefslogtreecommitdiffstats
path: root/sys/crypto/aesni/aesni.h
diff options
context:
space:
mode:
authorcem <cem@FreeBSD.org>2016-05-26 19:29:29 +0000
committercem <cem@FreeBSD.org>2016-05-26 19:29:29 +0000
commit444253bba579f26af746a0fbf42b89b8f44298a0 (patch)
treea3f8dd317ab9b8bf2071cc3dc88766e3294342a7 /sys/crypto/aesni/aesni.h
parent6aac4cff86e423c72bc1e352d3435843185b5977 (diff)
downloadFreeBSD-src-444253bba579f26af746a0fbf42b89b8f44298a0.zip
FreeBSD-src-444253bba579f26af746a0fbf42b89b8f44298a0.tar.gz
crypto routines: Hint minimum buffer sizes to the compiler
Use the C99 'static' keyword to hint to the compiler IVs and output digest sizes. The keyword informs the compiler of the minimum valid size for a given array. Obviously not every pointer can be validated (i.e., the compiler can produce false negative but not false positive reports). No functional change. No ABI change. Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'sys/crypto/aesni/aesni.h')
-rw-r--r--sys/crypto/aesni/aesni.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/crypto/aesni/aesni.h b/sys/crypto/aesni/aesni.h
index 3d5adec..b327c01 100644
--- a/sys/crypto/aesni/aesni.h
+++ b/sys/crypto/aesni/aesni.h
@@ -79,23 +79,23 @@ void aesni_set_deckey(const uint8_t *encrypt_schedule /*__aligned(16)*/,
*/
void aesni_encrypt_cbc(int rounds, const void *key_schedule /*__aligned(16)*/,
size_t len, const uint8_t *from, uint8_t *to,
- const uint8_t iv[AES_BLOCK_LEN]);
+ const uint8_t iv[static AES_BLOCK_LEN]);
void aesni_decrypt_cbc(int rounds, const void *key_schedule /*__aligned(16)*/,
- size_t len, uint8_t *buf, const uint8_t iv[AES_BLOCK_LEN]);
+ size_t len, uint8_t *buf, const uint8_t iv[static AES_BLOCK_LEN]);
void aesni_encrypt_ecb(int rounds, const void *key_schedule /*__aligned(16)*/,
size_t len, const uint8_t *from, uint8_t *to);
void aesni_decrypt_ecb(int rounds, const void *key_schedule /*__aligned(16)*/,
size_t len, const uint8_t *from, uint8_t *to);
void aesni_encrypt_icm(int rounds, const void *key_schedule /*__aligned(16)*/,
size_t len, const uint8_t *from, uint8_t *to,
- const uint8_t iv[AES_BLOCK_LEN]);
+ const uint8_t iv[static AES_BLOCK_LEN]);
void aesni_encrypt_xts(int rounds, const void *data_schedule /*__aligned(16)*/,
const void *tweak_schedule /*__aligned(16)*/, size_t len,
- const uint8_t *from, uint8_t *to, const uint8_t iv[AES_BLOCK_LEN]);
+ const uint8_t *from, uint8_t *to, const uint8_t iv[static AES_BLOCK_LEN]);
void aesni_decrypt_xts(int rounds, const void *data_schedule /*__aligned(16)*/,
const void *tweak_schedule /*__aligned(16)*/, size_t len,
- const uint8_t *from, uint8_t *to, const uint8_t iv[AES_BLOCK_LEN]);
+ const uint8_t *from, uint8_t *to, const uint8_t iv[static AES_BLOCK_LEN]);
/* GCM & GHASH functions */
void AES_GCM_encrypt(const unsigned char *in, unsigned char *out,
OpenPOWER on IntegriCloud