Skip to main content

Recrypt480

Struct Recrypt480 

pub struct Recrypt480<H, S, R> { /* private fields */ }
Expand description

Recrypt public API - 480-bit If you are looking better performance, you might consider the 256-bit API in api.rs

Implementations§

§

impl Recrypt480<Sha256, Ed25519, RandomBytes<DefaultRng>>

pub fn new() -> Recrypt480<Sha256, Ed25519, RandomBytes<DefaultRng>>

Construct a new Recrypt480 with pre-selected CSPRNG implementation.

The RNG will periodically reseed itself from the system’s best entropy source.

§

impl<CR: CryptoRng> Recrypt480<Sha256, Ed25519, RandomBytes<CR>>

pub fn new_with_rand(r: CR) -> Recrypt480<Sha256, Ed25519, RandomBytes<CR>>

Construct a Recrypt480 with the given RNG. Unless you have specific needs using new() is recommended.

Trait Implementations§

§

impl<R: RandomBytesGen, H: Sha256Hashing, S: Ed25519Signing> CryptoOps for Recrypt480<H, S, R>

§

fn gen_plaintext(&self) -> Plaintext

Using the random_bytes, generate a random element of G_T, which is one of the rth roots of unity in FP12. Read more
§

fn derive_symmetric_key( &self, decrypted_value: &Plaintext, ) -> DerivedSymmetricKey

Convert our plaintext into a DecryptedSymmetricKey by hashing it. Typically you either use derive_private_key or derive_symmetric_key but not both.
§

fn derive_private_key(&self, plaintext: &Plaintext) -> PrivateKey

Derive a private key for a plaintext by hashing it twice (with known leading bytes) and modding it by the prime. Typically you either use derive_private_key or derive_symmetric_key but not both.
§

fn encrypt( &self, plaintext: &Plaintext, to_public_key: &PublicKey, signing_keypair: &SigningKeypair, ) -> Result<EncryptedValue, RecryptErr>

Encrypt the plaintext to the to_public_key. Read more
§

fn decrypt( &self, encrypted_value: EncryptedValue, private_key: &PrivateKey, ) -> Result<Plaintext, RecryptErr>

Decrypt the value using private_key. Read more
§

fn transform( &self, encrypted_value: EncryptedValue, transform_key: TransformKey, signing_keypair: &SigningKeypair, ) -> Result<EncryptedValue, RecryptErr>

Transform the value encrypted_value using the transform_key. The returned value can be decrypted by the private key associated to the to_public_key in the transform_key. Read more
§

impl<H: Debug, S: Debug, R: Debug> Debug for Recrypt480<H, S, R>

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl Default for Recrypt480<Sha256, Ed25519, RandomBytes<DefaultRng>>

§

fn default() -> Self

Returns the “default value” for a type. Read more
§

impl<H, S, CR: CryptoRng> Ed25519Ops for Recrypt480<H, S, RandomBytes<CR>>

§

fn generate_ed25519_key_pair(&self) -> SigningKeypair

Generate a signing key pair for use with the Ed25519Signing trait using the random number generator used to back the RandomBytes struct.

§

impl<R: RandomBytesGen, H: Sha256Hashing, S: Ed25519Signing> KeyGenOps for Recrypt480<H, S, R>

§

fn compute_public_key( &self, private_key: &PrivateKey, ) -> Result<PublicKey, RecryptErr>

Compute a PublicKey given a PrivateKey
§

fn random_private_key(&self) -> PrivateKey

Generate a random private key. Read more
§

fn generate_key_pair(&self) -> Result<(PrivateKey, PublicKey), RecryptErr>

Generate a public/private keypair. Read more
§

fn generate_transform_key( &self, from_private_key: &PrivateKey, to_public_key: &PublicKey, signing_keypair: &SigningKeypair, ) -> Result<TransformKey, RecryptErr>

Generate a transform key which is used to delegate to the to_public_key from the from_private_key. Read more
§

impl<H: Sha256Hashing, S, CR: CryptoRng> SchnorrOps for Recrypt480<H, S, RandomBytes<CR>>

§

fn schnorr_sign<A: Hashable>( &self, priv_key: &PrivateKey, pub_key: &PublicKey, message: &A, ) -> SchnorrSignature

Create a signature for the message using priv_key. Read more
§

fn schnorr_verify<A: Hashable>( &self, pub_key: &PublicKey, augmenting_priv_key: Option<&PrivateKey>, message: &A, signature: SchnorrSignature, ) -> bool

Verify that the message was signed by the matching private key to pub_key. Note that if pub_key was augmented the private key used in the augmentation should be passed in as augmenting_priv_key. Read more

Auto Trait Implementations§

§

impl<H, S, R> Freeze for Recrypt480<H, S, R>
where R: Freeze, H: Freeze, S: Freeze,

§

impl<H, S, R> RefUnwindSafe for Recrypt480<H, S, R>

§

impl<H, S, R> Send for Recrypt480<H, S, R>
where R: Send, H: Send, S: Send,

§

impl<H, S, R> Sync for Recrypt480<H, S, R>
where R: Sync, H: Sync, S: Sync,

§

impl<H, S, R> Unpin for Recrypt480<H, S, R>
where R: Unpin, H: Unpin, S: Unpin,

§

impl<H, S, R> UnsafeUnpin for Recrypt480<H, S, R>

§

impl<H, S, R> UnwindSafe for Recrypt480<H, S, R>
where R: UnwindSafe, H: UnwindSafe, S: 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> 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> Clear for T

Source§

fn clear(&mut self)

Completely overwrites this value.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> InitializableFromZeroed for T
where T: Default,

Source§

unsafe fn initialize(place: *mut T)

Called to initialize a place to a valid value, after it is set to all-bits-zero. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V