Skip to content

Commit

Permalink
feat(core_crypto): impl Named for LweSecretKey and GlweSecretKey
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarlin-zama committed Oct 10, 2024
1 parent f244102 commit 62100bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tfhe/src/core_crypto/entities/glwe_secret_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use crate::core_crypto::commons::math::random::{RandomGenerable, UniformBinary};
use crate::core_crypto::commons::parameters::*;
use crate::core_crypto::commons::traits::*;
use crate::core_crypto::entities::*;
use crate::named::Named;

/// A [`GLWE secret key`](`GlweSecretKey`)
///
Expand All @@ -28,6 +29,10 @@ pub struct GlweSecretKey<C: Container> {
polynomial_size: PolynomialSize,
}

impl<C: Container> Named for GlweSecretKey<C> {
const NAME: &'static str = "core_crypto::GlweSecretKey";
}

impl<T, C: Container<Element = T>> AsRef<[T]> for GlweSecretKey<C> {
fn as_ref(&self) -> &[T] {
self.data.as_ref()
Expand Down
5 changes: 5 additions & 0 deletions tfhe/src/core_crypto/entities/lwe_secret_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use crate::core_crypto::commons::generators::SecretRandomGenerator;
use crate::core_crypto::commons::math::random::{RandomGenerable, UniformBinary};
use crate::core_crypto::commons::parameters::LweDimension;
use crate::core_crypto::commons::traits::*;
use crate::named::Named;

/// An [`LWE secret key`](`LweSecretKey`).
///
Expand All @@ -25,6 +26,10 @@ pub struct LweSecretKey<C: Container> {
data: C,
}

impl<C: Container> Named for LweSecretKey<C> {
const NAME: &'static str = "core_crypto::LweSecretKey";
}

impl<T, C: Container<Element = T>> AsRef<[T]> for LweSecretKey<C> {
fn as_ref(&self) -> &[T] {
self.data.as_ref()
Expand Down

0 comments on commit 62100bd

Please sign in to comment.