PKE

Struct PKE 

Source
pub struct PKE<K> {
    pub isogenies: CurveIsogenies<K>,
    /* private fields */
}
Expand description

Public-key cryptosystem (ref Algorithm 1, Section 1.3.9)

Fields§

§isogenies: CurveIsogenies<K>

Instance of the SIKE problem for this PKE

Implementations§

Source§

impl<K: FiniteField + Clone + Debug> PKE<K>

Source

pub fn setup(params: PublicParameters<K>) -> Self

Initialise cryptosystem with parameters params

Source

pub fn gen(&self) -> Result<(SecretKey, PublicKey<K>), String>

Generate a keypair

Source

pub fn enc(&self, pk: &PublicKey<K>, m: Message) -> Result<Ciphertext, String>

Encrypt a message

Source

pub fn dec(&self, sk: &SecretKey, c: Ciphertext) -> Result<Message, String>

Decrypts a message

Source

pub fn hash_function_f(&self, j: K) -> Vec<u8>

Computes the F function

Source

pub fn xor(input1: &[u8], input2: &[u8]) -> Vec<u8>

Computes the bitwise XOR between two sequences

Auto Trait Implementations§

§

impl<K> Freeze for PKE<K>
where K: Freeze,

§

impl<K> RefUnwindSafe for PKE<K>
where K: RefUnwindSafe,

§

impl<K> Send for PKE<K>
where K: Send,

§

impl<K> Sync for PKE<K>
where K: Sync,

§

impl<K> Unpin for PKE<K>
where K: Unpin,

§

impl<K> UnwindSafe for PKE<K>
where K: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.