Browse Source

Allow SHA-512 unaligned data access in |OPENSSL_NO_ASM| mode.

The previous logic only defined
|SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA| when the assembly language
optimizations were enabled, but
|SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA| is also useful when the C
implementations are used.

If support for ARM processors that don't support unaligned access is
important, then it might be better to condition the enabling of
|SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA| on ARM based on more specific
flags.

Change-Id: Ie8c37c73aba308c3ccf79371ce5831512e419989
Reviewed-on: https://boringssl-review.googlesource.com/6402
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
Brian Smith 9 years ago
committed by Adam Langley
parent
commit
2e24b9bf73
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      crypto/sha/sha512.c

+ 5
- 1
crypto/sha/sha512.c View File

@@ -78,10 +78,14 @@
#if !defined(OPENSSL_NO_ASM) && \
(defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \
defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64))
#define SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA
#define SHA512_ASM
#endif

#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \
defined(__ARM_FEATURE_UNALIGNED)
#define SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA
#endif

int SHA384_Init(SHA512_CTX *sha) {
sha->h[0] = OPENSSL_U64(0xcbbb9d5dc1059ed8);
sha->h[1] = OPENSSL_U64(0x629a292a367cd507);


Loading…
Cancel
Save