Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DeriveKeyPair API #1877

Draft
wants to merge 31 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9ee89ac
Initial derive keypair commit
Eddy-M-K May 20, 2024
854e036
Add pqcrystals-ml_kem_ipd.patch
Eddy-M-K May 20, 2024
f11c479
Fix encaps key in scheme and revert whitespace changes
Eddy-M-K May 20, 2024
0b41866
Hopefully corrected patch file
Eddy-M-K Jun 12, 2024
de45506
Corrected missing derand in kem_scheme
Eddy-M-K Jun 12, 2024
9e6bb19
Fix indentation
SWilson4 Jun 12, 2024
7ce72d7
Run copy_from_upstream
SWilson4 Jun 12, 2024
60bfc5e
derand testing tentative changes
Eddy-M-K Jul 10, 2024
008161f
Add missing function declarations
Eddy-M-K Jul 10, 2024
85685ff
Add template for avx2 derand functions
SWilson4 Jul 10, 2024
f985af6
Run copy_from_upstream
SWilson4 Jul 10, 2024
2b83af3
WIP: Add changes for coin length
Eddy-M-K Jul 17, 2024
bc37415
Update patch to include coin lengths
SWilson4 Jul 17, 2024
56c0087
Bootstrap
SWilson4 Jul 17, 2024
981e9eb
fixup! Update patch to include coin lengths
SWilson4 Jul 17, 2024
c7f0608
Conditional copy
SWilson4 Jul 17, 2024
d9eb0ed
Run copy_from_upstream
SWilson4 Jul 17, 2024
7370f17
Separate coins variable into two distinct variables
Eddy-M-K Jul 23, 2024
9609bbc
Add derand fixes
Eddy-M-K Jul 30, 2024
04bdea0
WIP trying to fix build errors
Eddy-M-K Jul 30, 2024
9b639b7
Fix remaining build issues
Eddy-M-K Jul 30, 2024
6f296d8
Resolve unused parameter issues for BIKE
Eddy-M-K Jul 30, 2024
8c06c20
Resolve unused paramter issues for FrodoKEM
Eddy-M-K Jul 30, 2024
6eec29a
Fix whitespace inconsistency
Eddy-M-K Jul 30, 2024
6537493
Fix whitepace issue
Eddy-M-K Jul 30, 2024
2406568
Insert unused attributes
Eddy-M-K Jul 30, 2024
68435ad
Void all unused parameters
Eddy-M-K Jul 30, 2024
6790657
Use tab instead of spaces in kem_scheme
Eddy-M-K Jul 31, 2024
f4fb753
Run copy_from_upstream
SWilson4 Jul 31, 2024
bf435c2
Fix kem_derand python tests
Eddy-M-K Jul 31, 2024
4cbb475
Initialize coins in test_kem_derand
Eddy-M-K Jul 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/algorithms/kem/bike.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

## Parameter set summary

| Parameter set | Parameter set alias | Security model | Claimed NIST Level | Public key size (bytes) | Secret key size (bytes) | Ciphertext size (bytes) | Shared secret size (bytes) |
|:---------------:|:----------------------|:-----------------|---------------------:|--------------------------:|--------------------------:|--------------------------:|-----------------------------:|
| BIKE-L1 | NA | IND-CPA | 1 | 1541 | 5223 | 1573 | 32 |
| BIKE-L3 | NA | IND-CPA | 3 | 3083 | 10105 | 3115 | 32 |
| BIKE-L5 | NA | IND-CPA | 5 | 5122 | 16494 | 5154 | 32 |
| Parameter set | Parameter set alias | Security model | Claimed NIST Level | Public key size (bytes) | Secret key size (bytes) | Ciphertext size (bytes) | Shared secret size (bytes) | Keypair coins (bytes) | Encapsulation coins (bytes) |
|:---------------:|:----------------------|:-----------------|---------------------:|--------------------------:|--------------------------:|--------------------------:|-----------------------------:|------------------------:|------------------------------:|
| BIKE-L1 | NA | IND-CPA | 1 | 1541 | 5223 | 1573 | 32 | 0 | 0 |
| BIKE-L3 | NA | IND-CPA | 3 | 3083 | 10105 | 3115 | 32 | 0 | 0 |
| BIKE-L5 | NA | IND-CPA | 5 | 5122 | 16494 | 5154 | 32 | 0 | 0 |

