File: test_arm_sm3.cpp

package info (click to toggle)
libcrypto%2B%2B 8.9.0-2
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,960 kB
  • sloc: cpp: 110,116; asm: 10,493; sh: 8,937; makefile: 55
file content (19 lines) | stat: -rw-r--r-- 512 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdint.h>
#if (CRYPTOPP_ARM_NEON_HEADER)
# include <arm_neon.h>
#endif

int main(int argc, char* argv[])
{
    // SM3 hash
    // https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics?search=SM3
    uint32x4_t x={1}, y={2}, z={3};
    y=vsm3ss1q_u32(x,y,z);
    y=vsm3tt1aq_u32(x,y,z,3);
    y=vsm3tt1bq_u32(x,y,z,1);
    y=vsm3tt2aq_u32(x,y,z,2);
    y=vsm3tt2bq_u32(x,y,z,3);
    y=vsm3partw1q_u32(x,y,z);
    y=vsm3partw2q_u32(x,y,z);
    return 0;
}