@@ -9,160 +9,6 @@ pub struct HpkeAlgorithm {
99 #[ prost( enumeration = "AeadAlgorithm" , tag = "3" ) ]
1010 pub aead : i32 ,
1111}
12- /// Key Encapsulation Mechanism (KEM)
13- #[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , PartialOrd , Ord , :: prost:: Enumeration ) ]
14- #[ repr( i32 ) ]
15- pub enum KemAlgorithm {
16- Unspecified = 0 ,
17- DhkemX25519HkdfSha256 = 1 ,
18- }
19- impl KemAlgorithm {
20- /// String value of the enum field names used in the ProtoBuf definition.
21- ///
22- /// The values are not transformed in any way and thus are considered stable
23- /// (if the ProtoBuf definition does not change) and safe for programmatic use.
24- pub fn as_str_name ( & self ) -> & ' static str {
25- match self {
26- Self :: Unspecified => "KEM_ALGORITHM_UNSPECIFIED" ,
27- Self :: DhkemX25519HkdfSha256 => "KEM_ALGORITHM_DHKEM_X25519_HKDF_SHA256" ,
28- }
29- }
30- /// Creates an enum from field names used in the ProtoBuf definition.
31- pub fn from_str_name ( value : & str ) -> :: core:: option:: Option < Self > {
32- match value {
33- "KEM_ALGORITHM_UNSPECIFIED" => Some ( Self :: Unspecified ) ,
34- "KEM_ALGORITHM_DHKEM_X25519_HKDF_SHA256" => Some ( Self :: DhkemX25519HkdfSha256 ) ,
35- _ => None ,
36- }
37- }
38- }
39- /// Key Derivation Function (KDF)
40- #[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , PartialOrd , Ord , :: prost:: Enumeration ) ]
41- #[ repr( i32 ) ]
42- pub enum KdfAlgorithm {
43- Unspecified = 0 ,
44- HkdfSha256 = 1 ,
45- }
46- impl KdfAlgorithm {
47- /// String value of the enum field names used in the ProtoBuf definition.
48- ///
49- /// The values are not transformed in any way and thus are considered stable
50- /// (if the ProtoBuf definition does not change) and safe for programmatic use.
51- pub fn as_str_name ( & self ) -> & ' static str {
52- match self {
53- Self :: Unspecified => "KDF_ALGORITHM_UNSPECIFIED" ,
54- Self :: HkdfSha256 => "KDF_ALGORITHM_HKDF_SHA256" ,
55- }
56- }
57- /// Creates an enum from field names used in the ProtoBuf definition.
58- pub fn from_str_name ( value : & str ) -> :: core:: option:: Option < Self > {
59- match value {
60- "KDF_ALGORITHM_UNSPECIFIED" => Some ( Self :: Unspecified ) ,
61- "KDF_ALGORITHM_HKDF_SHA256" => Some ( Self :: HkdfSha256 ) ,
62- _ => None ,
63- }
64- }
65- }
66- /// Authenticated Encryption with Associated Data (AEAD)
67- #[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , PartialOrd , Ord , :: prost:: Enumeration ) ]
68- #[ repr( i32 ) ]
69- pub enum AeadAlgorithm {
70- Unspecified = 0 ,
71- Aes256Gcm = 1 ,
72- }
73- impl AeadAlgorithm {
74- /// String value of the enum field names used in the ProtoBuf definition.
75- ///
76- /// The values are not transformed in any way and thus are considered stable
77- /// (if the ProtoBuf definition does not change) and safe for programmatic use.
78- pub fn as_str_name ( & self ) -> & ' static str {
79- match self {
80- Self :: Unspecified => "AEAD_ALGORITHM_UNSPECIFIED" ,
81- Self :: Aes256Gcm => "AEAD_ALGORITHM_AES_256_GCM" ,
82- }
83- }
84- /// Creates an enum from field names used in the ProtoBuf definition.
85- pub fn from_str_name ( value : & str ) -> :: core:: option:: Option < Self > {
86- match value {
87- "AEAD_ALGORITHM_UNSPECIFIED" => Some ( Self :: Unspecified ) ,
88- "AEAD_ALGORITHM_AES_256_GCM" => Some ( Self :: Aes256Gcm ) ,
89- _ => None ,
90- }
91- }
92- }
93- #[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , PartialOrd , Ord , :: prost:: Enumeration ) ]
94- #[ repr( i32 ) ]
95- pub enum Status {
96- Unspecified = 0 ,
97- Success = 1 ,
98- InternalError = 2 ,
99- InvalidArgument = 3 ,
100- NotFound = 4 ,
101- AlreadyExists = 5 ,
102- PermissionDenied = 6 ,
103- Unauthenticated = 7 ,
104- UnsupportedAlgorithm = 8 ,
105- InvalidKey = 9 ,
106- CryptoError = 10 ,
107- DecryptionFailure = 11 ,
108- EncryptionFailure = 12 ,
109- DecapsulationFailure = 13 ,
110- }
111- impl Status {
112- /// String value of the enum field names used in the ProtoBuf definition.
113- ///
114- /// The values are not transformed in any way and thus are considered stable
115- /// (if the ProtoBuf definition does not change) and safe for programmatic use.
116- pub fn as_str_name ( & self ) -> & ' static str {
117- match self {
118- Self :: Unspecified => "STATUS_UNSPECIFIED" ,
119- Self :: Success => "STATUS_SUCCESS" ,
120- Self :: InternalError => "STATUS_INTERNAL_ERROR" ,
121- Self :: InvalidArgument => "STATUS_INVALID_ARGUMENT" ,
122- Self :: NotFound => "STATUS_NOT_FOUND" ,
123- Self :: AlreadyExists => "STATUS_ALREADY_EXISTS" ,
124- Self :: PermissionDenied => "STATUS_PERMISSION_DENIED" ,
125- Self :: Unauthenticated => "STATUS_UNAUTHENTICATED" ,
126- Self :: UnsupportedAlgorithm => "STATUS_UNSUPPORTED_ALGORITHM" ,
127- Self :: InvalidKey => "STATUS_INVALID_KEY" ,
128- Self :: CryptoError => "STATUS_CRYPTO_ERROR" ,
129- Self :: DecryptionFailure => "STATUS_DECRYPTION_FAILURE" ,
130- Self :: EncryptionFailure => "STATUS_ENCRYPTION_FAILURE" ,
131- Self :: DecapsulationFailure => "STATUS_DECAPSULATION_FAILURE" ,
132- }
133- }
134- /// Creates an enum from field names used in the ProtoBuf definition.
135- pub fn from_str_name ( value : & str ) -> :: core:: option:: Option < Self > {
136- match value {
137- "STATUS_UNSPECIFIED" => Some ( Self :: Unspecified ) ,
138- "STATUS_SUCCESS" => Some ( Self :: Success ) ,
139- "STATUS_INTERNAL_ERROR" => Some ( Self :: InternalError ) ,
140- "STATUS_INVALID_ARGUMENT" => Some ( Self :: InvalidArgument ) ,
141- "STATUS_NOT_FOUND" => Some ( Self :: NotFound ) ,
142- "STATUS_ALREADY_EXISTS" => Some ( Self :: AlreadyExists ) ,
143- "STATUS_PERMISSION_DENIED" => Some ( Self :: PermissionDenied ) ,
144- "STATUS_UNAUTHENTICATED" => Some ( Self :: Unauthenticated ) ,
145- "STATUS_UNSUPPORTED_ALGORITHM" => Some ( Self :: UnsupportedAlgorithm ) ,
146- "STATUS_INVALID_KEY" => Some ( Self :: InvalidKey ) ,
147- "STATUS_CRYPTO_ERROR" => Some ( Self :: CryptoError ) ,
148- "STATUS_DECRYPTION_FAILURE" => Some ( Self :: DecryptionFailure ) ,
149- "STATUS_ENCRYPTION_FAILURE" => Some ( Self :: EncryptionFailure ) ,
150- "STATUS_DECAPSULATION_FAILURE" => Some ( Self :: DecapsulationFailure ) ,
151- _ => None ,
152- }
153- }
154- }
155- // This file is @generated by prost-build.
156- /// Composite HPKE Algorithm suite
157- #[ derive( Clone , Copy , PartialEq , :: prost:: Message ) ]
158- pub struct HpkeAlgorithm {
159- #[ prost( enumeration = "KemAlgorithm" , tag = "1" ) ]
160- pub kem : i32 ,
161- #[ prost( enumeration = "KdfAlgorithm" , tag = "2" ) ]
162- pub kdf : i32 ,
163- #[ prost( enumeration = "AeadAlgorithm" , tag = "3" ) ]
164- pub aead : i32 ,
165- }
16612/// Specifies parameters for a particular algorithm type.
16713#[ derive( Clone , Copy , PartialEq , :: prost:: Message ) ]
16814pub struct AlgorithmParams {
@@ -173,7 +19,7 @@ pub struct AlgorithmParams {
17319pub mod algorithm_params {
17420 #[ derive( Clone , Copy , PartialEq , :: prost:: Oneof ) ]
17521 pub enum Params {
176- /// KEM algorithm identifier (e.g., DHKEM_X25519_HKDF_SHA256 ).
22+ /// KEM algorithm identifier (e.g., KEM_ALGORITHM_DHKEM_X25519_HKDF_SHA256 ).
17723 #[ prost( enumeration = "super::KemAlgorithm" , tag = "1" ) ]
17824 KemId ( i32 ) ,
17925 }
0 commit comments