From b1522e0c59accd21335652301bd4855c12cae5f4 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Thu, 2 Feb 2017 14:55:51 -0700 Subject: [PATCH] pack Sha256 struct --- wolfssl/wolfcrypt/sha256.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wolfssl/wolfcrypt/sha256.h b/wolfssl/wolfcrypt/sha256.h index 790d87c94..997b0c1e1 100644 --- a/wolfssl/wolfcrypt/sha256.h +++ b/wolfssl/wolfcrypt/sha256.h @@ -63,11 +63,12 @@ typedef struct Sha256 { #ifdef FREESCALE_LTC_SHA ltc_hash_ctx_t ctx; #else + /* alignment on digest and buffer speeds up ARMv8 crypto operations */ + ALIGN16 word32 digest[SHA256_DIGEST_SIZE / sizeof(word32)]; + ALIGN16 word32 buffer[SHA256_BLOCK_SIZE / sizeof(word32)]; word32 buffLen; /* in bytes */ word32 loLen; /* length in bytes */ word32 hiLen; /* length in bytes */ - ALIGN16 word32 digest[SHA256_DIGEST_SIZE / sizeof(word32)]; - ALIGN16 word32 buffer[SHA256_BLOCK_SIZE / sizeof(word32)]; #ifdef WOLFSSL_PIC32MZ_HASH pic32mz_desc desc ; /* Crypt Engine descriptor */ #endif