Implementation notes: amd64, bolero, crypto_kem/kyber1024

Computer: bolero
Microarchitecture: amd64; Broadwell+AES (406f1)
Architecture: amd64
CPU ID: GenuineIntel-000406f1-1fc9cbf5
SUPERCOP version: 20240625
Operation: crypto_kem
Primitive: kyber1024
TimeObject sizeTest sizeImplementationCompilerBenchmark dateSUPERCOP version
150448147334 0 0169332 824 1576avx2clang_-march=native_-O3_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062820240625
152076127200 0 0146054 816 1640avx2clang_-march=native_-Os_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062820240625
156444132209 0 0150388 824 1576avx2clang_-march=native_-O_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062820240625
164296141652 0 0163348 824 1576avx2clang_-march=native_-O2_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062820240625
60916884655 0 0115372 824 1576compactclang_-march=native_-O3_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062820240625
63014062721 0 093430 784 1608compactgcc_-march=native_-mtune=native_-O3_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062820240625
65376464191 0 095068 824 1576compactclang_-march=native_-O2_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062820240625
69893653547 0 074852 824 1576refclang_-march=native_-O3_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062820240625
77231273728 0 0103404 824 1576compactclang_-mcpu=native_-O3_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062820240625
78080440544 0 061548 824 1576refclang_-mcpu=native_-O3_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062820240625
7813768750 0 036404 824 1576compactclang_-march=native_-O_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062820240625
79712812654 0 031862 816 1640refclang_-march=native_-Os_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062820240625
8160726473 0 035254 784 1608compactgcc_-march=native_-mtune=native_-O2_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062820240625
82404014987 0 033668 824 1576refclang_-march=native_-O_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062820240625
9473006522 0 034886 784 1608compactgcc_-march=native_-mtune=native_-O_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062820240625
10912136861 0 035286 816 1640compactclang_-march=native_-Os_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062820240625
110024544347 0 065340 824 1576refclang_-march=native_-O2_-fwrapv_-Qunused-arguments_-fPIC_-fPIE_-gdwarf-4_-Wall2024062820240625
13297525760 0 033022 776 1576compactgcc_-march=native_-mtune=native_-Os_-fwrapv_-fPIC_-fPIE_-gdwarf-4_-Wall2024062820240625

Compiler output


