27#include "bctoolbox/crypto.hh"
29#include "postquantumcryptoengine/crypto.hh"
62 static const std::string
Id() {
return std::string(
"CURVE25519");};
66 static constexpr size_t Xsize(
lime::Xtype dataType) {
return BCTBX_ECDH_X25519_PUBLIC_SIZE;};
77 static const std::string
Id() {
return std::string(
"CURVE448");};
81 static constexpr size_t Xsize(
lime::Xtype dataType) {
return BCTBX_ECDH_X448_PUBLIC_SIZE;};
93 struct K512:
public genericKEM {
95 static const std::string Id(
void) {
return std::string(
"KYBER512");};
97 static constexpr size_t Ksize(
lime::Ktype dataType) {
100 return bctoolbox::KYBER512::kPkSize;
103 return bctoolbox::KYBER512::kSkSize;
106 return bctoolbox::KYBER512::kCtSize;
109 return bctoolbox::KYBER512::kSsSize;
121 static const std::string Id(
void) {
return std::string(
"MLKEM512");};
123 static constexpr size_t Ksize(
lime::Ktype dataType) {
126 return bctoolbox::MLKEM512::kPkSize;
129 return bctoolbox::MLKEM512::kSkSize;
132 return bctoolbox::MLKEM512::kCtSize;
135 return bctoolbox::MLKEM512::kSsSize;
147 static const std::string Id(
void) {
return std::string(
"MLKEM1024");};
149 static constexpr size_t Ksize(
lime::Ktype dataType) {
152 return bctoolbox::MLKEM1024::kPkSize;
155 return bctoolbox::MLKEM1024::kSkSize;
158 return bctoolbox::MLKEM1024::kCtSize;
161 return bctoolbox::MLKEM1024::kSsSize;
169 struct C255K512:
public C255,K512 {
174 struct C255MLK512:
public C255,MLK512 {
179 struct C448MLK1024:
public C448,MLK1024 {
192 static constexpr size_t ssize() {
return 64;}
201 static constexpr size_t keySize(
void) {
return 32;};
203 static constexpr size_t tagSize(
void) {
return 16;};
Ktype
List of data types used by key encapsulation mechanism algorithm.
Definition lime_keys.hpp:43
@ sharedSecret
Definition lime_keys.hpp:43
@ cipherText
Definition lime_keys.hpp:43
@ privateKey
Definition lime_keys.hpp:43
@ publicKey
Definition lime_keys.hpp:43
DSAtype
List of data types used by Signature algorithm.
Definition lime_keys.hpp:49
@ signature
Definition lime_keys.hpp:49
Xtype
List of data types used by key Echange algorithm.
Definition lime_keys.hpp:38
@ sharedSecret
Definition lime_keys.hpp:38
@ privateKey
Definition lime_keys.hpp:38
@ publicKey
Definition lime_keys.hpp:38
CurveId
Definition lime.hpp:37
@ c25519mlk512
Definition lime.hpp:42
@ c448
Definition lime.hpp:40
@ c448mlk1024
Definition lime.hpp:43
@ c25519k512
Definition lime.hpp:41
@ unset
Definition lime.hpp:38
@ c25519
Definition lime.hpp:39
AES256GCM buffers size definition.
Definition lime_keys.hpp:199
static constexpr size_t keySize(void)
key size is 32 bytes
Definition lime_keys.hpp:201
static constexpr size_t tagSize(void)
we use authentication tag size of 16 bytes
Definition lime_keys.hpp:203
curve 25519 data types size definition
Definition lime_keys.hpp:59
static const std::string Id()
a string to indentify this curve
Definition lime_keys.hpp:62
C255 EC
Definition lime_keys.hpp:60
static constexpr size_t Xsize(lime::Xtype dataType)
for X25519, public, private and shared secret have the same length: 32 bytes
Definition lime_keys.hpp:66
static constexpr lime::CurveId curveId()
the C25519 curve id using the CurveId enumeration
Definition lime_keys.hpp:64
static constexpr size_t DSAsize(lime::DSAtype dataType)
for Ed25519, public and private key have the same length: 32 bytes, signature is 64 bytes long
Definition lime_keys.hpp:68
curve 448-goldilocks data types size definition
Definition lime_keys.hpp:74
C448 EC
Definition lime_keys.hpp:75
static const std::string Id()
a string to indentify this curve
Definition lime_keys.hpp:77
static constexpr lime::CurveId curveId()
the C448 curve id using the CurveId enumeration
Definition lime_keys.hpp:79
static constexpr size_t Xsize(lime::Xtype dataType)
for X448, public, private and shared secret have the same length 56 bytes
Definition lime_keys.hpp:81
static constexpr size_t DSAsize(lime::DSAtype dataType)
for Ed448, public and private key have the same length 57 bytes, signature is 114 bytes long
Definition lime_keys.hpp:83
SHA512 buffer size definition.
Definition lime_keys.hpp:190
static constexpr size_t ssize()
maximum output size for SHA512 is 64 bytes
Definition lime_keys.hpp:192
Definition lime_keys.hpp:86
static constexpr lime::CurveId curveId()
Definition lime_keys.hpp:87