You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FEAT_SHA3 provides instructions to accelerate the SHA-3 hash algorithm. This set of instructions is described as
the SHA3 instructions.
The SHA-3 hash algorithm is based on a running digest of 1600 bytes, arranged as a five by five array of 64-bit registers. The Arm acceleration of these instructions is based on mapping the 25 64-bit values into 25 vector registers, with each 64-bit value occupying the same 64-bit element in each vector. A series of transformations is performed on these registers as part of a round of the SHA-3 hash calculation.
The SIMD nature of the vector registers means the acceleration can compute two parallel SHA3 hash calculations,
where one calculation is performed using the zeroth 64-bit element of each vector, and the other calculation is
performed using the first 64-bit element of each vector.
/// Full APIpublicabstractpartialclassSha3:AdvSimd/// Feature: FEAT_SHA3{/// BitwiseClearXor : Bit Clear and Exclusive OR performs a bitwise AND of the 128-bit vector in a source SIMD&FP register and the complement of the vector in another source SIMD&FP register, then performs a bitwise exclusive OR of the resulting vector and the vector in a third source SIMD&FP register, and writes the result to the destination SIMD&FP register./// uint8x16_t vbcaxq_u8(uint8x16_t a, uint8x16_t b, uint8x16_t c) : "BCAX Vd.16B,Vn.16B,Vm.16B,Va.16B"publicstaticunsafeVector128<byte>BitwiseClearXor(Vector128<byte>xor,Vector128<byte>value,Vector128<byte>mask);/// uint16x8_t vbcaxq_u16(uint16x8_t a, uint16x8_t b, uint16x8_t c) : "BCAX Vd.16B,Vn.16B,Vm.16B,Va.16B"publicstaticunsafeVector128<ushort>BitwiseClearXor(Vector128<ushort>xor,Vector128<ushort>value,Vector128<ushort>mask);/// uint32x4_t vbcaxq_u32(uint32x4_t a, uint32x4_t b, uint32x4_t c) : "BCAX Vd.16B,Vn.16B,Vm.16B,Va.16B"publicstaticunsafeVector128<uint>BitwiseClearXor(Vector128<uint>xor,Vector128<uint>value,Vector128<uint>mask);/// uint64x2_t vbcaxq_u64(uint64x2_t a, uint64x2_t b, uint64x2_t c) : "BCAX Vd.16B,Vn.16B,Vm.16B,Va.16B"publicstaticunsafeVector128<ulong>BitwiseClearXor(Vector128<ulong>xor,Vector128<ulong>value,Vector128<ulong>mask);/// int8x16_t vbcaxq_s8(int8x16_t a, int8x16_t b, int8x16_t c) : "BCAX Vd.16B,Vn.16B,Vm.16B,Va.16B"publicstaticunsafeVector128<sbyte>BitwiseClearXor(Vector128<sbyte>xor,Vector128<sbyte>value,Vector128<sbyte>mask);/// int16x8_t vbcaxq_s16(int16x8_t a, int16x8_t b, int16x8_t c) : "BCAX Vd.16B,Vn.16B,Vm.16B,Va.16B"publicstaticunsafeVector128<short>BitwiseClearXor(Vector128<short>xor,Vector128<short>value,Vector128<short>mask);/// int32x4_t vbcaxq_s32(int32x4_t a, int32x4_t b, int32x4_t c) : "BCAX Vd.16B,Vn.16B,Vm.16B,Va.16B"publicstaticunsafeVector128<int>BitwiseClearXor(Vector128<int>xor,Vector128<int>value,Vector128<int>mask);/// int64x2_t vbcaxq_s64(int64x2_t a, int64x2_t b, int64x2_t c) : "BCAX Vd.16B,Vn.16B,Vm.16B,Va.16B"publicstaticunsafeVector128<long>BitwiseClearXor(Vector128<long>xor,Vector128<long>value,Vector128<long>mask);/// BitwiseRotateLeftBy1AndXor : Rotate and Exclusive OR rotates each 64-bit element of the 128-bit vector in a source SIMD&FP register left by 1, performs a bitwise exclusive OR of the resulting 128-bit vector and the vector in another source SIMD&FP register, and writes the result to the destination SIMD&FP register./// uint64x2_t vrax1q_u64(uint64x2_t a, uint64x2_t b) : "RAX1 Vd.2D,Vn.2D,Vm.2D"publicstaticunsafeVector128<ulong>BitwiseRotateLeftBy1AndXor(Vector128<ulong>a,Vector128<ulong>b);/// Xor : Three-way Exclusive OR performs a three-way exclusive OR of the values in the three source SIMD&FP registers, and writes the result to the destination SIMD&FP register./// uint8x16_t veor3q_u8(uint8x16_t a, uint8x16_t b, uint8x16_t c) : "EOR3 Vd.16B,Vn.16B,Vm.16B,Va.16B"publicstaticunsafeVector128<byte>Xor(Vector128<byte>value1,Vector128<byte>value2,Vector128<byte>value3);/// uint16x8_t veor3q_u16(uint16x8_t a, uint16x8_t b, uint16x8_t c) : "EOR3 Vd.16B,Vn.16B,Vm.16B,Va.16B"publicstaticunsafeVector128<ushort>Xor(Vector128<ushort>value1,Vector128<ushort>value2,Vector128<ushort>value3);/// uint32x4_t veor3q_u32(uint32x4_t a, uint32x4_t b, uint32x4_t c) : "EOR3 Vd.16B,Vn.16B,Vm.16B,Va.16B"publicstaticunsafeVector128<uint>Xor(Vector128<uint>value1,Vector128<uint>value2,Vector128<uint>value3);/// uint64x2_t veor3q_u64(uint64x2_t a, uint64x2_t b, uint64x2_t c) : "EOR3 Vd.16B,Vn.16B,Vm.16B,Va.16B"publicstaticunsafeVector128<ulong>Xor(Vector128<ulong>value1,Vector128<ulong>value2,Vector128<ulong>value3);/// int8x16_t veor3q_s8(int8x16_t a, int8x16_t b, int8x16_t c) : "EOR3 Vd.16B,Vn.16B,Vm.16B,Va.16B"publicstaticunsafeVector128<sbyte>Xor(Vector128<sbyte>value1,Vector128<sbyte>value2,Vector128<sbyte>value3);/// int16x8_t veor3q_s16(int16x8_t a, int16x8_t b, int16x8_t c) : "EOR3 Vd.16B,Vn.16B,Vm.16B,Va.16B"publicstaticunsafeVector128<short>Xor(Vector128<short>value1,Vector128<short>value2,Vector128<short>value3);/// int32x4_t veor3q_s32(int32x4_t a, int32x4_t b, int32x4_t c) : "EOR3 Vd.16B,Vn.16B,Vm.16B,Va.16B"publicstaticunsafeVector128<int>Xor(Vector128<int>value1,Vector128<int>value2,Vector128<int>value3);/// int64x2_t veor3q_s64(int64x2_t a, int64x2_t b, int64x2_t c) : "EOR3 Vd.16B,Vn.16B,Vm.16B,Va.16B"publicstaticunsafeVector128<long>Xor(Vector128<long>value1,Vector128<long>value2,Vector128<long>value3);/// XorRotateRight : Exclusive OR and Rotate performs a bitwise exclusive OR of the 128-bit vectors in the two source SIMD&FP registers, rotates each 64-bit element of the resulting 128-bit vector right by the value specified by a 6-bit immediate value, and writes the result to the destination SIMD&FP register./// uint64x2_t vxarq_u64(uint64x2_t a, uint64x2_t b, const int imm6) : "XAR Vd.2D,Vn.2D,Vm.2D,imm6"publicstaticunsafeVector128<ulong>XorRotateRight(Vector128<ulong>left,Vector128<ulong>right,[ConstantExpected]bytecount);/// total method signatures: 18/// total method names: 4}/// Total ACLE covered across API: 18
Activity
a74nh commentedon Feb 20, 2024
a74nh commentedon Feb 20, 2024
This adds the API for
FEAT_SHA3. It complements theFEAT_SVE_SHA3API which is specified in #94425.Note this is a
NEON(AdvSimd) extension. It is not a SVE extension.a74nh commentedon Feb 20, 2024
@tannergooding : As requested, the API for SHA3. SVE versions of
BitwiseRotateLeftBy1AndXorexist inSVE_SHA3and the other ones exist in SVE2bartonjs commentedon Jan 6, 2026
Video
Add SHA3 and SVE SHA3 APIs
Add SHA3 and SVE SHA3 APIs (#126941)
Add SHA3 and SVE SHA3 APIs (#126941)