Implementation notes: amd64, nucnuc, crypto_dh/gls254

Computer: nucnuc
Microarchitecture: amd64; Airmont (406c3)
Architecture: amd64
CPU ID: GenuineIntel-000406c3-bfebfbff
SUPERCOP version: 20240107
Operation: crypto_dh
Primitive: gls254
TimeObject sizeTest sizeImplementationCompilerBenchmark dateSUPERCOP version
561492131136 16 0149659 852 1720T:refclang_-march=native_-O2_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023122820231217
562355134992 16 0155131 852 1720T:refclang_-march=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023122820231217
57288928539 98336 048831 99140 1784T:refgcc_-march=native_-mtune=native_-O3_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023122820231217
583307115415 16 0132465 844 1720T:refclang_-march=native_-Os_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023122820231217
59134214747 98336 033879 99140 1784T:refgcc_-march=native_-mtune=native_-O2_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023122820231217
59965812108 98336 029223 99132 1752T:refgcc_-march=native_-mtune=native_-Os_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023122820231217
60294813310 98336 031551 99140 1784T:refgcc_-march=native_-mtune=native_-O_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023122820231217
622346110638 16 0128473 844 1720T:refclang_-march=native_-O_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023122820231217
80145823848 196608 043720 197404 1784T:optgcc_-march=native_-mtune=native_-O3_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023122820231217
80432621952 196608 040640 197404 1784T:optgcc_-march=native_-mtune=native_-O2_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023122820231217
80741020194 196608 038336 197404 1784T:optgcc_-march=native_-mtune=native_-O_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023122820231217
80950619694 196608 037558 197428 1720T:optclang_-march=native_-O_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023122820231217
81110916629 196608 033608 197396 1752T:optgcc_-march=native_-mtune=native_-Os_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023122820231217
82141923528 196608 040910 197428 1720T:optclang_-march=native_-Os_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023122820231217
82709551302 196608 070208 197436 1720T:optclang_-march=native_-O2_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023122820231217
82748151302 196608 071872 197436 1720T:optclang_-march=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023122820231217
83868138219 98304 058520 99100 1784T:protgcc_-march=native_-mtune=native_-O3_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023122820231217
84211816624 98304 035712 99100 1784T:protgcc_-march=native_-mtune=native_-O2_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023122820231217
85099812954 98304 030032 99092 1752T:protgcc_-march=native_-mtune=native_-Os_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023122820231217
858081123448 0 0140286 812 1720T:protclang_-march=native_-Os_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023122820231217
885662154880 0 0173184 820 1720T:protclang_-march=native_-O2_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023122820231217
887178157952 0 0177904 820 1720T:protclang_-march=native_-O3_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023122820231217
89074914539 98304 032784 99100 1784T:protgcc_-march=native_-mtune=native_-O_-fomit-frame-pointer_-fwrapv_-fPIC_-fPIE2023122820231217
914848112751 0 0130502 812 1720T:protclang_-march=native_-O_-fomit-frame-pointer_-fwrapv_-Qunused-arguments_-fPIC_-fPIE2023122820231217

Compiler output

