pub struct PublicKey {
pub public_key: WithContext<PublicKey>,
pub galois_key: Option<WithContext<GaloisKeys>>,
pub relin_key: Option<WithContext<RelinearizationKeys>>,
}Expand description
A bundle of public keys. These may be freely shared with other parties without risk of compromising data security.
§Remarks
In traditional asymmetric cryptography (e.g. RSA, ECC), schemes contain only public and private keys. The public key is used for encryption and the private key is used to decrypt data.
In addition to the tradtional public key, homomorphic cryptographic schemes may have
additional keys to facilitate certain homomorphic operations. These keys are “public”
in the sense that they may be freely shared without compromising data privacy, but
they are generally used for operations other than encryption. For example,
RelinearizationKeys are used in the BFV and CKKS schemes to reduce noise growth
and prevent ciphertext size growth after multiplication.
Fields§
§public_key: WithContext<PublicKey>The public key used for encryption operations.
galois_key: Option<WithContext<GaloisKeys>>Galois keys are used in BFV and CKKS schemes to rotate Batched vectors.
FhePrograms that don’t feature rotations have no use for these keys.
relin_key: Option<WithContext<RelinearizationKeys>>Relinearization keys are used in the BFV and CKKS schemes during relinearization operations. Relinearization reduces noise growth and prevents ciphertext size growth resulting from multiplication. Sunscreen automatically inserts relinearization operations, and hence they are an implementation detail.
FhePrograms without multiplications don’t have relinearizations and thus don’t need these keys.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for PublicKey
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more