@@ -245,6 +245,58 @@ pub trait P256: CryptoClient {
245245 }
246246}
247247
248+ #[ cfg( feature = "p384" ) ]
249+ impl < S : Syscall > P384 for ClientImplementation < S > { }
250+
251+ pub trait P384 : CryptoClient {
252+ fn generate_p384_private_key ( & mut self , persistence : Location )
253+ -> ClientResult < ' _ , reply:: GenerateKey , Self >
254+ {
255+ self . generate_key ( Mechanism :: P384 , StorageAttributes :: new ( ) . set_persistence ( persistence) )
256+ }
257+
258+ fn derive_p384_public_key ( & mut self , private_key : KeyId , persistence : Location )
259+ -> ClientResult < ' _ , reply:: DeriveKey , Self >
260+ {
261+ self . derive_key ( Mechanism :: P384 , private_key, None , StorageAttributes :: new ( ) . set_persistence ( persistence) )
262+ }
263+
264+ fn deserialize_p384_key < ' c > ( & ' c mut self , serialized_key : & [ u8 ] , format : KeySerialization , attributes : StorageAttributes )
265+ -> ClientResult < ' c , reply:: DeserializeKey , Self >
266+ {
267+ self . deserialize_key ( Mechanism :: P384 , serialized_key, format, attributes)
268+ }
269+
270+ fn serialize_p384_key ( & mut self , key : KeyId , format : KeySerialization )
271+ -> ClientResult < ' _ , reply:: SerializeKey , Self >
272+ {
273+ self . serialize_key ( Mechanism :: P384 , key, format)
274+ }
275+
276+ fn sign_p384 < ' c > ( & ' c mut self , key : KeyId , message : & [ u8 ] , format : SignatureSerialization )
277+ -> ClientResult < ' c , reply:: Sign , Self >
278+ {
279+ self . sign ( Mechanism :: P384 , key, message, format)
280+ }
281+
282+ fn verify_p384 < ' c > ( & ' c mut self , key : KeyId , message : & [ u8 ] , signature : & [ u8 ] )
283+ -> ClientResult < ' c , reply:: Verify , Self >
284+ {
285+ self . verify ( Mechanism :: P384 , key, message, signature, SignatureSerialization :: Raw )
286+ }
287+
288+ fn agree_p384 ( & mut self , private_key : KeyId , public_key : KeyId , persistence : Location )
289+ -> ClientResult < ' _ , reply:: Agree , Self >
290+ {
291+ self . agree (
292+ Mechanism :: P384 ,
293+ private_key,
294+ public_key,
295+ StorageAttributes :: new ( ) . set_persistence ( persistence) ,
296+ )
297+ }
298+ }
299+
248300#[ cfg( feature = "sha256" ) ]
249301impl < S : Syscall > Sha256 for ClientImplementation < S > { }
250302
0 commit comments