KeccakP-1600-times4-SIMD256.c: KeccakP-1600-times4-SIMD256.c:146:9: error: always_inline function '_mm256_loadu_si256' requires target feature 'avx', but would be inlined into function 'crypto_kem_kyber1024_avx2_constbranchindex_KeccakP1600times4_AddLanesAll' that is compiled without support for 'avx'
KeccakP-1600-times4-SIMD256.c:         Xor_In4( 0 );
KeccakP-1600-times4-SIMD256.c:         ^
KeccakP-1600-times4-SIMD256.c: KeccakP-1600-times4-SIMD256.c:135:42: note: expanded from macro 'Xor_In4'
KeccakP-1600-times4-SIMD256.c:     #define Xor_In4( argIndex ) lanes0 = LOAD256u( curData0[argIndex]),\
KeccakP-1600-times4-SIMD256.c:                                          ^
KeccakP-1600-times4-SIMD256.c: KeccakP-1600-times4-SIMD256.c:44:37: note: expanded from macro 'LOAD256u'
KeccakP-1600-times4-SIMD256.c:     #define LOAD256u(a)             _mm256_loadu_si256((const V256 *)&(a))
KeccakP-1600-times4-SIMD256.c:                                     ^
KeccakP-1600-times4-SIMD256.c: KeccakP-1600-times4-SIMD256.c:146:9: error: AVX vector return of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
KeccakP-1600-times4-SIMD256.c: KeccakP-1600-times4-SIMD256.c:135:42: note: expanded from macro 'Xor_In4'
KeccakP-1600-times4-SIMD256.c:     #define Xor_In4( argIndex ) lanes0 = LOAD256u( curData0[argIndex]),\
KeccakP-1600-times4-SIMD256.c:                                          ^
KeccakP-1600-times4-SIMD256.c: KeccakP-1600-times4-SIMD256.c:44:37: note: expanded from macro 'LOAD256u'
KeccakP-1600-times4-SIMD256.c:     #define LOAD256u(a)             _mm256_loadu_si256((const V256 *)&(a))
KeccakP-1600-times4-SIMD256.c:                                     ^
KeccakP-1600-times4-SIMD256.c: KeccakP-1600-times4-SIMD256.c:146:9: error: always_inline function '_mm256_loadu_si256' requires target feature 'avx', but would be inlined into function 'crypto_kem_kyber1024_avx2_constbranchindex_KeccakP1600times4_AddLanesAll' that is compiled without support for 'avx'
KeccakP-1600-times4-SIMD256.c: KeccakP-1600-times4-SIMD256.c:136:42: note: expanded from macro 'Xor_In4'
KeccakP-1600-times4-SIMD256.c:                                 lanes1 = LOAD256u( curData1[argIndex]),\
KeccakP-1600-times4-SIMD256.c:                                          ^
KeccakP-1600-times4-SIMD256.c: KeccakP-1600-times4-SIMD256.c:44:37: note: expanded from macro 'LOAD256u'
KeccakP-1600-times4-SIMD256.c:     #define LOAD256u(a)             _mm256_loadu_si256((const V256 *)&(a))
KeccakP-1600-times4-SIMD256.c:                                     ^
KeccakP-1600-times4-SIMD256.c: KeccakP-1600-times4-SIMD256.c:146:9: error: AVX vector return of type '__m256i' (vector of 4 'long long' values) without 'avx' enabled changes the ABI
KeccakP-1600-times4-SIMD256.c: KeccakP-1600-times4-SIMD256.c:136:42: note: expanded from macro 'Xor_In4'
KeccakP-1600-times4-SIMD256.c: ...

Number of similar (implementation,compiler) pairs: 1, namely:
ImplementationCompiler
avx2clang -mcpu=native -O3 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)

Compiler output


kem.c: kem.c:24:32: warning: argument 1 of type 'uint8_t[1568]' {aka 'unsigned char[1568]'} with mismatched bound [-Warray-parameter=]
kem.c:    24 | int crypto_kem_keypair(uint8_t pk[KYBER_PUBLICKEYBYTES],
kem.c:       |                        ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
kem.c: In file included from kem.c:5:
kem.c: kem.h:33:33: note: previously declared as 'uint8_t *' {aka 'unsigned char *'}
kem.c:    33 | int crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
kem.c:       |                        ~~~~~~~~~^~
kem.c: kem.c:25:32: warning: argument 2 of type 'uint8_t[3168]' {aka 'unsigned char[3168]'} with mismatched bound [-Warray-parameter=]
kem.c:    25 |                        uint8_t sk[KYBER_SECRETKEYBYTES])
kem.c:       |                        ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
kem.c: In file included from kem.c:5:
kem.c: kem.h:33:46: note: previously declared as 'uint8_t *' {aka 'unsigned char *'}
kem.c:    33 | int crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
kem.c:       |                                     ~~~~~~~~~^~
kem.c: kem.c:50:28: warning: argument 1 of type 'uint8_t[1568]' {aka 'unsigned char[1568]'} with mismatched bound [-Warray-parameter=]
kem.c:    50 | int crypto_kem_enc(uint8_t ct[KYBER_CIPHERTEXTBYTES],
kem.c:       |                    ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
kem.c: In file included from kem.c:5:
kem.c: kem.h:36:29: note: previously declared as 'uint8_t *' {aka 'unsigned char *'}
kem.c:    36 | int crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
kem.c:       |                    ~~~~~~~~~^~
kem.c: kem.c:51:28: warning: argument 2 of type 'uint8_t[32]' {aka 'unsigned char[32]'} with mismatched bound [-Warray-parameter=]
kem.c:    51 |                    uint8_t ss[KYBER_SSBYTES],
kem.c:       |                    ~~~~~~~~^~~~~~~~~~~~~~~~~
kem.c: In file included from kem.c:5:
kem.c: ...

Number of similar (implementation,compiler) pairs: 4, namely:
ImplementationCompiler
avx2gcc -march=native -mtune=native -O2 -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)
avx2gcc -march=native -mtune=native -O3 -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)
avx2gcc -march=native -mtune=native -O -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)
avx2gcc -march=native -mtune=native -Os -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)

