1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
//! Global constants that are part of the API (i.e. array sizes)

#[cfg(feature = "kem")]
use kem::generic_array::typenum;

#[cfg(any(feature = "mceliece348864", feature = "mceliece348864f"))]
/// The number of bytes required to store the public key
pub const CRYPTO_PUBLICKEYBYTES: usize = 261120;
#[cfg(any(feature = "mceliece348864", feature = "mceliece348864f"))]
/// The number of bytes required to store the secret key
pub const CRYPTO_SECRETKEYBYTES: usize = 6492;
#[cfg(any(feature = "mceliece348864", feature = "mceliece348864f"))]
/// The number of bytes required to store the ciphertext resulting from the encryption
pub const CRYPTO_CIPHERTEXTBYTES: usize = 128;

#[cfg(all(
    feature = "kem",
    any(feature = "mceliece348864", feature = "mceliece348864f")
))]
/// The number of bytes required to store the ciphertext resulting from the encryption, as a typenum
pub type CryptoCiphertextBytesTypenum = typenum::U128;

#[cfg(feature = "mceliece348864")]
/// Name of the variant
pub const CRYPTO_PRIMITIVE: &str = "mceliece348864";
#[cfg(feature = "mceliece348864f")]
/// Name of the variant
pub const CRYPTO_PRIMITIVE: &str = "mceliece348864f";

#[cfg(any(feature = "mceliece460896", feature = "mceliece460896f"))]
/// The number of bytes required to store the public key
pub const CRYPTO_PUBLICKEYBYTES: usize = 524160;
#[cfg(any(feature = "mceliece460896", feature = "mceliece460896f"))]
/// The number of bytes required to store the secret key
pub const CRYPTO_SECRETKEYBYTES: usize = 13608;
#[cfg(any(feature = "mceliece460896", feature = "mceliece460896f"))]
/// The number of bytes required to store the ciphertext resulting from the encryption
pub const CRYPTO_CIPHERTEXTBYTES: usize = 188;
#[cfg(all(
    feature = "kem",
    any(feature = "mceliece460896", feature = "mceliece460896f")
))]
/// The number of bytes required to store the ciphertext resulting from the encryption, as a typenum
pub type CryptoCiphertextBytesTypenum = typenum::U188;

#[cfg(feature = "mceliece460896")]
/// Name of the variant
pub const CRYPTO_PRIMITIVE: &str = "mceliece460896";
#[cfg(feature = "mceliece460896f")]
/// Name of the variant
pub const CRYPTO_PRIMITIVE: &str = "mceliece460896f";

#[cfg(any(feature = "mceliece6688128", feature = "mceliece6688128f"))]
/// The number of bytes required to store the public key
pub const CRYPTO_PUBLICKEYBYTES: usize = 1044992;
#[cfg(any(feature = "mceliece6688128", feature = "mceliece6688128f"))]
/// The number of bytes required to store the secret key
pub const CRYPTO_SECRETKEYBYTES: usize = 13932;
#[cfg(any(feature = "mceliece6688128", feature = "mceliece6688128f"))]
/// The number of bytes required to store the ciphertext resulting from the encryption
pub const CRYPTO_CIPHERTEXTBYTES: usize = 240;
#[cfg(all(
    feature = "kem",
    any(feature = "mceliece6688128", feature = "mceliece6688128f")
))]
/// The number of bytes required to store the ciphertext resulting from the encryption, as a typenum
pub type CryptoCiphertextBytesTypenum = typenum::U240;

#[cfg(feature = "mceliece6688128")]
/// Name of the variant
pub const CRYPTO_PRIMITIVE: &str = "mceliece6688128";
#[cfg(feature = "mceliece6688128f")]
/// Name of the variant
pub const CRYPTO_PRIMITIVE: &str = "mceliece6688128f";

#[cfg(any(feature = "mceliece6960119", feature = "mceliece6960119f"))]
/// The number of bytes required to store the public key
pub const CRYPTO_PUBLICKEYBYTES: usize = 1047319;
#[cfg(any(feature = "mceliece6960119", feature = "mceliece6960119f"))]
/// The number of bytes required to store the secret key
pub const CRYPTO_SECRETKEYBYTES: usize = 13948;
#[cfg(any(feature = "mceliece6960119", feature = "mceliece6960119f"))]
/// The number of bytes required to store the ciphertext resulting from the encryption
pub const CRYPTO_CIPHERTEXTBYTES: usize = 226;
#[cfg(all(
    feature = "kem",
    any(feature = "mceliece6960119", feature = "mceliece6960119f")
))]
/// The number of bytes required to store the ciphertext resulting from the encryption, as a typenum
pub type CryptoCiphertextBytesTypenum = typenum::U226;

#[cfg(feature = "mceliece6960119")]
/// Name of the variant
pub const CRYPTO_PRIMITIVE: &str = "mceliece6960119";
#[cfg(feature = "mceliece6960119f")]
/// Name of the variant
pub const CRYPTO_PRIMITIVE: &str = "mceliece6960119f";

#[cfg(any(feature = "mceliece8192128", feature = "mceliece8192128f"))]
/// The number of bytes required to store the public key
pub const CRYPTO_PUBLICKEYBYTES: usize = 1357824;
#[cfg(any(feature = "mceliece8192128", feature = "mceliece8192128f"))]
/// The number of bytes required to store the secret key
pub const CRYPTO_SECRETKEYBYTES: usize = 14120;
#[cfg(any(feature = "mceliece8192128", feature = "mceliece8192128f"))]
/// The number of bytes required to store the ciphertext resulting from the encryption
pub const CRYPTO_CIPHERTEXTBYTES: usize = 240;
#[cfg(all(
    feature = "kem",
    any(feature = "mceliece8192128", feature = "mceliece8192128f")
))]
/// The number of bytes required to store the ciphertext resulting from the encryption, as a typenum
pub type CryptoCiphertextBytesTypenum = typenum::U240;

#[cfg(feature = "mceliece8192128")]
/// Name of the variant
pub const CRYPTO_PRIMITIVE: &str = "mceliece8192128";
#[cfg(feature = "mceliece8192128f")]
/// Name of the variant
pub const CRYPTO_PRIMITIVE: &str = "mceliece8192128f";

/// The number of bytes required to store the shared secret negotiated between both parties
// this value is uniform
pub const CRYPTO_BYTES: usize = 32;