Browse Source

fix namespacing for mamabear, papabear

kyber
Leon Botros 5 years ago
committed by Kris Kwiatkowski
parent
commit
4c84fd915b
10 changed files with 16 additions and 19 deletions
  1. +1
    -1
      crypto_kem/babybear/META.yml
  2. +0
    -1
      crypto_kem/babybear/clean/threebears.c
  3. +1
    -1
      crypto_kem/mamabear/META.yml
  4. +3
    -3
      crypto_kem/mamabear/clean/params.h
  5. +0
    -1
      crypto_kem/mamabear/clean/threebears.c
  6. +3
    -3
      crypto_kem/mamabear/clean/threebears.h
  7. +2
    -2
      crypto_kem/papabear/META.yml
  8. +3
    -3
      crypto_kem/papabear/clean/params.h
  9. +0
    -1
      crypto_kem/papabear/clean/threebears.c
  10. +3
    -3
      crypto_kem/papabear/clean/threebears.h

+ 1
- 1
crypto_kem/babybear/META.yml View File

@@ -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/

+ 0
- 1
crypto_kem/babybear/clean/threebears.c View File

@@ -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);


+ 1
- 1
crypto_kem/mamabear/META.yml View File

@@ -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/

+ 3
- 3
crypto_kem/mamabear/clean/params.h View File

@@ -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)


+ 0
- 1
crypto_kem/mamabear/clean/threebears.c View File

@@ -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);


+ 3
- 3
crypto_kem/mamabear/clean/threebears.h View File

@@ -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]


+ 2
- 2
crypto_kem/papabear/META.yml View File

@@ -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/

+ 3
- 3
crypto_kem/papabear/clean/params.h View File

@@ -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)


+ 0
- 1
crypto_kem/papabear/clean/threebears.c View File

@@ -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);


+ 3
- 3
crypto_kem/papabear/clean/threebears.h View File

@@ -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]


Loading…
Cancel
Save