target/arm: implement SHA-512 instructions
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.
Signed-off-by Ard Biesheuvel <[email protected]>
--- 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
@@ -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
@@ -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