forked from aws/aws-lc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Kyber768 and Kyber1024 (round 3) KEMs (aws#784)
Co-authored-by: dkostic <[email protected]>
- Loading branch information
Showing
22 changed files
with
2,582 additions
and
748 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 OR ISC | ||
|
||
#include <openssl/base.h> | ||
|
||
#include "../fipsmodule/delocate.h" | ||
#include "../internal.h" | ||
#include "internal.h" | ||
|
||
#include "../kyber/kem_kyber.h" | ||
|
||
static int kyber512r3_keygen(uint8_t *public_key, | ||
uint8_t *secret_key) { | ||
return kyber512r3_keypair(public_key, secret_key) == 0; | ||
} | ||
|
||
static int kyber512r3_encaps(uint8_t *ciphertext, | ||
uint8_t *shared_secret, | ||
const uint8_t *public_key) { | ||
return kyber512r3_encapsulate(ciphertext, shared_secret, public_key) == 0; | ||
} | ||
|
||
static int kyber512r3_decaps(uint8_t *shared_secret, | ||
const uint8_t *ciphertext, | ||
const uint8_t *secret_key) { | ||
return kyber512r3_decapsulate(shared_secret, ciphertext, secret_key) == 0; | ||
} | ||
|
||
const KEM_METHOD kem_kyber512r3_method = { | ||
kyber512r3_keygen, | ||
kyber512r3_encaps, | ||
kyber512r3_decaps, | ||
}; | ||
|
||
static int kyber768r3_keygen(uint8_t *public_key, | ||
uint8_t *secret_key) { | ||
return kyber768r3_keypair(public_key, secret_key) == 0; | ||
} | ||
|
||
static int kyber768r3_encaps(uint8_t *ciphertext, | ||
uint8_t *shared_secret, | ||
const uint8_t *public_key) { | ||
return kyber768r3_encapsulate(ciphertext, shared_secret, public_key) == 0; | ||
} | ||
|
||
static int kyber768r3_decaps(uint8_t *shared_secret, | ||
const uint8_t *ciphertext, | ||
const uint8_t *secret_key) { | ||
return kyber768r3_decapsulate(shared_secret, ciphertext, secret_key) == 0; | ||
} | ||
|
||
const KEM_METHOD kem_kyber768r3_method = { | ||
kyber768r3_keygen, | ||
kyber768r3_encaps, | ||
kyber768r3_decaps, | ||
}; | ||
|
||
static int kyber1024r3_keygen(uint8_t *public_key, | ||
uint8_t *secret_key) { | ||
return kyber1024r3_keypair(public_key, secret_key) == 0; | ||
} | ||
|
||
static int kyber1024r3_encaps(uint8_t *ciphertext, | ||
uint8_t *shared_secret, | ||
const uint8_t *public_key) { | ||
return kyber1024r3_encapsulate(ciphertext, shared_secret, public_key) == 0; | ||
} | ||
|
||
static int kyber1024r3_decaps(uint8_t *shared_secret, | ||
const uint8_t *ciphertext, | ||
const uint8_t *secret_key) { | ||
return kyber1024r3_decapsulate(shared_secret, ciphertext, secret_key) == 0; | ||
} | ||
|
||
const KEM_METHOD kem_kyber1024r3_method = { | ||
kyber1024r3_keygen, | ||
kyber1024r3_encaps, | ||
kyber1024r3_decaps, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.