Skip to content

Commit

Permalink
Merge pull request #674 from pq-code-package/sampling
Browse files Browse the repository at this point in the history
Introduce separate source files for compression, sampling, and arithmetic
  • Loading branch information
hanno-becker authored Jan 22, 2025
2 parents 21c0c39 + 51f5adb commit f1bd62f
Show file tree
Hide file tree
Showing 137 changed files with 1,904 additions and 1,971 deletions.
1 change: 0 additions & 1 deletion examples/bring_your_own_fips202/mlkem_native/cbd.c

This file was deleted.

1 change: 0 additions & 1 deletion examples/bring_your_own_fips202/mlkem_native/cbd.h

This file was deleted.

1 change: 1 addition & 0 deletions examples/bring_your_own_fips202/mlkem_native/compress.c
1 change: 1 addition & 0 deletions examples/bring_your_own_fips202/mlkem_native/compress.h
1 change: 0 additions & 1 deletion examples/bring_your_own_fips202/mlkem_native/ntt.c

This file was deleted.

1 change: 0 additions & 1 deletion examples/bring_your_own_fips202/mlkem_native/ntt.h

This file was deleted.

1 change: 1 addition & 0 deletions examples/bring_your_own_fips202/mlkem_native/poly_k.c
1 change: 1 addition & 0 deletions examples/bring_your_own_fips202/mlkem_native/poly_k.h
1 change: 0 additions & 1 deletion examples/bring_your_own_fips202/mlkem_native/polyvec.c

This file was deleted.

1 change: 0 additions & 1 deletion examples/bring_your_own_fips202/mlkem_native/polyvec.h

This file was deleted.

1 change: 0 additions & 1 deletion examples/bring_your_own_fips202/mlkem_native/reduce.h

This file was deleted.

1 change: 0 additions & 1 deletion examples/bring_your_own_fips202/mlkem_native/rej_uniform.c

This file was deleted.

1 change: 0 additions & 1 deletion examples/bring_your_own_fips202/mlkem_native/rej_uniform.h

This file was deleted.

1 change: 1 addition & 0 deletions examples/bring_your_own_fips202/mlkem_native/sampling.c
1 change: 1 addition & 0 deletions examples/bring_your_own_fips202/mlkem_native/sampling.h
1 change: 0 additions & 1 deletion examples/custom_backend/mlkem_native/mlkem/cbd.c

This file was deleted.

1 change: 0 additions & 1 deletion examples/custom_backend/mlkem_native/mlkem/cbd.h

This file was deleted.

1 change: 1 addition & 0 deletions examples/custom_backend/mlkem_native/mlkem/compress.c
1 change: 1 addition & 0 deletions examples/custom_backend/mlkem_native/mlkem/compress.h
1 change: 0 additions & 1 deletion examples/custom_backend/mlkem_native/mlkem/ntt.c

This file was deleted.

1 change: 0 additions & 1 deletion examples/custom_backend/mlkem_native/mlkem/ntt.h

This file was deleted.

1 change: 1 addition & 0 deletions examples/custom_backend/mlkem_native/mlkem/poly_k.c
1 change: 1 addition & 0 deletions examples/custom_backend/mlkem_native/mlkem/poly_k.h
1 change: 0 additions & 1 deletion examples/custom_backend/mlkem_native/mlkem/polyvec.c

This file was deleted.

1 change: 0 additions & 1 deletion examples/custom_backend/mlkem_native/mlkem/polyvec.h

This file was deleted.

1 change: 0 additions & 1 deletion examples/custom_backend/mlkem_native/mlkem/reduce.h

This file was deleted.

1 change: 0 additions & 1 deletion examples/custom_backend/mlkem_native/mlkem/rej_uniform.c

This file was deleted.

1 change: 0 additions & 1 deletion examples/custom_backend/mlkem_native/mlkem/rej_uniform.h

This file was deleted.

1 change: 1 addition & 0 deletions examples/custom_backend/mlkem_native/mlkem/sampling.c
1 change: 1 addition & 0 deletions examples/custom_backend/mlkem_native/mlkem/sampling.h
Loading

17 comments on commit f1bd62f

@oqs-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arm Cortex-A76 (Raspberry Pi 5) benchmarks

Benchmark suite Current: f1bd62f Previous: 21c0c39 Ratio
ML-KEM-512 keypair 29081 cycles 29082 cycles 1.00
ML-KEM-512 encaps 35437 cycles 35434 cycles 1.00
ML-KEM-512 decaps 45907 cycles 45904 cycles 1.00
ML-KEM-768 keypair 49303 cycles 49301 cycles 1.00
ML-KEM-768 encaps 55645 cycles 55593 cycles 1.00
ML-KEM-768 decaps 70424 cycles 70352 cycles 1.00
ML-KEM-1024 keypair 72105 cycles 72021 cycles 1.00
ML-KEM-1024 encaps 80826 cycles 80731 cycles 1.00
ML-KEM-1024 decaps 100697 cycles 100643 cycles 1.00

