pub struct PackingKeys<'a> {
pub kg_body: PolyMatrixNTT<'a>,
pub kh_body: PolyMatrixNTT<'a>,
}Expand description
Secret-dependent packing-key upload.
The fixed top rows/masks are derived by both client and server from
REFERENCE_W_SEED and REFERENCE_V_SEED. The client uploads only these
body rows, matching the reference PackingKeys split.
Fields§
§kg_body: PolyMatrixNTT<'a>Body row for the tau_g switching key.
kh_body: PolyMatrixNTT<'a>Body row for the final tau_h switching key.
Implementations§
Source§impl<'a> PackingKeys<'a>
impl<'a> PackingKeys<'a>
Sourcepub fn generate_full(
params: &'a RlweParams,
secret_ntt: &PolyMatrixNTT<'a>,
rng: &mut ChaCha20Rng,
) -> Self
pub fn generate_full( params: &'a RlweParams, secret_ntt: &PolyMatrixNTT<'a>, rng: &mut ChaCha20Rng, ) -> Self
Generate full packing keys from a fresh secret.
Sourcepub fn to_key_pair(
&self,
params: &'a RlweParams,
) -> Result<(KeySwitchingMatrix<'a>, KeySwitchingMatrix<'a>), InspiringError>
pub fn to_key_pair( &self, params: &'a RlweParams, ) -> Result<(KeySwitchingMatrix<'a>, KeySwitchingMatrix<'a>), InspiringError>
Convert uploaded bodies into full key-switching matrices by restoring the fixed public mask rows.
Sourcepub fn validate(&self, params: &RlweParams) -> Result<(), InspiringError>
pub fn validate(&self, params: &RlweParams) -> Result<(), InspiringError>
Validate that uploaded packing-key bodies match the reference wire shape.
Auto Trait Implementations§
impl<'a> Freeze for PackingKeys<'a>
impl<'a> RefUnwindSafe for PackingKeys<'a>
impl<'a> Send for PackingKeys<'a>
impl<'a> Sync for PackingKeys<'a>
impl<'a> Unpin for PackingKeys<'a>
impl<'a> UnsafeUnpin for PackingKeys<'a>
impl<'a> UnwindSafe for PackingKeys<'a>
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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