Skip to contentSkip to conversation

target/arm: implement SHA-512 instructions

PATCH Superseded Ard Biesheuvel 1 participant 1 message Jan 9, 2018

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/arm: implement SHA-512 instructions

This implements emulation of the new SHA-512 instructions that have been added as an optional extensions to the ARMv8 Crypto Extensions in ARM v8.2.

---
 target/arm/cpu.h           |   1 +
 target/arm/crypto_helper.c | 136 ++++++++++++++++++++++++++++++++++++++++++++-
 target/arm/helper.h        |   5 ++
 target/arm/translate-a64.c |  82 +++++++++++++++++++++++++++
 4 files changed, 223 insertions(+), 1 deletion(-)
target/arm/cpu.h +1 -0
index 96316700dd6f..295529366c0a 100644
@@ -1340,6 +1340,7 @@ enum arm_features {
     ARM_FEATURE_VBAR, /* has cp15 VBAR */
     ARM_FEATURE_M_SECURITY, /* M profile Security Extension */
     ARM_FEATURE_JAZELLE, /* has (trivial) Jazelle implementation */
+    ARM_FEATURE_V8_SHA512, /* implements SHA512 part of v8 Crypto Extensions */
 };
 
 static inline int arm_feature(CPUARMState *env, int feature)
target/arm/crypto_helper.c +135 -1

154 lines not on this page · raw message

target/arm/helper.h +5 -0
index 066729e8ad8e..efa75440ce81 100644
@@ -534,6 +534,11 @@ DEF_HELPER_4(crypto_sha256h2, void, env, i32, i32, i32)
 DEF_HELPER_3(crypto_sha256su0, void, env, i32, i32)
 DEF_HELPER_4(crypto_sha256su1, void, env, i32, i32, i32)
 
+DEF_HELPER_4(crypto_sha512h, void, env, i32, i32, i32)
+DEF_HELPER_4(crypto_sha512h2, void, env, i32, i32, i32)
+DEF_HELPER_3(crypto_sha512su0, void, env, i32, i32)
+DEF_HELPER_4(crypto_sha512su1, void, env, i32, i32, i32)
+
 DEF_HELPER_FLAGS_3(crc32, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32)
 DEF_HELPER_FLAGS_3(crc32c, TCG_CALL_NO_RWG_SE, i32, i32, i32, i32)
 DEF_HELPER_2(dc_zva, void, env, i64)
target/arm/translate-a64.c +82 -0

94 lines not on this page · raw message

Signature · 1 line
2.11.0