Don't use implementation-specific functions to expose sizes
This commit is contained in:
parent
1dddd63a19
commit
16beebb2ec
@ -479,7 +479,7 @@ do { \
|
||||
} while(0)
|
||||
|
||||
int
|
||||
crypto_aead_aes256gcm_aesni_beforenm(crypto_aead_aes256gcm_aesni_state *ctx_,
|
||||
crypto_aead_aes256gcm_aesni_beforenm(crypto_aead_aes256gcm_state *ctx_,
|
||||
const unsigned char *k)
|
||||
{
|
||||
context *ctx = (context *) ctx_;
|
||||
@ -500,7 +500,7 @@ crypto_aead_aes256gcm_aesni_encrypt_afternm(unsigned char *c, unsigned long long
|
||||
const unsigned char *ad, unsigned long long adlen,
|
||||
const unsigned char *nsec,
|
||||
const unsigned char *npub,
|
||||
const crypto_aead_aes256gcm_aesni_state *ctx_)
|
||||
const crypto_aead_aes256gcm_state *ctx_)
|
||||
{
|
||||
unsigned char H[16];
|
||||
const __m128i rev = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
@ -616,7 +616,7 @@ crypto_aead_aes256gcm_aesni_decrypt_afternm(unsigned char *m, unsigned long long
|
||||
const unsigned char *c, unsigned long long clen,
|
||||
const unsigned char *ad, unsigned long long adlen,
|
||||
const unsigned char *npub,
|
||||
const crypto_aead_aes256gcm_aesni_state *ctx_)
|
||||
const crypto_aead_aes256gcm_state *ctx_)
|
||||
{
|
||||
unsigned char H[16];
|
||||
const __m128i rev = _mm_set_epi8(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
|
||||
@ -770,7 +770,7 @@ crypto_aead_aes256gcm_aesni_encrypt(unsigned char *c,
|
||||
const unsigned char *npub,
|
||||
const unsigned char *k)
|
||||
{
|
||||
crypto_aead_aes256gcm_aesni_state ctx;
|
||||
crypto_aead_aes256gcm_state ctx;
|
||||
|
||||
crypto_aead_aes256gcm_aesni_beforenm(&ctx, k);
|
||||
|
||||
@ -789,9 +789,9 @@ crypto_aead_aes256gcm_aesni_decrypt(unsigned char *m,
|
||||
const unsigned char *npub,
|
||||
const unsigned char *k)
|
||||
{
|
||||
crypto_aead_aes256gcm_aesni_state ctx;
|
||||
crypto_aead_aes256gcm_state ctx;
|
||||
|
||||
crypto_aead_aes256gcm_aesni_beforenm((crypto_aead_aes256gcm_aesni_state *)
|
||||
crypto_aead_aes256gcm_aesni_beforenm((crypto_aead_aes256gcm_state *)
|
||||
&ctx, k);
|
||||
|
||||
return crypto_aead_aes256gcm_aesni_decrypt_afternm
|
||||
@ -799,30 +799,30 @@ crypto_aead_aes256gcm_aesni_decrypt(unsigned char *m,
|
||||
}
|
||||
|
||||
size_t
|
||||
crypto_aead_aes256gcm_aesni_keybytes(void)
|
||||
crypto_aead_aes256gcm_keybytes(void)
|
||||
{
|
||||
return crypto_aead_aes256gcm_KEYBYTES;
|
||||
}
|
||||
|
||||
size_t
|
||||
crypto_aead_aes256gcm_aesni_nsecbytes(void)
|
||||
crypto_aead_aes256gcm_nsecbytes(void)
|
||||
{
|
||||
return crypto_aead_aes256gcm_NSECBYTES;
|
||||
}
|
||||
|
||||
size_t crypto_aead_aes256gcm_aesni_npubbytes(void)
|
||||
size_t crypto_aead_aes256gcm_npubbytes(void)
|
||||
{
|
||||
return crypto_aead_aes256gcm_NPUBBYTES;
|
||||
}
|
||||
|
||||
size_t crypto_aead_aes256gcm_aesni_abytes(void)
|
||||
size_t crypto_aead_aes256gcm_abytes(void)
|
||||
{
|
||||
return crypto_aead_aes256gcm_ABYTES;
|
||||
}
|
||||
|
||||
size_t crypto_aead_aes256gcm_aesni_statebytes(void)
|
||||
size_t crypto_aead_aes256gcm_statebytes(void)
|
||||
{
|
||||
return sizeof(crypto_aead_aes256gcm_aesni_state);
|
||||
return sizeof(crypto_aead_aes256gcm_state);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -13,23 +13,23 @@ extern "C" {
|
||||
|
||||
#define crypto_aead_aes256gcm_KEYBYTES 32U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_aes256gcm_aesni_keybytes(void);
|
||||
size_t crypto_aead_aes256gcm_keybytes(void);
|
||||
|
||||
#define crypto_aead_aes256gcm_NSECBYTES 0U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_aes256gcm_aesni_nsecbytes(void);
|
||||
size_t crypto_aead_aes256gcm_nsecbytes(void);
|
||||
|
||||
#define crypto_aead_aes256gcm_NPUBBYTES 12U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_aes256gcm_aesni_npubbytes(void);
|
||||
size_t crypto_aead_aes256gcm_pubbytes(void);
|
||||
|
||||
#define crypto_aead_aes256gcm_ABYTES 16U
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_aes256gcm_aesni_abytes(void);
|
||||
size_t crypto_aead_aes256gcm_abytes(void);
|
||||
|
||||
typedef CRYPTO_ALIGN(16) unsigned char crypto_aead_aes256gcm_aesni_state[272];
|
||||
typedef CRYPTO_ALIGN(16) unsigned char crypto_aead_aes256gcm_state[512];
|
||||
SODIUM_EXPORT
|
||||
size_t crypto_aead_aes256gcm_aesni_statebytes(void);
|
||||
size_t crypto_aead_aes256gcm_statebytes(void);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_aes256gcm_aesni_encrypt(unsigned char *c,
|
||||
@ -54,7 +54,7 @@ int crypto_aead_aes256gcm_aesni_decrypt(unsigned char *m,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_aes256gcm_aesni_beforenm(crypto_aead_aes256gcm_aesni_state *ctx_,
|
||||
int crypto_aead_aes256gcm_aesni_beforenm(crypto_aead_aes256gcm_state *ctx_,
|
||||
const unsigned char *k);
|
||||
|
||||
SODIUM_EXPORT
|
||||
@ -66,7 +66,7 @@ int crypto_aead_aes256gcm_aesni_encrypt_afternm(unsigned char *c,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *nsec,
|
||||
const unsigned char *npub,
|
||||
const crypto_aead_aes256gcm_aesni_state *ctx_);
|
||||
const crypto_aead_aes256gcm_state *ctx_);
|
||||
|
||||
SODIUM_EXPORT
|
||||
int crypto_aead_aes256gcm_aesni_decrypt_afternm(unsigned char *m,
|
||||
@ -77,7 +77,7 @@ int crypto_aead_aes256gcm_aesni_decrypt_afternm(unsigned char *m,
|
||||
const unsigned char *ad,
|
||||
unsigned long long adlen,
|
||||
const unsigned char *npub,
|
||||
const crypto_aead_aes256gcm_aesni_state *ctx_);
|
||||
const crypto_aead_aes256gcm_state *ctx_);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user