This comment was automatically generated by workflow using github-action-benchmark.

@oqs-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intel Xeon 4th gen (c7i)

Benchmark suite Current: f1bd62f Previous: 21c0c39 Ratio
ML-KEM-512 keypair 13845 cycles 13511 cycles 1.02
ML-KEM-512 encaps 17781 cycles 17292 cycles 1.03
ML-KEM-512 decaps 23571 cycles 22847 cycles 1.03
ML-KEM-768 keypair 23285 cycles 22509 cycles 1.03
ML-KEM-768 encaps 25152 cycles 24493 cycles 1.03
ML-KEM-768 decaps 33765 cycles 32433 cycles 1.04
ML-KEM-1024 keypair 32083 cycles 31544 cycles 1.02
ML-KEM-1024 encaps 35599 cycles 34858 cycles 1.02
ML-KEM-1024 decaps 47136 cycles 45807 cycles 1.03

This comment was automatically generated by workflow using github-action-benchmark.

@oqs-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Intel Xeon 4th gen (c7i)'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.03.

Benchmark suite Current: f1bd62f Previous: 21c0c39 Ratio
ML-KEM-512 decaps 23571 cycles 22847 cycles 1.03
ML-KEM-768 keypair 23285 cycles 22509 cycles 1.03
ML-KEM-768 decaps 33765 cycles 32433 cycles 1.04

This comment was automatically generated by workflow using github-action-benchmark.

@oqs-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AMD EPYC 3rd gen (c6a)

Benchmark suite Current: f1bd62f Previous: 21c0c39 Ratio
ML-KEM-512 keypair 18055 cycles 18112 cycles 1.00
ML-KEM-512 encaps 22867 cycles 22987 cycles 0.99
ML-KEM-512 decaps 30179 cycles 30219 cycles 1.00
ML-KEM-768 keypair 30939 cycles 31173 cycles 0.99
ML-KEM-768 encaps 33884 cycles 33895 cycles 1.00
ML-KEM-768 decaps 44290 cycles 44517 cycles 0.99
ML-KEM-1024 keypair 44223 cycles 44528 cycles 0.99
ML-KEM-1024 encaps 49597 cycles 49789 cycles 1.00
ML-KEM-1024 decaps 63979 cycles 64472 cycles 0.99

This comment was automatically generated by workflow using github-action-benchmark.

@oqs-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intel Xeon 3rd gen (c6i)

Benchmark suite Current: f1bd62f Previous: 21c0c39 Ratio
ML-KEM-512 keypair 20407 cycles 20361 cycles 1.00
ML-KEM-512 encaps 27080 cycles 27150 cycles 1.00
ML-KEM-512 decaps 35960 cycles 35746 cycles 1.01
ML-KEM-768 keypair 34935 cycles 34897 cycles 1.00
ML-KEM-768 encaps 38177 cycles 38179 cycles 1.00
ML-KEM-768 decaps 51024 cycles 50949 cycles 1.00
ML-KEM-1024 keypair 47985 cycles 48039 cycles 1.00
ML-KEM-1024 encaps 54050 cycles 53911 cycles 1.00
ML-KEM-1024 decaps 71515 cycles 71361 cycles 1.00

This comment was automatically generated by workflow using github-action-benchmark.

@oqs-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AMD EPYC 4th gen (c7a)

Benchmark suite Current: f1bd62f Previous: 21c0c39 Ratio
ML-KEM-512 keypair 14984 cycles 14886 cycles 1.01
ML-KEM-512 encaps 19698 cycles 19693 cycles 1.00
ML-KEM-512 decaps 26312 cycles 26308 cycles 1.00
ML-KEM-768 keypair 25468 cycles 25598 cycles 0.99
ML-KEM-768 encaps 27942 cycles 28059 cycles 1.00
ML-KEM-768 decaps 37696 cycles 37926 cycles 0.99
ML-KEM-1024 keypair 35517 cycles 35896 cycles 0.99
ML-KEM-1024 encaps 40363 cycles 40642 cycles 0.99
ML-KEM-1024 decaps 53764 cycles 54329 cycles 0.99

This comment was automatically generated by workflow using github-action-benchmark.

@oqs-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intel Xeon 4th gen (c7i) (no-opt)

