Trait SphinxSuite

Source
pub trait SphinxSuite {
    type P: Keypair;
    type E: Scalar + for<'a> From<&'a Self::P>;
    type G: GroupElement<Self::E> + for<'a> From<&'a <Self::P as Keypair>::Public>;
    type PRP: StreamCipher + KeyIvInit;

    // Provided methods
    fn new_shared_keys(
        public_keys: &[<Self::P as Keypair>::Public],
    ) -> Result<SharedKeys<Self::E, Self::G>> { ... }
    fn new_prp_init(secret: &SecretKey) -> Result<IvKey<Self::PRP>> { ... }
    fn new_reply_prp_init(
        secret: &SecretKey16,
        salt: &[u8],
    ) -> Result<IvKey<Self::PRP>> { ... }
}
Expand description

Represents an instantiation of the Spinx protocol using the given EC group and corresponding public key object.

Required Associated Types§

Source

type P: Keypair

Keypair corresponding to the EC group

Source

type E: Scalar + for<'a> From<&'a Self::P>

Scalar type supported by the EC group

Source

type G: GroupElement<Self::E> + for<'a> From<&'a <Self::P as Keypair>::Public>

EC group element

Source

type PRP: StreamCipher + KeyIvInit

Pseudo-Random Permutation used to encrypt and decrypt packet payload

Provided Methods§

Source

fn new_shared_keys( public_keys: &[<Self::P as Keypair>::Public], ) -> Result<SharedKeys<Self::E, Self::G>>

Convenience function to generate shared keys from the path of public keys.

Source

fn new_prp_init(secret: &SecretKey) -> Result<IvKey<Self::PRP>>

Instantiates a new Pseudo-Random Permutation IV and key for general packet data.

Source

fn new_reply_prp_init( secret: &SecretKey16, salt: &[u8], ) -> Result<IvKey<Self::PRP>>

Instantiates a new Pseudo-Random Permutation IV and key for reply data.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl SphinxSuite for X25519Suite

Source§

type E = Scalar

Source§

type G = MontgomeryPoint

Source§

type P = OffchainKeypair

Source§

type PRP = StreamCipherCoreWrapper<ChaChaCore<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>>