Implementation: T:opt
Security model: timingleaks
Compiler: clang -mcpu=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
dh.c: In file included from dh.c:10:
dh.c: ./ffa.h:94:5: error: '__builtin_ia32_pclmulqdq128' needs target feature pclmul
dh.c: low_kts_stp(op00,op10,k00,k02,op01,op11,r00,r01,r02,0x00); /* a0xb0 */
dh.c: ^
dh.c: ./ffa.h:62:11: note: expanded from macro 'low_kts_stp'
dh.c: re0 = _mm_clmulepi64_si128(op0, op1, ord);\
dh.c: ^
dh.c: /usr/lib/llvm-11/lib/clang/11.0.1/include/__wmmintrin_pclmul.h:45:13: note: expanded from macro '_mm_clmulepi64_si128'
dh.c: ((__m128i)__builtin_ia32_pclmulqdq128((__v2di)(__m128i)(X), \
dh.c: ^
dh.c: In file included from dh.c:10:
dh.c: ./ffa.h:94:5: error: '__builtin_ia32_pclmulqdq128' needs target feature pclmul
dh.c: ./ffa.h:63:11: note: expanded from macro 'low_kts_stp'
dh.c: re1 = _mm_clmulepi64_si128(op2, op3, ord);\
dh.c: ^
dh.c: /usr/lib/llvm-11/lib/clang/11.0.1/include/__wmmintrin_pclmul.h:45:13: note: expanded from macro '_mm_clmulepi64_si128'
dh.c: ((__m128i)__builtin_ia32_pclmulqdq128((__v2di)(__m128i)(X), \
dh.c: ^
dh.c: In file included from dh.c:10:
dh.c: ./ffa.h:94:5: error: '__builtin_ia32_pclmulqdq128' needs target feature pclmul
dh.c: ./ffa.h:64:11: note: expanded from macro 'low_kts_stp'
dh.c: re2 = _mm_clmulepi64_si128(op4, op5, ord);\
dh.c: ^
dh.c: /usr/lib/llvm-11/lib/clang/11.0.1/include/__wmmintrin_pclmul.h:45:13: note: expanded from macro '_mm_clmulepi64_si128'
dh.c: ((__m128i)__builtin_ia32_pclmulqdq128((__v2di)(__m128i)(X), \
dh.c: ...

Number of similar (compiler,implementation) pairs: 1, namely:
CompilerImplementations
clang -mcpu=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:opt

Compiler output

Implementation: T:prot
Security model: timingleaks
Compiler: clang -march=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
dh.c: In file included from dh.c:9:
dh.c: ./scmul.incl:273:17: warning: implicit declaration of function 'types_cond_copy2' is invalid in C99 [-Wimplicit-function-declaration]
dh.c: types_cond_copy2(tab0, tab4, tabx, n1, n2);
dh.c: ^
dh.c: ./scmul.incl:284:9: warning: implicit declaration of function 'types_cond_copy' is invalid in C99 [-Wimplicit-function-declaration]
dh.c: types_cond_copy(QX, tab0, o1);
dh.c: ^
dh.c: 2 warnings generated.

Number of similar (compiler,implementation) pairs: 4, namely:
CompilerImplementations
clang -march=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:prot
clang -march=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:prot
clang -march=native -O -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:prot
clang -march=native -Os -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:prot

Compiler output

Implementation: T:prot
Security model: timingleaks
Compiler: clang -mcpu=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
dh.c: In file included from dh.c:7:
dh.c: ./low.incl:26:2: error: '__builtin_ia32_pclmulqdq128' needs target feature pclmul
dh.c: MUL4(m1, m0, ma, mb);
dh.c: ^
dh.c: ./gls254.h:155:7: note: expanded from macro 'MUL4'
dh.c: r0 = _mm_clmulepi64_si128(ma, mb, 0x00);\
dh.c: ^
dh.c: /usr/lib/llvm-11/lib/clang/11.0.1/include/__wmmintrin_pclmul.h:45:13: note: expanded from macro '_mm_clmulepi64_si128'
dh.c: ((__m128i)__builtin_ia32_pclmulqdq128((__v2di)(__m128i)(X), \
dh.c: ^
dh.c: In file included from dh.c:7:
dh.c: ./low.incl:26:2: error: '__builtin_ia32_pclmulqdq128' needs target feature pclmul
dh.c: ./gls254.h:156:7: note: expanded from macro 'MUL4'
dh.c: r1 = _mm_clmulepi64_si128(ma, mb, 0x11);\
dh.c: ^
dh.c: /usr/lib/llvm-11/lib/clang/11.0.1/include/__wmmintrin_pclmul.h:45:13: note: expanded from macro '_mm_clmulepi64_si128'
dh.c: ((__m128i)__builtin_ia32_pclmulqdq128((__v2di)(__m128i)(X), \
dh.c: ^
dh.c: In file included from dh.c:7:
dh.c: ./low.incl:26:2: error: '__builtin_ia32_pclmulqdq128' needs target feature pclmul
dh.c: ./gls254.h:157:7: note: expanded from macro 'MUL4'
dh.c: t0 = _mm_clmulepi64_si128(t0, t0, 0x10);\
dh.c: ^
dh.c: /usr/lib/llvm-11/lib/clang/11.0.1/include/__wmmintrin_pclmul.h:45:13: note: expanded from macro '_mm_clmulepi64_si128'
dh.c: ((__m128i)__builtin_ia32_pclmulqdq128((__v2di)(__m128i)(X), \
dh.c: ...

Number of similar (compiler,implementation) pairs: 1, namely:
CompilerImplementations
clang -mcpu=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:prot

Compiler output

Implementation: T:prot
Security model: timingleaks
Compiler: gcc -march=native -mtune=native -O2 -fomit-frame-pointer -fwrapv -fPIC -fPIE
dh.c: In file included from dh.c:9:
dh.c: scmul.incl: In function 'scmul_rand_wreg':
dh.c: scmul.incl:273:17: warning: implicit declaration of function 'types_cond_copy2'; did you mean 'types_copy'? [-Wimplicit-function-declaration]
dh.c: 273 | types_cond_copy2(tab0, tab4, tabx, n1, n2);
dh.c: | ^~~~~~~~~~~~~~~~
dh.c: | types_copy
dh.c: scmul.incl:284:9: warning: implicit declaration of function 'types_cond_copy'; did you mean 'types_copy'? [-Wimplicit-function-declaration]
dh.c: 284 | types_cond_copy(QX, tab0, o1);
dh.c: | ^~~~~~~~~~~~~~~
dh.c: | types_copy

Number of similar (compiler,implementation) pairs: 4, namely:
CompilerImplementations
gcc -march=native -mtune=native -O2 -fomit-frame-pointer -fwrapv -fPIC -fPIE T:prot
gcc -march=native -mtune=native -O3 -fomit-frame-pointer -fwrapv -fPIC -fPIE T:prot
gcc -march=native -mtune=native -O -fomit-frame-pointer -fwrapv -fPIC -fPIE T:prot
gcc -march=native -mtune=native -Os -fomit-frame-pointer -fwrapv -fPIC -fPIE T:prot

Compiler output

Implementation: T:ref
Security model: timingleaks
Compiler: clang -march=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
dh.c: In file included from dh.c:9:
dh.c: ./scmul.incl:204:14: warning: & has lower precedence than ==; == will be evaluated first [-Wparentheses]
dh.c: if (num[0] & 0x1 == 1) {
dh.c: ^~~~~~~~~~
dh.c: ./scmul.incl:204:14: note: place parentheses around the '==' expression to silence this warning
dh.c: if (num[0] & 0x1 == 1) {
dh.c: ^
dh.c: ( )
dh.c: ./scmul.incl:204:14: note: place parentheses around the & expression to evaluate it first
dh.c: if (num[0] & 0x1 == 1) {
dh.c: ^
dh.c: ( )
dh.c: 1 warning generated.

Number of similar (compiler,implementation) pairs: 4, namely:
CompilerImplementations
clang -march=native -O2 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:ref
clang -march=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:ref
clang -march=native -O -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:ref
clang -march=native -Os -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:ref

Compiler output

Implementation: T:ref
Security model: timingleaks
Compiler: clang -mcpu=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE
dh.c: In file included from dh.c:6:
dh.c: ./curves.incl:53:2: error: '__builtin_ia32_aeskeygenassist128' needs target feature aes
dh.c: STEP(k, t, tmp, 16*1, 0x01);
dh.c: ^
dh.c: ./gls254.h:272:6: note: expanded from macro 'STEP'
dh.c: t = _mm_aeskeygenassist_si128(k, rcon);\
dh.c: ^
dh.c: /usr/lib/llvm-11/lib/clang/11.0.1/include/__wmmintrin_aes.h:136:12: note: expanded from macro '_mm_aeskeygenassist_si128'
dh.c: (__m128i)__builtin_ia32_aeskeygenassist128((__v2di)(__m128i)(C), (int)(R))
dh.c: ^
dh.c: In file included from dh.c:6:
dh.c: ./curves.incl:54:2: error: '__builtin_ia32_aeskeygenassist128' needs target feature aes
dh.c: STEP(k, t, tmp, 16*2, 0x02);
dh.c: ^
dh.c: ./gls254.h:272:6: note: expanded from macro 'STEP'
dh.c: t = _mm_aeskeygenassist_si128(k, rcon);\
dh.c: ^
dh.c: /usr/lib/llvm-11/lib/clang/11.0.1/include/__wmmintrin_aes.h:136:12: note: expanded from macro '_mm_aeskeygenassist_si128'
dh.c: (__m128i)__builtin_ia32_aeskeygenassist128((__v2di)(__m128i)(C), (int)(R))
dh.c: ^
dh.c: In file included from dh.c:6:
dh.c: ./curves.incl:55:2: error: '__builtin_ia32_aeskeygenassist128' needs target feature aes
dh.c: STEP(k, t, tmp, 16*3, 0x04);
dh.c: ^
dh.c: ./gls254.h:272:6: note: expanded from macro 'STEP'
dh.c: ...

Number of similar (compiler,implementation) pairs: 1, namely:
CompilerImplementations
clang -mcpu=native -O3 -fomit-frame-pointer -fwrapv -Qunused-arguments -fPIC -fPIE T:ref