Benchmark suite Current: f1bd62f Previous: 21c0c39 Ratio
ML-KEM-512 keypair 33137 cycles 33248 cycles 1.00
ML-KEM-512 encaps 38671 cycles 38603 cycles 1.00
ML-KEM-512 decaps 50301 cycles 49993 cycles 1.01
ML-KEM-768 keypair 55302 cycles 54116 cycles 1.02
ML-KEM-768 encaps 62333 cycles 61116 cycles 1.02
ML-KEM-768 decaps 77026 cycles 75823 cycles 1.02
ML-KEM-1024 keypair 82790 cycles 82438 cycles 1.00
ML-KEM-1024 encaps 93528 cycles 92939 cycles 1.01
ML-KEM-1024 decaps 113976 cycles 111511 cycles 1.02

This comment was automatically generated by workflow using github-action-benchmark.

@oqs-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AMD EPYC 3rd gen (c6a) (no-opt)

Benchmark suite Current: f1bd62f Previous: 21c0c39 Ratio
ML-KEM-512 keypair 43538 cycles 43294 cycles 1.01
ML-KEM-512 encaps 52108 cycles 51438 cycles 1.01
ML-KEM-512 decaps 67313 cycles 66703 cycles 1.01
ML-KEM-768 keypair 71617 cycles 71830 cycles 1.00
ML-KEM-768 encaps 83301 cycles 83290 cycles 1.00
ML-KEM-768 decaps 103430 cycles 103534 cycles 1.00
ML-KEM-1024 keypair 106814 cycles 107123 cycles 1.00
ML-KEM-1024 encaps 121836 cycles 122111 cycles 1.00
ML-KEM-1024 decaps 147614 cycles 147944 cycles 1.00

This comment was automatically generated by workflow using github-action-benchmark.

@oqs-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intel Xeon 3rd gen (c6i) (no-opt)

Benchmark suite Current: f1bd62f Previous: 21c0c39 Ratio
ML-KEM-512 keypair 51737 cycles 51581 cycles 1.00
ML-KEM-512 encaps 59988 cycles 59624 cycles 1.01
ML-KEM-512 decaps 76827 cycles 76584 cycles 1.00
ML-KEM-768 keypair 84452 cycles 84341 cycles 1.00
ML-KEM-768 encaps 95798 cycles 95697 cycles 1.00
ML-KEM-768 decaps 118253 cycles 117794 cycles 1.00
ML-KEM-1024 keypair 125416 cycles 125581 cycles 1.00
ML-KEM-1024 encaps 139726 cycles 139615 cycles 1.00
ML-KEM-1024 decaps 169010 cycles 168458 cycles 1.00

This comment was automatically generated by workflow using github-action-benchmark.

@oqs-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AMD EPYC 4th gen (c7a) (no-opt)

Benchmark suite Current: f1bd62f Previous: 21c0c39 Ratio
ML-KEM-512 keypair 39489 cycles 39338 cycles 1.00
ML-KEM-512 encaps 45558 cycles 45566 cycles 1.00
ML-KEM-512 decaps 59101 cycles 59072 cycles 1.00
ML-KEM-768 keypair 64941 cycles 64869 cycles 1.00
ML-KEM-768 encaps 73199 cycles 73172 cycles 1.00
ML-KEM-768 decaps 91690 cycles 91278 cycles 1.00
ML-KEM-1024 keypair 96996 cycles 96609 cycles 1.00
ML-KEM-1024 encaps 108177 cycles 107795 cycles 1.00
ML-KEM-1024 decaps 131340 cycles 131159 cycles 1.00

This comment was automatically generated by workflow using github-action-benchmark.

@oqs-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graviton2

Benchmark suite Current: f1bd62f Previous: 21c0c39 Ratio
ML-KEM-512 keypair 29083 cycles 29072 cycles 1.00
ML-KEM-512 encaps 35460 cycles 35448 cycles 1.00
ML-KEM-512 decaps 45900 cycles 45890 cycles 1.00
ML-KEM-768 keypair 49308 cycles 49312 cycles 1.00
ML-KEM-768 encaps 55644 cycles 55594 cycles 1.00
ML-KEM-768 decaps 70443 cycles 70386 cycles 1.00
ML-KEM-1024 keypair 72100 cycles 72023 cycles 1.00
ML-KEM-1024 encaps 80845 cycles 80753 cycles 1.00
ML-KEM-1024 decaps 100731 cycles 100669 cycles 1.00

This comment was automatically generated by workflow using github-action-benchmark.

@oqs-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graviton4

Benchmark suite Current: f1bd62f Previous: 21c0c39 Ratio
ML-KEM-512 keypair 18133 cycles 18116 cycles 1.00
ML-KEM-512 encaps 22174 cycles 22181 cycles 1.00
ML-KEM-512 decaps 28838 cycles 28846 cycles 1.00
ML-KEM-768 keypair 30547 cycles 30555 cycles 1.00
ML-KEM-768 encaps 33632 cycles 33624 cycles 1.00
ML-KEM-768 decaps 43157 cycles 43151 cycles 1.00
ML-KEM-1024 keypair 44173 cycles 44155 cycles 1.00
ML-KEM-1024 encaps 49634 cycles 49644 cycles 1.00
ML-KEM-1024 decaps 62641 cycles 62631 cycles 1.00