## BIKE-L1 implementation characteristics

Expand Down
24 changes: 12 additions & 12 deletions docs/algorithms/kem/classic_mceliece.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@

## Parameter set summary

| Parameter set | Parameter set alias | Security model | Claimed NIST Level | Public key size (bytes) | Secret key size (bytes) | Ciphertext size (bytes) | Shared secret size (bytes) |
|:-------------------------:|:----------------------|:-----------------|---------------------:|--------------------------:|--------------------------:|--------------------------:|-----------------------------:|
| Classic-McEliece-348864 | NA | IND-CCA2 | 1 | 261120 | 6492 | 96 | 32 |
| Classic-McEliece-348864f | NA | IND-CCA2 | 1 | 261120 | 6492 | 96 | 32 |
| Classic-McEliece-460896 | NA | IND-CCA2 | 3 | 524160 | 13608 | 156 | 32 |
| Classic-McEliece-460896f | NA | IND-CCA2 | 3 | 524160 | 13608 | 156 | 32 |
| Classic-McEliece-6688128 | NA | IND-CCA2 | 5 | 1044992 | 13932 | 208 | 32 |
| Classic-McEliece-6688128f | NA | IND-CCA2 | 5 | 1044992 | 13932 | 208 | 32 |
| Classic-McEliece-6960119 | NA | IND-CCA2 | 5 | 1047319 | 13948 | 194 | 32 |
| Classic-McEliece-6960119f | NA | IND-CCA2 | 5 | 1047319 | 13948 | 194 | 32 |
| Classic-McEliece-8192128 | NA | IND-CCA2 | 5 | 1357824 | 14120 | 208 | 32 |
| Classic-McEliece-8192128f | NA | IND-CCA2 | 5 | 1357824 | 14120 | 208 | 32 |
| Parameter set | Parameter set alias | Security model | Claimed NIST Level | Public key size (bytes) | Secret key size (bytes) | Ciphertext size (bytes) | Shared secret size (bytes) | Keypair coins (bytes) | Encapsulation coins (bytes) |
|:-------------------------:|:----------------------|:-----------------|---------------------:|--------------------------:|--------------------------:|--------------------------:|-----------------------------:|------------------------:|------------------------------:|
| Classic-McEliece-348864 | NA | IND-CCA2 | 1 | 261120 | 6492 | 96 | 32 | 0 | 0 |
| Classic-McEliece-348864f | NA | IND-CCA2 | 1 | 261120 | 6492 | 96 | 32 | 0 | 0 |
| Classic-McEliece-460896 | NA | IND-CCA2 | 3 | 524160 | 13608 | 156 | 32 | 0 | 0 |
| Classic-McEliece-460896f | NA | IND-CCA2 | 3 | 524160 | 13608 | 156 | 32 | 0 | 0 |
| Classic-McEliece-6688128 | NA | IND-CCA2 | 5 | 1044992 | 13932 | 208 | 32 | 0 | 0 |
| Classic-McEliece-6688128f | NA | IND-CCA2 | 5 | 1044992 | 13932 | 208 | 32 | 0 | 0 |
| Classic-McEliece-6960119 | NA | IND-CCA2 | 5 | 1047319 | 13948 | 194 | 32 | 0 | 0 |
| Classic-McEliece-6960119f | NA | IND-CCA2 | 5 | 1047319 | 13948 | 194 | 32 | 0 | 0 |
| Classic-McEliece-8192128 | NA | IND-CCA2 | 5 | 1357824 | 14120 | 208 | 32 | 0 | 0 |
| Classic-McEliece-8192128f | NA | IND-CCA2 | 5 | 1357824 | 14120 | 208 | 32 | 0 | 0 |

## Classic-McEliece-348864 implementation characteristics

Expand Down
16 changes: 8 additions & 8 deletions docs/algorithms/kem/frodokem.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@

## Parameter set summary

