pub struct EcElGamal;Expand description
Stateless EC-ElGamal helper.
Implementations§
Source§impl EcElGamal
impl EcElGamal
Sourcepub fn encrypt<P, const LIMBS: usize>(
base_point: &P,
recipient_public: &P,
message: &P,
ephemeral_secret: &SecretScalar<LIMBS>,
curve: &P::Curve,
) -> Option<Ciphertext<P>>where
P: PointAdd,
pub fn encrypt<P, const LIMBS: usize>(
base_point: &P,
recipient_public: &P,
message: &P,
ephemeral_secret: &SecretScalar<LIMBS>,
curve: &P::Curve,
) -> Option<Ciphertext<P>>where
P: PointAdd,
Encrypt a point message using a recipient public key and an
application-provided ephemeral scalar.
Sourcepub fn decrypt<P, const LIMBS: usize>(
recipient_secret: &SecretScalar<LIMBS>,
ciphertext: &Ciphertext<P>,
curve: &P::Curve,
) -> Pwhere
P: PointAdd,
pub fn decrypt<P, const LIMBS: usize>(
recipient_secret: &SecretScalar<LIMBS>,
ciphertext: &Ciphertext<P>,
curve: &P::Curve,
) -> Pwhere
P: PointAdd,
Decrypt an ElGamal ciphertext back to the original point message.
Auto Trait Implementations§
impl Freeze for EcElGamal
impl RefUnwindSafe for EcElGamal
impl Send for EcElGamal
impl Sync for EcElGamal
impl Unpin for EcElGamal
impl UnsafeUnpin for EcElGamal
impl UnwindSafe for EcElGamal
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