big endian testing and packing Aes struct

This commit is contained in:
Jacob Barthelmeh
2017-09-01 15:32:55 -06:00
parent d48c940334
commit c482524b78
2 changed files with 7 additions and 1 deletions

View File

@@ -8100,6 +8100,9 @@ int wc_AesXtsEncryptSector(Aes* tweak, Aes* aes, byte* out, const byte* in,
byte i[AES_BLOCK_SIZE];
XMEMSET(i, 0, AES_BLOCK_SIZE);
#ifdef BIG_ENDIAN_ORDER
sector = ByteReverseWord64(sector);
#endif
pt = (byte*)&sector;
XMEMCPY(i, pt, sizeof(word64));
@@ -8127,6 +8130,9 @@ int wc_AesXtsDecryptSector(Aes* tweak, Aes* aes, byte* out, const byte* in, word
byte i[AES_BLOCK_SIZE];
XMEMSET(i, 0, AES_BLOCK_SIZE);
#ifdef BIG_ENDIAN_ORDER
sector = ByteReverseWord64(sector);
#endif
pt = (byte*)&sector;
XMEMCPY(i, pt, sizeof(word64));

View File

@@ -110,11 +110,11 @@ typedef struct Aes {
word32 key_init[8];
word32 kup;
#endif
void* heap; /* memory hint to use */
#ifdef WOLFSSL_AES_XTS
byte type; /* adds the ability to do a sanity check on key for
* encrypt/decrypt */
#endif
void* heap; /* memory hint to use */
} Aes;