pub trait LwePublicKeyGenerationEngine<SecretKey, PublicKey>: AbstractEnginewhere
SecretKey: LweSecretKeyEntity,
PublicKey: LwePublicKeyEntity,{
fn generate_new_lwe_public_key(
&mut self,
lwe_secret_key: &SecretKey,
noise: Variance,
lwe_public_key_zero_encryption_count: LwePublicKeyZeroEncryptionCount
) -> Result<PublicKey, LwePublicKeyGenerationError<Self::EngineError>>;
unsafe fn generate_new_lwe_public_key_unchecked(
&mut self,
lwe_secret_key: &SecretKey,
noise: Variance,
lwe_public_key_zero_encryption_count: LwePublicKeyZeroEncryptionCount
) -> PublicKey;
}
Expand description
A trait for engines generating new LWE public keys.
Semantics
This pure operation generates a new LWE public key.
Formal Definition
cf here
Required Methods
sourcefn generate_new_lwe_public_key(
&mut self,
lwe_secret_key: &SecretKey,
noise: Variance,
lwe_public_key_zero_encryption_count: LwePublicKeyZeroEncryptionCount
) -> Result<PublicKey, LwePublicKeyGenerationError<Self::EngineError>>
fn generate_new_lwe_public_key(
&mut self,
lwe_secret_key: &SecretKey,
noise: Variance,
lwe_public_key_zero_encryption_count: LwePublicKeyZeroEncryptionCount
) -> Result<PublicKey, LwePublicKeyGenerationError<Self::EngineError>>
Generates a new LWE public key.
sourceunsafe fn generate_new_lwe_public_key_unchecked(
&mut self,
lwe_secret_key: &SecretKey,
noise: Variance,
lwe_public_key_zero_encryption_count: LwePublicKeyZeroEncryptionCount
) -> PublicKey
unsafe fn generate_new_lwe_public_key_unchecked(
&mut self,
lwe_secret_key: &SecretKey,
noise: Variance,
lwe_public_key_zero_encryption_count: LwePublicKeyZeroEncryptionCount
) -> PublicKey
Unsafely generates a new LWE public key.
Safety
For the general safety concerns regarding this operation, refer to the different variants
of LwePublicKeyGenerationError
. For safety concerns specific to an
engine, refer to the implementer safety section.
Implementors
impl LwePublicKeyGenerationEngine<LweSecretKey32, LwePublicKey32> for DefaultEngine
Description:
Implementation of LwePublicKeyGenerationEngine
for DefaultEngine
that operates on
32 bits integers.
impl LwePublicKeyGenerationEngine<LweSecretKey32, LwePublicKey32> for DefaultParallelEngine
Description:
Implementation of LwePublicKeyGenerationEngine
for DefaultParallelEngine
that operates
on 32 bits integers.
impl LwePublicKeyGenerationEngine<LweSecretKey64, LwePublicKey64> for DefaultEngine
Description:
Implementation of LwePublicKeyGenerationEngine
for DefaultEngine
that operates on
64 bits integers.
impl LwePublicKeyGenerationEngine<LweSecretKey64, LwePublicKey64> for DefaultParallelEngine
Description:
Implementation of LwePublicKeyGenerationEngine
for DefaultParallelEngine
that operates
on 64 bits integers.