Compiler output


kem.c: kem.c:23:32: warning: argument 1 of type 'uint8_t[1568]' {aka 'unsigned char[1568]'} with mismatched bound [-Warray-parameter=]
kem.c:    23 | int crypto_kem_keypair(uint8_t pk[KYBER_PUBLICKEYBYTES],
kem.c:       |                        ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
kem.c: In file included from kem.c:4:
kem.c: kem.h:33:33: note: previously declared as 'uint8_t *' {aka 'unsigned char *'}
kem.c:    33 | int crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
kem.c:       |                        ~~~~~~~~~^~
kem.c: kem.c:24:32: warning: argument 2 of type 'uint8_t[3168]' {aka 'unsigned char[3168]'} with mismatched bound [-Warray-parameter=]
kem.c:    24 |                        uint8_t sk[KYBER_SECRETKEYBYTES])
kem.c:       |                        ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
kem.c: In file included from kem.c:4:
kem.c: kem.h:33:46: note: previously declared as 'uint8_t *' {aka 'unsigned char *'}
kem.c:    33 | int crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
kem.c:       |                                     ~~~~~~~~~^~
kem.c: kem.c:51:28: warning: argument 1 of type 'uint8_t[1568]' {aka 'unsigned char[1568]'} with mismatched bound [-Warray-parameter=]
kem.c:    51 | int crypto_kem_enc(uint8_t ct[KYBER_CIPHERTEXTBYTES],
kem.c:       |                    ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
kem.c: In file included from kem.c:4:
kem.c: kem.h:36:29: note: previously declared as 'uint8_t *' {aka 'unsigned char *'}
kem.c:    36 | int crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
kem.c:       |                    ~~~~~~~~~^~
kem.c: kem.c:52:28: warning: argument 2 of type 'uint8_t[32]' {aka 'unsigned char[32]'} with mismatched bound [-Warray-parameter=]
kem.c:    52 |                    uint8_t ss[KYBER_SSBYTES],
kem.c:       |                    ~~~~~~~~^~~~~~~~~~~~~~~~~
kem.c: In file included from kem.c:4:
kem.c: ...

Number of similar (implementation,compiler) pairs: 4, namely:
ImplementationCompiler
refgcc -march=native -mtune=native -O2 -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)
refgcc -march=native -mtune=native -O3 -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)
refgcc -march=native -mtune=native -O -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)
refgcc -march=native -mtune=native -Os -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)

Passed TIMECOP


TIMECOP iterations: 1

Number of similar (implementation,compiler) pairs: 18, namely:
ImplementationCompiler
avx2clang -march=native -O2 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)
avx2clang -march=native -O3 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)
avx2clang -march=native -O -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)
avx2clang -march=native -Os -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)
compactclang -march=native -O2 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)
compactclang -march=native -O3 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)
compactclang -march=native -O -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)
compactclang -march=native -Os -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)
compactclang -mcpu=native -O3 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)
compactgcc -march=native -mtune=native -O2 -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)
compactgcc -march=native -mtune=native -O3 -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)
compactgcc -march=native -mtune=native -O -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)
compactgcc -march=native -mtune=native -Os -fwrapv -fPIC -fPIE -gdwarf-4 -Wall (11.4.0)
refclang -march=native -O2 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)
refclang -march=native -O3 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)
refclang -march=native -O -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)
refclang -march=native -Os -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)
refclang -mcpu=native -O3 -fwrapv -Qunused-arguments -fPIC -fPIE -gdwarf-4 -Wall (Ubuntu_Clang_14.0.0)