| Parameter set | Parameter set alias | Security model | Claimed NIST Level | Public key size (bytes) | Secret key size (bytes) | Ciphertext size (bytes) | Shared secret size (bytes) |
|:-------------------:|:----------------------|:-----------------|---------------------:|--------------------------:|--------------------------:|--------------------------:|-----------------------------:|
| FrodoKEM-640-AES | NA | IND-CCA2 | 1 | 9616 | 19888 | 9720 | 16 |
| FrodoKEM-640-SHAKE | NA | IND-CCA2 | 1 | 9616 | 19888 | 9720 | 16 |
| FrodoKEM-976-AES | NA | IND-CCA2 | 3 | 15632 | 31296 | 15744 | 24 |
| FrodoKEM-976-SHAKE | NA | IND-CCA2 | 3 | 15632 | 31296 | 15744 | 24 |
| FrodoKEM-1344-AES | NA | IND-CCA2 | 5 | 21520 | 43088 | 21632 | 32 |
| FrodoKEM-1344-SHAKE | NA | IND-CCA2 | 5 | 21520 | 43088 | 21632 | 32 |
| Parameter set | Parameter set alias | Security model | Claimed NIST Level | Public key size (bytes) | Secret key size (bytes) | Ciphertext size (bytes) | Shared secret size (bytes) | Keypair coins (bytes) | Encapsulation coins (bytes) |
|:-------------------:|:----------------------|:-----------------|---------------------:|--------------------------:|--------------------------:|--------------------------:|-----------------------------:|------------------------:|------------------------------:|
| FrodoKEM-640-AES | NA | IND-CCA2 | 1 | 9616 | 19888 | 9720 | 16 | 0 | 0 |
| FrodoKEM-640-SHAKE | NA | IND-CCA2 | 1 | 9616 | 19888 | 9720 | 16 | 0 | 0 |
| FrodoKEM-976-AES | NA | IND-CCA2 | 3 | 15632 | 31296 | 15744 | 24 | 0 | 0 |
| FrodoKEM-976-SHAKE | NA | IND-CCA2 | 3 | 15632 | 31296 | 15744 | 24 | 0 | 0 |
| FrodoKEM-1344-AES | NA | IND-CCA2 | 5 | 21520 | 43088 | 21632 | 32 | 0 | 0 |
| FrodoKEM-1344-SHAKE | NA | IND-CCA2 | 5 | 21520 | 43088 | 21632 | 32 | 0 | 0 |

## FrodoKEM-640-AES implementation characteristics

Expand Down
10 changes: 5 additions & 5 deletions docs/algorithms/kem/hqc.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

## Parameter set summary

| Parameter set | Parameter set alias | Security model | Claimed NIST Level | Public key size (bytes) | Secret key size (bytes) | Ciphertext size (bytes) | Shared secret size (bytes) |
|:---------------:|:----------------------|:-----------------|---------------------:|--------------------------:|--------------------------:|--------------------------:|-----------------------------:|
| HQC-128 | NA | IND-CCA2 | 1 | 2249 | 2305 | 4433 | 64 |
| HQC-192 | NA | IND-CCA2 | 3 | 4522 | 4586 | 8978 | 64 |
| HQC-256 | NA | IND-CCA2 | 5 | 7245 | 7317 | 14421 | 64 |
| Parameter set | Parameter set alias | Security model | Claimed NIST Level | Public key size (bytes) | Secret key size (bytes) | Ciphertext size (bytes) | Shared secret size (bytes) | Keypair coins (bytes) | Encapsulation coins (bytes) |
|:---------------:|:----------------------|:-----------------|---------------------:|--------------------------:|--------------------------:|--------------------------:|-----------------------------:|------------------------:|------------------------------:|
| HQC-128 | NA | IND-CCA2 | 1 | 2249 | 2305 | 4433 | 64 | 0 | 0 |
| HQC-192 | NA | IND-CCA2 | 3 | 4522 | 4586 | 8978 | 64 | 0 | 0 |
| HQC-256 | NA | IND-CCA2 | 5 | 7245 | 7317 | 14421 | 64 | 0 | 0 |

## HQC-128 implementation characteristics

Expand Down
10 changes: 5 additions & 5 deletions docs/algorithms/kem/kyber.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

## Parameter set summary

