forked from wolfSSL/wolfssl
Updated with review comments
This commit is contained in:
@ -5123,8 +5123,8 @@ void GHASH(Aes* aes, const byte* a, word32 aSz, const byte* c,
|
|||||||
}
|
}
|
||||||
#ifdef OPENSSL_EXTRA
|
#ifdef OPENSSL_EXTRA
|
||||||
/* store AAD partial tag for next call */
|
/* store AAD partial tag for next call */
|
||||||
aes->aadH[0] = x[0];
|
aes->aadH[0] = (word32)x[0];
|
||||||
aes->aadH[1] = x[1];
|
aes->aadH[1] = (word32)x[1];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5136,8 +5136,8 @@ void GHASH(Aes* aes, const byte* a, word32 aSz, const byte* c,
|
|||||||
#ifdef OPENSSL_EXTRA
|
#ifdef OPENSSL_EXTRA
|
||||||
/* Start from last AAD partial tag */
|
/* Start from last AAD partial tag */
|
||||||
if(aes->aadLen) {
|
if(aes->aadLen) {
|
||||||
x[0] = aes->aadH[0];
|
x[0] = (word64)aes->aadH[0];
|
||||||
x[1] = aes->aadH[1];
|
x[1] = (word64)aes->aadH[1];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
while (blocks--) {
|
while (blocks--) {
|
||||||
@ -5168,7 +5168,7 @@ void GHASH(Aes* aes, const byte* a, word32 aSz, const byte* c,
|
|||||||
len[0] = aSz; len[1] = cSz;
|
len[0] = aSz; len[1] = cSz;
|
||||||
#ifdef OPENSSL_EXTRA
|
#ifdef OPENSSL_EXTRA
|
||||||
if (aes->aadLen)
|
if (aes->aadLen)
|
||||||
len[0] = aes->aadLen;
|
len[0] = (word64)aes->aadLen;
|
||||||
#endif
|
#endif
|
||||||
/* Lengths are in bytes. Convert to bits. */
|
/* Lengths are in bytes. Convert to bits. */
|
||||||
len[0] *= 8;
|
len[0] *= 8;
|
||||||
@ -5567,7 +5567,7 @@ int AES_GCM_encrypt_C(Aes* aes, byte* out, const byte* in, word32 sz,
|
|||||||
byte *ctr;
|
byte *ctr;
|
||||||
byte scratch[AES_BLOCK_SIZE];
|
byte scratch[AES_BLOCK_SIZE];
|
||||||
#ifdef OPENSSL_EXTRA
|
#ifdef OPENSSL_EXTRA
|
||||||
word64 aadTemp;
|
word32 aadTemp;
|
||||||
#endif
|
#endif
|
||||||
ctr = counter;
|
ctr = counter;
|
||||||
XMEMSET(initialCounter, 0, AES_BLOCK_SIZE);
|
XMEMSET(initialCounter, 0, AES_BLOCK_SIZE);
|
||||||
|
@ -35,8 +35,8 @@
|
|||||||
/* Padding types */
|
/* Padding types */
|
||||||
#define RSA_PKCS1_PADDING 0
|
#define RSA_PKCS1_PADDING 0
|
||||||
#define RSA_PKCS1_OAEP_PADDING 1
|
#define RSA_PKCS1_OAEP_PADDING 1
|
||||||
#define RSA_NO_PADDING 3
|
#define RSA_NO_PADDING 2
|
||||||
#define RSA_PKCS1_PSS_PADDING 6
|
#define RSA_PKCS1_PSS_PADDING 3
|
||||||
|
|
||||||
#ifndef WOLFSSL_RSA_TYPE_DEFINED /* guard on redeclaration */
|
#ifndef WOLFSSL_RSA_TYPE_DEFINED /* guard on redeclaration */
|
||||||
typedef struct WOLFSSL_RSA WOLFSSL_RSA;
|
typedef struct WOLFSSL_RSA WOLFSSL_RSA;
|
||||||
|
@ -146,8 +146,8 @@ typedef struct Aes {
|
|||||||
#ifdef HAVE_AESGCM
|
#ifdef HAVE_AESGCM
|
||||||
ALIGN16 byte H[AES_BLOCK_SIZE];
|
ALIGN16 byte H[AES_BLOCK_SIZE];
|
||||||
#ifdef OPENSSL_EXTRA
|
#ifdef OPENSSL_EXTRA
|
||||||
word64 aadH[2]; /* additional authenticated data hash */
|
word32 aadH[2]; /* additional authenticated data GASH */
|
||||||
word64 aadLen; /* additional authenticated data len */
|
word32 aadLen; /* additional authenticated data len */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GCM_TABLE
|
#ifdef GCM_TABLE
|
||||||
|
Reference in New Issue
Block a user