cypheron_core/kem/
sizes.rs

1// Copyright 2025 Cypheron Labs, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15pub const ML_KEM_512_PUBLIC: usize = 800;
16pub const ML_KEM_512_SECRET: usize = 1632;
17pub const ML_KEM_512_CIPHERTEXT: usize = 768;
18pub const ML_KEM_512_SHARED: usize = 32;
19
20pub const ML_KEM_768_PUBLIC: usize = 1184;
21pub const ML_KEM_768_SECRET: usize = 2400;
22pub const ML_KEM_768_CIPHERTEXT: usize = 1088;
23pub const ML_KEM_768_SHARED: usize = 32;
24
25pub const ML_KEM_1024_PUBLIC: usize = 1568;
26pub const ML_KEM_1024_SECRET: usize = 3168;
27pub const ML_KEM_1024_CIPHERTEXT: usize = 1568;
28pub const ML_KEM_1024_SHARED: usize = 32;
29
30#[deprecated(
31    since = "0.2.0",
32    note = "Use ML_KEM_512_* constants for NIST FIPS 203 compliance"
33)]
34pub const KYBER512_PUBLIC: usize = ML_KEM_512_PUBLIC;
35#[deprecated(
36    since = "0.2.0",
37    note = "Use ML_KEM_512_* constants for NIST FIPS 203 compliance"
38)]
39pub const KYBER512_SECRET: usize = ML_KEM_512_SECRET;
40#[deprecated(
41    since = "0.2.0",
42    note = "Use ML_KEM_512_* constants for NIST FIPS 203 compliance"
43)]
44pub const KYBER512_CIPHERTEXT: usize = ML_KEM_512_CIPHERTEXT;
45#[deprecated(
46    since = "0.2.0",
47    note = "Use ML_KEM_512_* constants for NIST FIPS 203 compliance"
48)]
49pub const KYBER512_SHARED: usize = ML_KEM_512_SHARED;
50
51#[deprecated(
52    since = "0.2.0",
53    note = "Use ML_KEM_768_* constants for NIST FIPS 203 compliance"
54)]
55pub const KYBER768_PUBLIC: usize = ML_KEM_768_PUBLIC;
56#[deprecated(
57    since = "0.2.0",
58    note = "Use ML_KEM_768_* constants for NIST FIPS 203 compliance"
59)]
60pub const KYBER768_SECRET: usize = ML_KEM_768_SECRET;
61#[deprecated(
62    since = "0.2.0",
63    note = "Use ML_KEM_768_* constants for NIST FIPS 203 compliance"
64)]
65pub const KYBER768_CIPHERTEXT: usize = ML_KEM_768_CIPHERTEXT;
66#[deprecated(
67    since = "0.2.0",
68    note = "Use ML_KEM_768_* constants for NIST FIPS 203 compliance"
69)]
70pub const KYBER768_SHARED: usize = ML_KEM_768_SHARED;
71
72#[deprecated(
73    since = "0.2.0",
74    note = "Use ML_KEM_1024_* constants for NIST FIPS 203 compliance"
75)]
76pub const KYBER1024_PUBLIC: usize = ML_KEM_1024_PUBLIC;
77#[deprecated(
78    since = "0.2.0",
79    note = "Use ML_KEM_1024_* constants for NIST FIPS 203 compliance"
80)]
81pub const KYBER1024_SECRET: usize = ML_KEM_1024_SECRET;
82#[deprecated(
83    since = "0.2.0",
84    note = "Use ML_KEM_1024_* constants for NIST FIPS 203 compliance"
85)]
86pub const KYBER1024_CIPHERTEXT: usize = ML_KEM_1024_CIPHERTEXT;
87#[deprecated(
88    since = "0.2.0",
89    note = "Use ML_KEM_1024_* constants for NIST FIPS 203 compliance"
90)]
91pub const KYBER1024_SHARED: usize = ML_KEM_1024_SHARED;