Skip to content

Commit

Permalink
Run copy_from_upsream.py and pull updated upstream
Browse files Browse the repository at this point in the history
Signed-off-by: Pravek Sharma <sharmapravek@gmail.com>
  • Loading branch information
praveksharma committed Jan 21, 2025
1 parent cf03b8d commit 5dc3f49
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 84 deletions.
2 changes: 1 addition & 1 deletion docs/algorithms/kem/ml_kem.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- **Implementation license (SPDX-Identifier)**: CC0-1.0 or Apache-2.0
- **Optimized Implementation sources**: https://github.com/pq-crystals/kyber/commit/10b478fc3cc4ff6215eb0b6a11bd758bf0929cbd with copy_from_upstream patches
- **cupqc-cuda**:<a name="cupqc-cuda"></a>
- **Source**: https://github.com/praveksharma/cupqc-mlkem/commit/adb8454e56979628c07b67eb7d90f9337be6dc30
- **Source**: https://github.com/praveksharma/cupqc-mlkem/commit/b026f4e5475cd9c20c2082c7d9bad80e5b0ba89e
- **Implementation license (SPDX-Identifier)**: Apache-2.0


Expand Down
2 changes: 1 addition & 1 deletion docs/algorithms/kem/ml_kem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ primary-upstream:
spdx-license-identifier: CC0-1.0 or Apache-2.0
optimized-upstreams:
cupqc-cuda:
source: https://github.com/praveksharma/cupqc-mlkem/commit/adb8454e56979628c07b67eb7d90f9337be6dc30
source: https://github.com/praveksharma/cupqc-mlkem/commit/b026f4e5475cd9c20c2082c7d9bad80e5b0ba89e
spdx-license-identifier: Apache-2.0
parameter-sets:
- name: ML-KEM-512
Expand Down
2 changes: 1 addition & 1 deletion scripts/copy_from_upstream/copy_from_upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ upstreams:
name: cupqc
git_url: https://github.com/praveksharma/cupqc-mlkem.git
git_branch: main
git_commit: adb8454e56979628c07b67eb7d90f9337be6dc30
git_commit: b026f4e5475cd9c20c2082c7d9bad80e5b0ba89e
kem_meta_path: '{pretty_name_full}_META.yml'
kem_scheme_path: '.'
patches: []
Expand Down
28 changes: 1 addition & 27 deletions src/kem/ml_kem/cupqc_ml-kem-1024_cuda/cupqc_ml-kem.cu
Original file line number Diff line number Diff line change
Expand Up @@ -156,35 +156,9 @@ cleanup:
}

extern "C" {
using KEM_512 = decltype(ML_KEM_512() + Block());
using KEM_768 = decltype(ML_KEM_768() + Block());
using KEM_1024 = decltype(ML_KEM_1024() + Block());

#if defined(OQS_ENABLE_KEM_ml_kem_512_cupqc)
int cupqc_ml_kem_512_keypair(uint8_t *pk, uint8_t *sk) {
return keypair<KEM_512>(pk, sk);
}
int cupqc_ml_kem_512_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk) {
return encaps<KEM_512>(ct, ss, pk);
}
int cupqc_ml_kem_512_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk) {
return decaps<KEM_512>(ss, ct, sk);
}
#endif

#if defined(OQS_ENABLE_KEM_ml_kem_768_cupqc)
int cupqc_ml_kem_768_keypair(uint8_t *pk, uint8_t *sk) {
return keypair<KEM_768>(pk, sk);
}
int cupqc_ml_kem_768_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk) {
return encaps<KEM_768>(ct, ss, pk);
}
int cupqc_ml_kem_768_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk) {
return decaps<KEM_768>(ss, ct, sk);
}
#endif

