mirror of
https://github.com/henrydcase/pqc.git
synced 2024-11-22 15:39:07 +00:00
fix namespacing for mamabear, papabear
This commit is contained in:
parent
e94842b0ef
commit
4c84fd915b
@ -11,4 +11,4 @@ principal-submitters:
|
|||||||
- Mike Hamburg
|
- Mike Hamburg
|
||||||
implementations:
|
implementations:
|
||||||
- name: clean
|
- name: clean
|
||||||
- version: https://sourceforge.net/p/threebears/code/ci/f4ce0ebfc84a5e01a75bfc8297b6d175e993cfa4/
|
version: https://sourceforge.net/p/threebears/code/ci/f4ce0ebfc84a5e01a75bfc8297b6d175e993cfa4/
|
||||||
|
@ -194,7 +194,6 @@ void PQCLEAN_BABYBEAR_CLEAN_decapsulate(
|
|||||||
PQCLEAN_BABYBEAR_CLEAN_melas_fec_correct(seed, ENC_SEED_BYTES, &seed[ENC_SEED_BYTES]);
|
PQCLEAN_BABYBEAR_CLEAN_melas_fec_correct(seed, ENC_SEED_BYTES, &seed[ENC_SEED_BYTES]);
|
||||||
|
|
||||||
/* Re-encapsulate and check; encapsulate will compute the shared secret */
|
/* Re-encapsulate and check; encapsulate will compute the shared secret */
|
||||||
//pk[PUBLIC_KEY_BYTES], capsule2[CAPSULE_BYTES];
|
|
||||||
PQCLEAN_BABYBEAR_CLEAN_get_pubkey(pk, sk);
|
PQCLEAN_BABYBEAR_CLEAN_get_pubkey(pk, sk);
|
||||||
memcpy(&seed[ENC_SEED_BYTES], &lpr_data[(ENC_BITS * LPR_BITS + 7) / 8], IV_BYTES);
|
memcpy(&seed[ENC_SEED_BYTES], &lpr_data[(ENC_BITS * LPR_BITS + 7) / 8], IV_BYTES);
|
||||||
PQCLEAN_BABYBEAR_CLEAN_encapsulate(shared_secret, capsule2, pk, seed);
|
PQCLEAN_BABYBEAR_CLEAN_encapsulate(shared_secret, capsule2, pk, seed);
|
||||||
|
@ -11,4 +11,4 @@ principal-submitters:
|
|||||||
- Mike Hamburg
|
- Mike Hamburg
|
||||||
implementations:
|
implementations:
|
||||||
- name: clean
|
- name: clean
|
||||||
- version: https://sourceforge.net/p/threebears/code/ci/f4ce0ebfc84a5e01a75bfc8297b6d175e993cfa4/
|
version: https://sourceforge.net/p/threebears/code/ci/f4ce0ebfc84a5e01a75bfc8297b6d175e993cfa4/
|
||||||
|
@ -17,9 +17,9 @@
|
|||||||
#define PRF_KEY_BYTES PRIVATE_KEY_BYTES
|
#define PRF_KEY_BYTES PRIVATE_KEY_BYTES
|
||||||
|
|
||||||
#define BEAR_NAME "MamaBear"
|
#define BEAR_NAME "MamaBear"
|
||||||
#define encapsulate MamaBear_encapsulate
|
#define encapsulate PQCLEAN_MAMABEAR_CLEAN_encapsulate
|
||||||
#define decapsulate MamaBear_decapsulate
|
#define decapsulate PQCLEAN_MAMABEAR_CLEAN_decapsulate
|
||||||
#define get_pubkey MamaBear_get_pubkey
|
#define get_pubkey PQCLEAN_MAMABEAR_CLEAN_get_pubkey
|
||||||
|
|
||||||
#define GF_BYTES ((LGX*DIGITS+7)/8)
|
#define GF_BYTES ((LGX*DIGITS+7)/8)
|
||||||
#define PUBLIC_KEY_BYTES (MATRIX_SEED_BYTES + DIM*GF_BYTES)
|
#define PUBLIC_KEY_BYTES (MATRIX_SEED_BYTES + DIM*GF_BYTES)
|
||||||
|
@ -194,7 +194,6 @@ void PQCLEAN_MAMABEAR_CLEAN_decapsulate(
|
|||||||
PQCLEAN_MAMABEAR_CLEAN_melas_fec_correct(seed, ENC_SEED_BYTES, &seed[ENC_SEED_BYTES]);
|
PQCLEAN_MAMABEAR_CLEAN_melas_fec_correct(seed, ENC_SEED_BYTES, &seed[ENC_SEED_BYTES]);
|
||||||
|
|
||||||
/* Re-encapsulate and check; encapsulate will compute the shared secret */
|
/* Re-encapsulate and check; encapsulate will compute the shared secret */
|
||||||
//pk[PUBLIC_KEY_BYTES], capsule2[CAPSULE_BYTES];
|
|
||||||
PQCLEAN_MAMABEAR_CLEAN_get_pubkey(pk, sk);
|
PQCLEAN_MAMABEAR_CLEAN_get_pubkey(pk, sk);
|
||||||
memcpy(&seed[ENC_SEED_BYTES], &lpr_data[(ENC_BITS * LPR_BITS + 7) / 8], IV_BYTES);
|
memcpy(&seed[ENC_SEED_BYTES], &lpr_data[(ENC_BITS * LPR_BITS + 7) / 8], IV_BYTES);
|
||||||
PQCLEAN_MAMABEAR_CLEAN_encapsulate(shared_secret, capsule2, pk, seed);
|
PQCLEAN_MAMABEAR_CLEAN_encapsulate(shared_secret, capsule2, pk, seed);
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
* @param[out] pk The public key.
|
* @param[out] pk The public key.
|
||||||
* @param[in] sk The private key, which must be uniformly random.
|
* @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],
|
uint8_t pk[MAMABEAR_PUBLIC_KEY_BYTES],
|
||||||
const uint8_t sk[MAMABEAR_PRIVATE_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] pk The other party's public key.
|
||||||
* @param[in] seed A random seed.
|
* @param[in] seed A random seed.
|
||||||
*/
|
*/
|
||||||
void MamaBear_encapsulate (
|
void PQCLEAN_MAMABEAR_CLEAN_encapsulate (
|
||||||
uint8_t shared_secret[MAMABEAR_SHARED_SECRET_BYTES],
|
uint8_t shared_secret[MAMABEAR_SHARED_SECRET_BYTES],
|
||||||
uint8_t capsule[MAMABEAR_CAPSULE_BYTES],
|
uint8_t capsule[MAMABEAR_CAPSULE_BYTES],
|
||||||
const uint8_t pk[MAMABEAR_PUBLIC_KEY_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] capsule The capsule produced by encapsulate_cca2.
|
||||||
* @param[in] sk The private key.
|
* @param[in] sk The private key.
|
||||||
*/
|
*/
|
||||||
void MamaBear_decapsulate (
|
void PQCLEAN_MAMABEAR_CLEAN_decapsulate (
|
||||||
uint8_t shared_secret[MAMABEAR_SHARED_SECRET_BYTES],
|
uint8_t shared_secret[MAMABEAR_SHARED_SECRET_BYTES],
|
||||||
const uint8_t capsule[MAMABEAR_CAPSULE_BYTES],
|
const uint8_t capsule[MAMABEAR_CAPSULE_BYTES],
|
||||||
const uint8_t sk[MAMABEAR_PRIVATE_KEY_BYTES]
|
const uint8_t sk[MAMABEAR_PRIVATE_KEY_BYTES]
|
||||||
|
@ -6,9 +6,9 @@ length-public-key: 1584
|
|||||||
length-ciphertext: 1697
|
length-ciphertext: 1697
|
||||||
length-secret-key: 40
|
length-secret-key: 40
|
||||||
length-shared-secret: 32
|
length-shared-secret: 32
|
||||||
nistkat-sha256: 977429507fa60a24a608193a507e39f4d9deaf4c6359f94f36b2d9ca0897c997
|
nistkat-sha256: 60212e4433ee326c375b00996e1f524b37a8a12fba16aa51c420315a20dbd708
|
||||||
principal-submitters:
|
principal-submitters:
|
||||||
- Mike Hamburg
|
- Mike Hamburg
|
||||||
implementations:
|
implementations:
|
||||||
- name: clean
|
- name: clean
|
||||||
- version: https://sourceforge.net/p/threebears/code/ci/f4ce0ebfc84a5e01a75bfc8297b6d175e993cfa4/
|
version: https://sourceforge.net/p/threebears/code/ci/f4ce0ebfc84a5e01a75bfc8297b6d175e993cfa4/
|
||||||
|
@ -17,9 +17,9 @@
|
|||||||
#define PRF_KEY_BYTES PRIVATE_KEY_BYTES
|
#define PRF_KEY_BYTES PRIVATE_KEY_BYTES
|
||||||
|
|
||||||
#define BEAR_NAME "PapaBear"
|
#define BEAR_NAME "PapaBear"
|
||||||
#define encapsulate PapaBear_encapsulate
|
#define encapsulate PQCLEAN_PAPABEAR_CLEAN_encapsulate
|
||||||
#define decapsulate PapaBear_decapsulate
|
#define decapsulate PQCLEAN_PAPABEAR_CLEAN_decapsulate
|
||||||
#define get_pubkey PapaBear_get_pubkey
|
#define get_pubkey PQCLEAN_PAPABEAR_CLEAN_get_pubkey
|
||||||
|
|
||||||
#define GF_BYTES ((LGX*DIGITS+7)/8)
|
#define GF_BYTES ((LGX*DIGITS+7)/8)
|
||||||
#define PUBLIC_KEY_BYTES (MATRIX_SEED_BYTES + DIM*GF_BYTES)
|
#define PUBLIC_KEY_BYTES (MATRIX_SEED_BYTES + DIM*GF_BYTES)
|
||||||
|
@ -194,7 +194,6 @@ void PQCLEAN_PAPABEAR_CLEAN_decapsulate(
|
|||||||
PQCLEAN_PAPABEAR_CLEAN_melas_fec_correct(seed, ENC_SEED_BYTES, &seed[ENC_SEED_BYTES]);
|
PQCLEAN_PAPABEAR_CLEAN_melas_fec_correct(seed, ENC_SEED_BYTES, &seed[ENC_SEED_BYTES]);
|
||||||
|
|
||||||
/* Re-encapsulate and check; encapsulate will compute the shared secret */
|
/* Re-encapsulate and check; encapsulate will compute the shared secret */
|
||||||
//pk[PUBLIC_KEY_BYTES], capsule2[CAPSULE_BYTES];
|
|
||||||
PQCLEAN_PAPABEAR_CLEAN_get_pubkey(pk, sk);
|
PQCLEAN_PAPABEAR_CLEAN_get_pubkey(pk, sk);
|
||||||
memcpy(&seed[ENC_SEED_BYTES], &lpr_data[(ENC_BITS * LPR_BITS + 7) / 8], IV_BYTES);
|
memcpy(&seed[ENC_SEED_BYTES], &lpr_data[(ENC_BITS * LPR_BITS + 7) / 8], IV_BYTES);
|
||||||
PQCLEAN_PAPABEAR_CLEAN_encapsulate(shared_secret, capsule2, pk, seed);
|
PQCLEAN_PAPABEAR_CLEAN_encapsulate(shared_secret, capsule2, pk, seed);
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
* @param[out] pk The public key.
|
* @param[out] pk The public key.
|
||||||
* @param[in] sk The private key, which must be uniformly random.
|
* @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],
|
uint8_t pk[PAPABEAR_PUBLIC_KEY_BYTES],
|
||||||
const uint8_t sk[PAPABEAR_PRIVATE_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] pk The other party's public key.
|
||||||
* @param[in] seed A random seed.
|
* @param[in] seed A random seed.
|
||||||
*/
|
*/
|
||||||
void PapaBear_encapsulate (
|
void PQCLEAN_PAPABEAR_CLEAN_encapsulate (
|
||||||
uint8_t shared_secret[PAPABEAR_SHARED_SECRET_BYTES],
|
uint8_t shared_secret[PAPABEAR_SHARED_SECRET_BYTES],
|
||||||
uint8_t capsule[PAPABEAR_CAPSULE_BYTES],
|
uint8_t capsule[PAPABEAR_CAPSULE_BYTES],
|
||||||
const uint8_t pk[PAPABEAR_PUBLIC_KEY_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] capsule The capsule produced by encapsulate_cca2.
|
||||||
* @param[in] sk The private key.
|
* @param[in] sk The private key.
|
||||||
*/
|
*/
|
||||||
void PapaBear_decapsulate (
|
void PQCLEAN_PAPABEAR_CLEAN_decapsulate (
|
||||||
uint8_t shared_secret[PAPABEAR_SHARED_SECRET_BYTES],
|
uint8_t shared_secret[PAPABEAR_SHARED_SECRET_BYTES],
|
||||||
const uint8_t capsule[PAPABEAR_CAPSULE_BYTES],
|
const uint8_t capsule[PAPABEAR_CAPSULE_BYTES],
|
||||||
const uint8_t sk[PAPABEAR_PRIVATE_KEY_BYTES]
|
const uint8_t sk[PAPABEAR_PRIVATE_KEY_BYTES]
|
||||||
|
Loading…
Reference in New Issue
Block a user