mirror of
https://github.com/zama-ai/tfhe-rs.git
synced 2026-01-09 14:47:56 -05:00
feat(hlapi): keys can be derefed into their underlying keys
This commit is contained in:
committed by
Thibault Balenbois
parent
8ae799c477
commit
7426e441ba
@@ -73,6 +73,13 @@ impl ClientKey {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "integer")]
|
||||
impl AsRef<crate::integer::ClientKey> for ClientKey {
|
||||
fn as_ref(&self) -> &crate::integer::ClientKey {
|
||||
self.integer_key.key.as_ref().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
/// Trait to be implemented on the client key types that have a corresponding member
|
||||
/// in the `ClientKeyChain`.
|
||||
///
|
||||
|
||||
@@ -43,6 +43,13 @@ impl ServerKey {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "integer")]
|
||||
impl AsRef<crate::integer::ServerKey> for ServerKey {
|
||||
fn as_ref(&self) -> &crate::integer::ServerKey {
|
||||
self.integer_key.key.as_ref().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
// By default, serde does not derives Serialize/Deserialize for `Rc` and `Arc` types
|
||||
// as they can result in mutiple copies, since serializing has to serialize the actual data
|
||||
// not the pointer.
|
||||
|
||||
Reference in New Issue
Block a user