From 4c84fd915bebc3c6ff737502c145ded46b63626e Mon Sep 17 00:00:00 2001 From: Leon Botros Date: Thu, 24 Oct 2019 19:02:47 +0200 Subject: [PATCH] fix namespacing for mamabear, papabear --- crypto_kem/babybear/META.yml | 2 +- crypto_kem/babybear/clean/threebears.c | 1 - crypto_kem/mamabear/META.yml | 2 +- crypto_kem/mamabear/clean/params.h | 6 +++--- crypto_kem/mamabear/clean/threebears.c | 1 - crypto_kem/mamabear/clean/threebears.h | 6 +++--- crypto_kem/papabear/META.yml | 4 ++-- crypto_kem/papabear/clean/params.h | 6 +++--- crypto_kem/papabear/clean/threebears.c | 1 - crypto_kem/papabear/clean/threebears.h | 6 +++--- 10 files changed, 16 insertions(+), 19 deletions(-) diff --git a/crypto_kem/babybear/META.yml b/crypto_kem/babybear/META.yml index 66153307..5b8d79c6 100644 --- a/crypto_kem/babybear/META.yml +++ b/crypto_kem/babybear/META.yml @@ -11,4 +11,4 @@ principal-submitters: - Mike Hamburg implementations: - name: clean - - version: https://sourceforge.net/p/threebears/code/ci/f4ce0ebfc84a5e01a75bfc8297b6d175e993cfa4/ + version: https://sourceforge.net/p/threebears/code/ci/f4ce0ebfc84a5e01a75bfc8297b6d175e993cfa4/ diff --git a/crypto_kem/babybear/clean/threebears.c b/crypto_kem/babybear/clean/threebears.c index b35d4ff1..c0487409 100644 --- a/crypto_kem/babybear/clean/threebears.c +++ b/crypto_kem/babybear/clean/threebears.c @@ -194,7 +194,6 @@ void PQCLEAN_BABYBEAR_CLEAN_decapsulate( PQCLEAN_BABYBEAR_CLEAN_melas_fec_correct(seed, ENC_SEED_BYTES, &seed[ENC_SEED_BYTES]); /* Re-encapsulate and check; encapsulate will compute the shared secret */ - //pk[PUBLIC_KEY_BYTES], capsule2[CAPSULE_BYTES]; PQCLEAN_BABYBEAR_CLEAN_get_pubkey(pk, sk); memcpy(&seed[ENC_SEED_BYTES], &lpr_data[(ENC_BITS * LPR_BITS + 7) / 8], IV_BYTES); PQCLEAN_BABYBEAR_CLEAN_encapsulate(shared_secret, capsule2, pk, seed); diff --git a/crypto_kem/mamabear/META.yml b/crypto_kem/mamabear/META.yml index f712794c..d0ea60f8 100644 --- a/crypto_kem/mamabear/META.yml +++ b/crypto_kem/mamabear/META.yml @@ -11,4 +11,4 @@ principal-submitters: - Mike Hamburg implementations: - name: clean - - version: https://sourceforge.net/p/threebears/code/ci/f4ce0ebfc84a5e01a75bfc8297b6d175e993cfa4/ + version: https://sourceforge.net/p/threebears/code/ci/f4ce0ebfc84a5e01a75bfc8297b6d175e993cfa4/ diff --git a/crypto_kem/mamabear/clean/params.h b/crypto_kem/mamabear/clean/params.h index 7b875af9..b5ef85fa 100644 --- a/crypto_kem/mamabear/clean/params.h +++ b/crypto_kem/mamabear/clean/params.h @@ -17,9 +17,9 @@ #define PRF_KEY_BYTES PRIVATE_KEY_BYTES #define BEAR_NAME "MamaBear" -#define encapsulate MamaBear_encapsulate -#define decapsulate MamaBear_decapsulate -#define get_pubkey MamaBear_get_pubkey +#define encapsulate PQCLEAN_MAMABEAR_CLEAN_encapsulate +#define decapsulate PQCLEAN_MAMABEAR_CLEAN_decapsulate +#define get_pubkey PQCLEAN_MAMABEAR_CLEAN_get_pubkey #define GF_BYTES ((LGX*DIGITS+7)/8) #define PUBLIC_KEY_BYTES (MATRIX_SEED_BYTES + DIM*GF_BYTES) diff --git a/crypto_kem/mamabear/clean/threebears.c b/crypto_kem/mamabear/clean/threebears.c index 0aba57be..0db882c6 100644 --- a/crypto_kem/mamabear/clean/threebears.c +++ b/crypto_kem/mamabear/clean/threebears.c @@ -194,7 +194,6 @@ void PQCLEAN_MAMABEAR_CLEAN_decapsulate( PQCLEAN_MAMABEAR_CLEAN_melas_fec_correct(seed, ENC_SEED_BYTES, &seed[ENC_SEED_BYTES]); /* Re-encapsulate and check; encapsulate will compute the shared secret */ - //pk[PUBLIC_KEY_BYTES], capsule2[CAPSULE_BYTES]; PQCLEAN_MAMABEAR_CLEAN_get_pubkey(pk, sk); memcpy(&seed[ENC_SEED_BYTES], &lpr_data[(ENC_BITS * LPR_BITS + 7) / 8], IV_BYTES); PQCLEAN_MAMABEAR_CLEAN_encapsulate(shared_secret, capsule2, pk, seed); diff --git a/crypto_kem/mamabear/clean/threebears.h b/crypto_kem/mamabear/clean/threebears.h index 0d979068..00e173fa 100644 --- a/crypto_kem/mamabear/clean/threebears.h +++ b/crypto_kem/mamabear/clean/threebears.h @@ -17,7 +17,7 @@ * @param[out] pk The public key. * @param[in] sk The private key, which must be uniformly random. */ -void MamaBear_get_pubkey ( +void PQCLEAN_MAMABEAR_CLEAN_get_pubkey ( uint8_t pk[MAMABEAR_PUBLIC_KEY_BYTES], const uint8_t sk[MAMABEAR_PRIVATE_KEY_BYTES] ); @@ -32,7 +32,7 @@ void MamaBear_get_pubkey ( * @param[in] pk The other party's public key. * @param[in] seed A random seed. */ -void MamaBear_encapsulate ( +void PQCLEAN_MAMABEAR_CLEAN_encapsulate ( uint8_t shared_secret[MAMABEAR_SHARED_SECRET_BYTES], uint8_t capsule[MAMABEAR_CAPSULE_BYTES], const uint8_t pk[MAMABEAR_PUBLIC_KEY_BYTES], @@ -49,7 +49,7 @@ void MamaBear_encapsulate ( * @param[in] capsule The capsule produced by encapsulate_cca2. * @param[in] sk The private key. */ -void MamaBear_decapsulate ( +void PQCLEAN_MAMABEAR_CLEAN_decapsulate ( uint8_t shared_secret[MAMABEAR_SHARED_SECRET_BYTES], const uint8_t capsule[MAMABEAR_CAPSULE_BYTES], const uint8_t sk[MAMABEAR_PRIVATE_KEY_BYTES] diff --git a/crypto_kem/papabear/META.yml b/crypto_kem/papabear/META.yml index 79cf227c..32b02549 100644 --- a/crypto_kem/papabear/META.yml +++ b/crypto_kem/papabear/META.yml @@ -6,9 +6,9 @@ length-public-key: 1584 length-ciphertext: 1697 length-secret-key: 40 length-shared-secret: 32 -nistkat-sha256: 977429507fa60a24a608193a507e39f4d9deaf4c6359f94f36b2d9ca0897c997 +nistkat-sha256: 60212e4433ee326c375b00996e1f524b37a8a12fba16aa51c420315a20dbd708 principal-submitters: - Mike Hamburg implementations: - name: clean - - version: https://sourceforge.net/p/threebears/code/ci/f4ce0ebfc84a5e01a75bfc8297b6d175e993cfa4/ + version: https://sourceforge.net/p/threebears/code/ci/f4ce0ebfc84a5e01a75bfc8297b6d175e993cfa4/ diff --git a/crypto_kem/papabear/clean/params.h b/crypto_kem/papabear/clean/params.h index 7d601cc5..46e21598 100644 --- a/crypto_kem/papabear/clean/params.h +++ b/crypto_kem/papabear/clean/params.h @@ -17,9 +17,9 @@ #define PRF_KEY_BYTES PRIVATE_KEY_BYTES #define BEAR_NAME "PapaBear" -#define encapsulate PapaBear_encapsulate -#define decapsulate PapaBear_decapsulate -#define get_pubkey PapaBear_get_pubkey +#define encapsulate PQCLEAN_PAPABEAR_CLEAN_encapsulate +#define decapsulate PQCLEAN_PAPABEAR_CLEAN_decapsulate +#define get_pubkey PQCLEAN_PAPABEAR_CLEAN_get_pubkey #define GF_BYTES ((LGX*DIGITS+7)/8) #define PUBLIC_KEY_BYTES (MATRIX_SEED_BYTES + DIM*GF_BYTES) diff --git a/crypto_kem/papabear/clean/threebears.c b/crypto_kem/papabear/clean/threebears.c index 9cf69be5..e2932071 100644 --- a/crypto_kem/papabear/clean/threebears.c +++ b/crypto_kem/papabear/clean/threebears.c @@ -194,7 +194,6 @@ void PQCLEAN_PAPABEAR_CLEAN_decapsulate( PQCLEAN_PAPABEAR_CLEAN_melas_fec_correct(seed, ENC_SEED_BYTES, &seed[ENC_SEED_BYTES]); /* Re-encapsulate and check; encapsulate will compute the shared secret */ - //pk[PUBLIC_KEY_BYTES], capsule2[CAPSULE_BYTES]; PQCLEAN_PAPABEAR_CLEAN_get_pubkey(pk, sk); memcpy(&seed[ENC_SEED_BYTES], &lpr_data[(ENC_BITS * LPR_BITS + 7) / 8], IV_BYTES); PQCLEAN_PAPABEAR_CLEAN_encapsulate(shared_secret, capsule2, pk, seed); diff --git a/crypto_kem/papabear/clean/threebears.h b/crypto_kem/papabear/clean/threebears.h index d4378696..ac21c0a2 100644 --- a/crypto_kem/papabear/clean/threebears.h +++ b/crypto_kem/papabear/clean/threebears.h @@ -17,7 +17,7 @@ * @param[out] pk The public key. * @param[in] sk The private key, which must be uniformly random. */ -void PapaBear_get_pubkey ( +void PQCLEAN_PAPABEAR_CLEAN_get_pubkey ( uint8_t pk[PAPABEAR_PUBLIC_KEY_BYTES], const uint8_t sk[PAPABEAR_PRIVATE_KEY_BYTES] ); @@ -32,7 +32,7 @@ void PapaBear_get_pubkey ( * @param[in] pk The other party's public key. * @param[in] seed A random seed. */ -void PapaBear_encapsulate ( +void PQCLEAN_PAPABEAR_CLEAN_encapsulate ( uint8_t shared_secret[PAPABEAR_SHARED_SECRET_BYTES], uint8_t capsule[PAPABEAR_CAPSULE_BYTES], const uint8_t pk[PAPABEAR_PUBLIC_KEY_BYTES], @@ -49,7 +49,7 @@ void PapaBear_encapsulate ( * @param[in] capsule The capsule produced by encapsulate_cca2. * @param[in] sk The private key. */ -void PapaBear_decapsulate ( +void PQCLEAN_PAPABEAR_CLEAN_decapsulate ( uint8_t shared_secret[PAPABEAR_SHARED_SECRET_BYTES], const uint8_t capsule[PAPABEAR_CAPSULE_BYTES], const uint8_t sk[PAPABEAR_PRIVATE_KEY_BYTES]