aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <[email protected]>2023-12-20 14:47:14 +0900
committerMITSUNARI Shigeo <[email protected]>2023-12-20 14:47:14 +0900
commite690a2a47d7a48a4ebdcaf984afe67d2eb650224 (patch)
tree420be985d6048441f2bf8b1cd7fd92b585e88dce /test
parentc9765588f0e4f9fdaa5f054f45818e42045d3ed1 (diff)
downloadxbyak-e690a2a47d7a48a4ebdcaf984afe67d2eb650224.tar.gz
xbyak-e690a2a47d7a48a4ebdcaf984afe67d2eb650224.zip
sha* supports apx
Diffstat (limited to 'test')
-rw-r--r--test/apx.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/apx.cpp b/test/apx.cpp
index b2675b8..207389c 100644
--- a/test/apx.cpp
+++ b/test/apx.cpp
@@ -1870,3 +1870,31 @@ CYBOZU_TEST_AUTO(encodekey)
CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n);
}
+CYBOZU_TEST_AUTO(sha)
+{
+ struct Code : Xbyak::CodeGenerator {
+ Code()
+ {
+ sha1msg1(xmm15, ptr [r30+r29*8+0x12]);
+ sha1msg2(xmm15, ptr [r30+r29*8+0x12]);
+ sha1nexte(xmm15, ptr [r30+r29*8+0x12]);
+ sha256msg1(xmm15, ptr [r30+r29*8+0x12]);
+ sha256msg2(xmm15, ptr [r30+r29*8+0x12]);
+ sha256rnds2(xmm15, ptr [r30+r29*8+0x12]);
+ sha1rnds4(xmm15, ptr [r30+r29*8+0x12], 0x23);
+ }
+ } c;
+ const uint8_t tbl[] = {
+ 0x62, 0x1c, 0x78, 0x08, 0xd9, 0x7c, 0xee, 0x12,
+ 0x62, 0x1c, 0x78, 0x08, 0xda, 0x7c, 0xee, 0x12,
+ 0x62, 0x1c, 0x78, 0x08, 0xd8, 0x7c, 0xee, 0x12,
+ 0x62, 0x1c, 0x78, 0x08, 0xdc, 0x7c, 0xee, 0x12,
+ 0x62, 0x1c, 0x78, 0x08, 0xdd, 0x7c, 0xee, 0x12,
+ 0x62, 0x1c, 0x78, 0x08, 0xdb, 0x7c, 0xee, 0x12,
+ 0x62, 0x1c, 0x78, 0x08, 0xd4, 0x7c, 0xee, 0x12, 0x23,
+ };
+ const size_t n = sizeof(tbl);
+ CYBOZU_TEST_EQUAL(c.getSize(), n);
+ CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n);
+}
+