| Parameter set | Parameter set alias | Security model | Claimed NIST Level | Public key size (bytes) | Secret key size (bytes) | Ciphertext size (bytes) | Shared secret size (bytes) |
|:---------------:|:----------------------|:-----------------|---------------------:|--------------------------:|--------------------------:|--------------------------:|-----------------------------:|
| Kyber512 | NA | IND-CCA2 | 1 | 800 | 1632 | 768 | 32 |
| Kyber768 | NA | IND-CCA2 | 3 | 1184 | 2400 | 1088 | 32 |
| Kyber1024 | NA | IND-CCA2 | 5 | 1568 | 3168 | 1568 | 32 |
| Parameter set | Parameter set alias | Security model | Claimed NIST Level | Public key size (bytes) | Secret key size (bytes) | Ciphertext size (bytes) | Shared secret size (bytes) | Keypair coins (bytes) | Encapsulation coins (bytes) |
|:---------------:|:----------------------|:-----------------|---------------------:|--------------------------:|--------------------------:|--------------------------:|-----------------------------:|------------------------:|------------------------------:|
| Kyber512 | NA | IND-CCA2 | 1 | 800 | 1632 | 768 | 32 | 0 | 0 |
| Kyber768 | NA | IND-CCA2 | 3 | 1184 | 2400 | 1088 | 32 | 0 | 0 |
| Kyber1024 | NA | IND-CCA2 | 5 | 1568 | 3168 | 1568 | 32 | 0 | 0 |

## Kyber512 implementation characteristics

Expand Down
10 changes: 5 additions & 5 deletions docs/algorithms/kem/ml_kem.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

## Parameter set summary

| Parameter set | Parameter set alias | Security model | Claimed NIST Level | Public key size (bytes) | Secret key size (bytes) | Ciphertext size (bytes) | Shared secret size (bytes) |
|:---------------:|:----------------------|:-----------------|---------------------:|--------------------------:|--------------------------:|--------------------------:|-----------------------------:|
| ML-KEM-512-ipd | ML-KEM-512 | IND-CCA2 | 1 | 800 | 1632 | 768 | 32 |
| ML-KEM-768-ipd | ML-KEM-768 | IND-CCA2 | 3 | 1184 | 2400 | 1088 | 32 |
| ML-KEM-1024-ipd | ML-KEM-1024 | IND-CCA2 | 5 | 1568 | 3168 | 1568 | 32 |
| Parameter set | Parameter set alias | Security model | Claimed NIST Level | Public key size (bytes) | Secret key size (bytes) | Ciphertext size (bytes) | Shared secret size (bytes) | Keypair coins (bytes) | Encapsulation coins (bytes) |
|:---------------:|:----------------------|:-----------------|---------------------:|--------------------------:|--------------------------:|--------------------------:|-----------------------------:|------------------------:|------------------------------:|
| ML-KEM-512-ipd | ML-KEM-512 | IND-CCA2 | 1 | 800 | 1632 | 768 | 32 | 64 | 32 |
| ML-KEM-768-ipd | ML-KEM-768 | IND-CCA2 | 3 | 1184 | 2400 | 1088 | 32 | 64 | 32 |
| ML-KEM-1024-ipd | ML-KEM-1024 | IND-CCA2 | 5 | 1568 | 3168 | 1568 | 32 | 64 | 32 |

## ML-KEM-512-ipd implementation characteristics

Expand Down
6 changes: 6 additions & 0 deletions docs/algorithms/kem/ml_kem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ parameter-sets:
length-ciphertext: 768
length-secret-key: 1632
length-shared-secret: 32
length-keypair-coins: 64
length-encaps-coins: 32
implementations-switch-on-runtime-cpu-features: true
implementations:
- upstream: primary-upstream
Expand Down Expand Up @@ -63,6 +65,8 @@ parameter-sets:
length-ciphertext: 1088
length-secret-key: 2400
length-shared-secret: 32
length-keypair-coins: 64
length-encaps-coins: 32
implementations-switch-on-runtime-cpu-features: true
implementations:
- upstream: primary-upstream
Expand Down Expand Up @@ -97,6 +101,8 @@ parameter-sets:
length-ciphertext: 1568
length-secret-key: 3168
length-shared-secret: 32
length-keypair-coins: 64
length-encaps-coins: 32
implementations-switch-on-runtime-cpu-features: true
implementations:
- upstream: primary-upstream
Expand Down
Loading
Loading