VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Crypto/Sha2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Crypto/Sha2.c')
-rw-r--r--src/Crypto/Sha2.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Crypto/Sha2.c b/src/Crypto/Sha2.c
index 5ae9cae2..27e61c3d 100644
--- a/src/Crypto/Sha2.c
+++ b/src/Crypto/Sha2.c
@@ -315,6 +315,10 @@ extern "C"
void VC_CDECL sha256_compress_nayuki(uint_32t state[8], const uint_8t block[64]);
#endif
+#if CRYPTOPP_ARM_SHA2_AVAILABLE
+ void sha256_compress_digest_armv8(const void* input_data, uint_32t digest[8], uint_64t num_blks);
+#endif
+
#if defined(__cplusplus)
}
#endif
@@ -757,6 +761,13 @@ void SSE2Sha256Transform(sha256_ctx* ctx, void* mp, uint_64t num_blks)
}
#endif
+#if CRYPTOPP_ARM_SHA2_AVAILABLE
+void ArmSha256Transform(sha256_ctx* ctx, void* mp, uint_64t num_blks)
+{
+ sha256_compress_digest_armv8(mp, ctx->hash, num_blks);
+}
+#endif
+
#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32
void Sha256AsmTransform(sha256_ctx* ctx, void* mp, uint_64t num_blks)
{
@@ -805,6 +816,12 @@ void sha256_begin(sha256_ctx* ctx)
else
#endif
+#if CRYPTOPP_ARM_SHA2_AVAILABLE
+ if (HasSHA256())
+ sha256transfunc = ArmSha256Transform;
+ else
+#endif
+
#if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32
sha256transfunc = Sha256AsmTransform;
#else