This comment was automatically generated by workflow using github-action-benchmark.

@oqs-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graviton4 (no-opt)

Benchmark suite Current: f1bd62f Previous: 21c0c39 Ratio
ML-KEM-512 keypair 38046 cycles 38050 cycles 1.00
ML-KEM-512 encaps 43387 cycles 43372 cycles 1.00
ML-KEM-512 decaps 55566 cycles 55552 cycles 1.00
ML-KEM-768 keypair 63032 cycles 63040 cycles 1.00
ML-KEM-768 encaps 70431 cycles 70438 cycles 1.00
ML-KEM-768 decaps 86886 cycles 86902 cycles 1.00
ML-KEM-1024 keypair 94514 cycles 94524 cycles 1.00
ML-KEM-1024 encaps 105298 cycles 105306 cycles 1.00
ML-KEM-1024 decaps 126938 cycles 126977 cycles 1.00

This comment was automatically generated by workflow using github-action-benchmark.

@oqs-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graviton2 (no-opt)

Benchmark suite Current: f1bd62f Previous: 21c0c39 Ratio
ML-KEM-512 keypair 60657 cycles 60695 cycles 1.00
ML-KEM-512 encaps 69888 cycles 69825 cycles 1.00
ML-KEM-512 decaps 88842 cycles 88750 cycles 1.00
ML-KEM-768 keypair 101725 cycles 101845 cycles 1.00
ML-KEM-768 encaps 113934 cycles 115088 cycles 0.99
ML-KEM-768 decaps 139451 cycles 140736 cycles 0.99
ML-KEM-1024 keypair 154363 cycles 154440 cycles 1.00
ML-KEM-1024 encaps 170184 cycles 171523 cycles 0.99
ML-KEM-1024 decaps 202510 cycles 204076 cycles 0.99

This comment was automatically generated by workflow using github-action-benchmark.

@oqs-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graviton3

Benchmark suite Current: f1bd62f Previous: 21c0c39 Ratio
ML-KEM-512 keypair 18934 cycles 18948 cycles 1.00
ML-KEM-512 encaps 23556 cycles 23573 cycles 1.00
ML-KEM-512 decaps 30669 cycles 30676 cycles 1.00
ML-KEM-768 keypair 32292 cycles 32337 cycles 1.00
ML-KEM-768 encaps 35878 cycles 35895 cycles 1.00
ML-KEM-768 decaps 45997 cycles 46039 cycles 1.00
ML-KEM-1024 keypair 46604 cycles 46584 cycles 1.00
ML-KEM-1024 encaps 52448 cycles 52474 cycles 1.00
ML-KEM-1024 decaps 66234 cycles 66237 cycles 1.00

This comment was automatically generated by workflow using github-action-benchmark.

@oqs-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graviton3 (no-opt)

Benchmark suite Current: f1bd62f Previous: 21c0c39 Ratio
ML-KEM-512 keypair 39336 cycles 39346 cycles 1.00
ML-KEM-512 encaps 45335 cycles 45340 cycles 1.00
ML-KEM-512 decaps 57353 cycles 57376 cycles 1.00
ML-KEM-768 keypair 65859 cycles 65864 cycles 1.00
ML-KEM-768 encaps 73755 cycles 73714 cycles 1.00
ML-KEM-768 decaps 89799 cycles 89699 cycles 1.00
ML-KEM-1024 keypair 99012 cycles 98985 cycles 1.00
ML-KEM-1024 encaps 109982 cycles 109973 cycles 1.00
ML-KEM-1024 decaps 130781 cycles 130732 cycles 1.00

This comment was automatically generated by workflow using github-action-benchmark.

@oqs-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arm Cortex-A55 (Snapdragon 888) benchmarks

Benchmark suite Current: f1bd62f Previous: 21c0c39 Ratio
ML-KEM-512 keypair 58278 cycles 58329 cycles 1.00
ML-KEM-512 encaps 65739 cycles 65721 cycles 1.00
ML-KEM-512 decaps 84497 cycles 84520 cycles 1.00
ML-KEM-768 keypair 98976 cycles 98937 cycles 1.00
ML-KEM-768 encaps 110593 cycles 110308 cycles 1.00
ML-KEM-768 decaps 136817 cycles 136632 cycles 1.00
ML-KEM-1024 keypair 149948 cycles 150103 cycles 1.00
ML-KEM-1024 encaps 166641 cycles 166430 cycles 1.00
ML-KEM-1024 decaps 202299 cycles 202325 cycles 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.