#if defined(OQS_ENABLE_KEM_ml_kem_1024_cupqc)
#if defined(OQS_ENABLE_KEM_ml_kem_1024_cuda)
int cupqc_ml_kem_1024_keypair(uint8_t *pk, uint8_t *sk) {
return keypair<KEM_1024>(pk, sk);
}
Expand Down
28 changes: 1 addition & 27 deletions src/kem/ml_kem/cupqc_ml-kem-512_cuda/cupqc_ml-kem.cu
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,8 @@ cleanup:

extern "C" {
using KEM_512 = decltype(ML_KEM_512() + Block());
using KEM_768 = decltype(ML_KEM_768() + Block());
using KEM_1024 = decltype(ML_KEM_1024() + Block());

#if defined(OQS_ENABLE_KEM_ml_kem_512_cupqc)
#if defined(OQS_ENABLE_KEM_ml_kem_512_cuda)
int cupqc_ml_kem_512_keypair(uint8_t *pk, uint8_t *sk) {
return keypair<KEM_512>(pk, sk);
}
Expand All @@ -171,28 +169,4 @@ extern "C" {
return decaps<KEM_512>(ss, ct, sk);
}
#endif

#if defined(OQS_ENABLE_KEM_ml_kem_768_cupqc)
int cupqc_ml_kem_768_keypair(uint8_t *pk, uint8_t *sk) {
return keypair<KEM_768>(pk, sk);
}
int cupqc_ml_kem_768_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk) {
return encaps<KEM_768>(ct, ss, pk);
}
int cupqc_ml_kem_768_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk) {
return decaps<KEM_768>(ss, ct, sk);
}
#endif

#if defined(OQS_ENABLE_KEM_ml_kem_1024_cupqc)
int cupqc_ml_kem_1024_keypair(uint8_t *pk, uint8_t *sk) {
return keypair<KEM_1024>(pk, sk);
}
int cupqc_ml_kem_1024_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk) {
return encaps<KEM_1024>(ct, ss, pk);
}
int cupqc_ml_kem_1024_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk) {
return decaps<KEM_1024>(ss, ct, sk);
}
#endif
}
28 changes: 1 addition & 27 deletions src/kem/ml_kem/cupqc_ml-kem-768_cuda/cupqc_ml-kem.cu
Original file line number Diff line number Diff line change
Expand Up @@ -156,23 +156,9 @@ cleanup:
}

extern "C" {
using KEM_512 = decltype(ML_KEM_512() + Block());
using KEM_768 = decltype(ML_KEM_768() + Block());
using KEM_1024 = decltype(ML_KEM_1024() + Block());

#if defined(OQS_ENABLE_KEM_ml_kem_512_cupqc)
int cupqc_ml_kem_512_keypair(uint8_t *pk, uint8_t *sk) {
return keypair<KEM_512>(pk, sk);
}
int cupqc_ml_kem_512_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk) {
return encaps<KEM_512>(ct, ss, pk);
}
int cupqc_ml_kem_512_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk) {
return decaps<KEM_512>(ss, ct, sk);
}
#endif

#if defined(OQS_ENABLE_KEM_ml_kem_768_cupqc)
#if defined(OQS_ENABLE_KEM_ml_kem_768_cuda)
int cupqc_ml_kem_768_keypair(uint8_t *pk, uint8_t *sk) {
return keypair<KEM_768>(pk, sk);
}
Expand All @@ -183,16 +169,4 @@ extern "C" {
return decaps<KEM_768>(ss, ct, sk);
}
#endif

#if defined(OQS_ENABLE_KEM_ml_kem_1024_cupqc)
int cupqc_ml_kem_1024_keypair(uint8_t *pk, uint8_t *sk) {
return keypair<KEM_1024>(pk, sk);
}
int cupqc_ml_kem_1024_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk) {
return encaps<KEM_1024>(ct, ss, pk);
}
int cupqc_ml_kem_1024_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk) {
return decaps<KEM_1024>(ss, ct, sk);
}
#endif
}

0 comments on commit 5dc3f49

Please sign in to comment.