Make dummy functions static.

To avoid too much #if soup, e_aes.c uses a lot of dummy functions that
just call |abort|. This change makes them all static, which they should
have been all along.

Change-Id: I696f8a0560cf99631ed7adb42d1af10003db4a63
Reviewed-on: https://boringssl-review.googlesource.com/6004
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
Adam Langley 2015-09-24 19:14:04 -07:00
parent 2ab24a2d40
commit 5f005ccd9d

View File

@ -120,7 +120,7 @@ static char bsaes_capable(void) {
#endif #endif
#define HWAES #define HWAES
static char hwaes_capable(void) { static int hwaes_capable(void) {
return (OPENSSL_armcap_P & ARMV8_AES) != 0; return (OPENSSL_armcap_P & ARMV8_AES) != 0;
} }
@ -151,13 +151,14 @@ static char bsaes_capable(void) {
/* On other platforms, bsaes_capable() will always return false and so the /* On other platforms, bsaes_capable() will always return false and so the
* following will never be called. */ * following will never be called. */
void bsaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, static void bsaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length,
const AES_KEY *key, uint8_t ivec[16], int enc) { const AES_KEY *key, uint8_t ivec[16], int enc) {
abort(); abort();
} }
void bsaes_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, size_t len, static void bsaes_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out,
const AES_KEY *key, const uint8_t ivec[16]) { size_t len, const AES_KEY *key,
const uint8_t ivec[16]) {
abort(); abort();
} }
#endif #endif
@ -180,20 +181,22 @@ static char vpaes_capable(void) {
/* On other platforms, vpaes_capable() will always return false and so the /* On other platforms, vpaes_capable() will always return false and so the
* following will never be called. */ * following will never be called. */
int vpaes_set_encrypt_key(const uint8_t *userKey, int bits, AES_KEY *key) { static int vpaes_set_encrypt_key(const uint8_t *userKey, int bits,
AES_KEY *key) {
abort(); abort();
} }
int vpaes_set_decrypt_key(const uint8_t *userKey, int bits, AES_KEY *key) { static int vpaes_set_decrypt_key(const uint8_t *userKey, int bits,
AES_KEY *key) {
abort(); abort();
} }
void vpaes_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { static void vpaes_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) {
abort(); abort();
} }
void vpaes_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { static void vpaes_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) {
abort(); abort();
} }
void vpaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, static void vpaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length,
const AES_KEY *key, uint8_t *ivec, int enc) { const AES_KEY *key, uint8_t *ivec, int enc) {
abort(); abort();
} }
#endif #endif
@ -201,34 +204,38 @@ void vpaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length,
#if !defined(HWAES) #if !defined(HWAES)
/* If HWAES isn't defined then we provide dummy functions for each of the hwaes /* If HWAES isn't defined then we provide dummy functions for each of the hwaes
* functions. */ * functions. */
int hwaes_capable(void) { static int hwaes_capable(void) {
return 0; return 0;
} }
int aes_v8_set_encrypt_key(const uint8_t *user_key, int bits, static int aes_v8_set_encrypt_key(const uint8_t *user_key, int bits,
AES_KEY *key) { AES_KEY *key) {
abort(); abort();
} }
int aes_v8_set_decrypt_key(const uint8_t *user_key, int bits, AES_KEY *key) { static int aes_v8_set_decrypt_key(const uint8_t *user_key, int bits,
AES_KEY *key) {
abort(); abort();
} }
void aes_v8_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { static void aes_v8_encrypt(const uint8_t *in, uint8_t *out,
const AES_KEY *key) {
abort(); abort();
} }
void aes_v8_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { static void aes_v8_decrypt(const uint8_t *in, uint8_t *out,
const AES_KEY *key) {
abort(); abort();
} }
void aes_v8_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, static void aes_v8_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length,
const AES_KEY *key, uint8_t *ivec, int enc) { const AES_KEY *key, uint8_t *ivec, int enc) {
abort(); abort();
} }
void aes_v8_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, size_t len, static void aes_v8_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out,
const AES_KEY *key, const uint8_t ivec[16]) { size_t len, const AES_KEY *key,
const uint8_t ivec[16]) {
abort(); abort();
} }
#endif #endif
@ -266,14 +273,16 @@ void gcm_ghash_avx(uint64_t Xi[2], const u128 Htable[16], const uint8_t *in,
/* On other platforms, aesni_capable() will always return false and so the /* On other platforms, aesni_capable() will always return false and so the
* following will never be called. */ * following will never be called. */
void aesni_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { static void aesni_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) {
abort(); abort();
} }
int aesni_set_encrypt_key(const uint8_t *userKey, int bits, AES_KEY *key) { static int aesni_set_encrypt_key(const uint8_t *userKey, int bits,
AES_KEY *key) {
abort(); abort();
} }
void aesni_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, size_t blocks, static void aesni_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out,
const void *key, const uint8_t *ivec) { size_t blocks, const void *key,
const uint8_t *ivec) {
abort(); abort();
} }