Skip to main content

EmptyCal

Struct EmptyCal 

Source
pub struct EmptyCal;
Expand description

An implementation of Cal that provides no single algorithm.

It implements all the individual traits, as well as the full Cal trait. The former is useful for hardware implementations that don’t touch an area at all; the latter is useful in testing or when an extender is used standalone.

Trait Implementations§

Source§

impl AeadProvider for EmptyCal

Source§

type Algorithm = NoAlgorithms

Source§

type Key = NoAlgorithms

Source§

type Tag = NoAlgorithms

Source§

fn load_from_keydata(&mut self, alg: Self::Algorithm, _key: &[u8]) -> Self::Key

Loads a key from the key’s bytes. Read more
Source§

fn encrypt_in_place( &mut self, key: &Self::Key, _nonce: &[u8], _message: &mut [u8], _aad: impl AadGenerator, ) -> Self::Tag

Encrypts data in place. Read more
Source§

fn decrypt_in_place( &mut self, key: &Self::Key, _nonce: &[u8], _message: &mut [u8], _tag: &[u8], _aad: impl AadGenerator, ) -> Result<(), DecryptionFailed>

Decrypts data in place. Read more
Source§

impl Cal for EmptyCal

Source§

type DhProvider = EmptyCal

The non-supertrait responsible for key establishment.
Source§

type AeadProvider = EmptyCal

Source§

type HashProvider = EmptyCal

Source§

type HmacProvider = EmptyCal

Source§

fn dh(&mut self) -> &mut Self::DhProvider

Source§

fn aead(&mut self) -> &mut Self::AeadProvider

Source§

fn hash(&mut self) -> &mut Self::HashProvider

Source§

fn hmac(&mut self) -> &mut Self::HmacProvider

Source§

impl DhProvider for EmptyCal

Source§

type Algorithm = NoAlgorithms

Source§

type VisibleSecretKey = NoAlgorithms

A secret key that is intended to be exported. Read more
Source§

type SecretKey = NoAlgorithms

Source§

type PublicKey = NoAlgorithms

Source§

type SharedSecret = NoAlgorithms

Source§

fn generate_visible(&mut self, alg: Self::Algorithm) -> Self::VisibleSecretKey

Generates a secret key that is intended to be exported / shared (e.g. to be persisted across program executions).
Source§

fn shared_secret( &mut self, private: &Self::SecretKey, _public: &Self::PublicKey, ) -> Result<Self::SharedSecret, IncompatibleKeys>

Derives a shared secret from a public and a private key. Read more
Source§

fn public_key(&mut self, private: &Self::SecretKey) -> Self::PublicKey

Produces the public key corresponding to a private key.
Source§

fn raw_secret_bytes<'s>( &mut self, secret: &'s Self::SharedSecret, ) -> impl AsRef<[u8]> + use<'s>

Produces the bytes of the shared secret, in the algorithm’s .output_length(). Read more
Source§

fn export_secretkey_bytes<'s>( &mut self, secretkey: &'s Self::VisibleSecretKey, ) -> impl AsRef<[u8]> + use<'s>

Exposes a visible secret key’s secret. Read more
Source§

fn import_secretkey_bytes( &mut self, alg: Self::Algorithm, _secret: &[u8], ) -> Result<Self::VisibleSecretKey, ImportError>

Inverse operation of .export_secretkey_bytes().
Source§

fn export_publickey_bytes<'p>( &mut self, public: &'p Self::PublicKey, ) -> impl AsRef<[u8]> + use<'p>

Exposes a public key’s key data bytes. Read more
Source§

fn import_publickey_bytes( &mut self, alg: Self::Algorithm, _data: &[u8], ) -> Result<Self::PublicKey, ImportError>

Imports a public key in the inverse operation of .export_publickey_bytes().
Source§

fn generate(&mut self, alg: Self::Algorithm) -> Self::SecretKey

Generates a secret key.
Source§

impl Ec for EmptyCal

Source§

const MAX_SCALAR_LENGTH: usize = 0

The longest slice length ever usable with scalar import / export from any of the primitives.
Source§

type PrimitivesP256 = EmptyCal

Source§

type PrimitivesX25519 = EmptyCal

Source§

type PrimitivesX448 = EmptyCal

Source§

fn p256(&mut self) -> &mut Self::PrimitivesP256

Source§

fn x25519(&mut self) -> &mut Self::PrimitivesX25519

Source§

fn x448(&mut self) -> &mut Self::PrimitivesX448

Source§

impl<C: Curve> EcPrimitives<C> for EmptyCal

Source§

const HAS_MULTIPLY_SCALAR_POINT: bool = false

Indicates whether Self::multiply_scalar_point() is available (otherwise it will likely panic).
Source§

type Scalar = NoAlgorithms

Source§

type Point = NoAlgorithms

Source§

fn multiply_scalar_point( &mut self, a: &Self::Scalar, _b: &Self::Point, ) -> Self::Point

Performs a scalar × point multiplication on the curve. Read more
Source§

fn point(&mut self, x: Self::Scalar, _y: Self::Scalar) -> Self::Point

Constructs a point from two scalars. Read more
Source§

fn import_scalar_bytes( &mut self, _scalar: &[u8], ) -> Result<Self::Scalar, ImportError>

Loads byte data into a scalar from the curve’s native format. Read more
Source§

fn export_scalar_bytes<'s>( &mut self, _scalar: &'s Self::Scalar, ) -> impl AsRef<[u8]> + use<'s, C>

Source§

fn x_coord(&mut self, point: &Self::Point) -> Self::Scalar

Accesses the first coordinate of a point.
Source§

fn y_coord(&mut self, point: &Self::Point) -> Self::Scalar

Accesses the second coordinate of a point. Read more
Source§

impl Hash for EmptyCal

Source§

impl HashProvider for EmptyCal

Source§

type Algorithm = NoAlgorithms

Source§

type State = NoAlgorithms

State in which is carried between rounds of feeding data. Read more
Source§

type Output = NoAlgorithms

Output of a hashing operation. Read more
Source§

fn init(&mut self, algorithm: Self::Algorithm) -> Self::State

Source§

fn update(&mut self, instance: &mut Self::State, _data: &[u8])

Source§

fn finalize(&mut self, instance: Self::State) -> Self::Output

Source§

fn hash(&mut self, algorithm: Self::Algorithm, data: &[u8]) -> Self::Output

Hash contiguous in-memory data in a single pass. Read more
Source§

impl HmacProvider for EmptyCal

Source§

type Algorithm = NoAlgorithms

Source§

type Key = NoAlgorithms

A nascent state that has only received a key as input.
Source§

type State = NoAlgorithms

State carried between rounds of feeding data into the HMAC.
Source§

type Output = NoAlgorithms

Output of an HMAC operation.
Source§

fn load_from_keydata( &mut self, algorithm: Self::Algorithm, _key: &[u8], ) -> Self::Key

Initializes a key from raw bytes.
Source§

fn init(&mut self, key: Self::Key) -> Self::State

Starts an HMAC operation.
Source§

fn update(&mut self, state: &mut Self::State, _data: &[u8])

Source§

fn finalize(&mut self, state: Self::State) -> Self::Output

Source§

fn init_with_keydata( &mut self, algorithm: Self::Algorithm, key: &[u8], ) -> Self::State

Starts an HMAC operation based on a key that is entered as raw bytes. Read more
Source§

fn hmac_with_keydata( &mut self, algorithm: Self::Algorithm, key: &[u8], data: &[u8], ) -> Self::Output

Compute HMAC over contiguous in-memory data in a single pass, based on a key directly entered as bytes. Read more
Source§

impl Plumbing for EmptyCal

Source§

impl Sha2Short for EmptyCal

Source§

const SUPPORTED: bool = false

Whether this trait is actually supported. See Plumbing docs for rationale..
Source§

const SEND_PADDING: bool = false

If true, the user needs to send all the padding data into the implementation through the Self::update() function.
Source§

const FIRST_CHUNK_SIZE: usize = 0

Size of the first chunk to be sent to Self::update(), if it differs from the block size. Read more
Source§

const UPDATE_MULTICHUNK: bool = false

If true, the Self::update() function can be passed data from consecutive blocks.
Source§

type State = NoAlgorithms

State containing an ongoing operation. Read more
Source§

fn init(&mut self, _variant: Sha2ShortVariant) -> Self::State

Initiates a Self::State according to the selected algorithm.
Source§

fn update(&mut self, instance: &mut Self::State, _data: &[u8])

Iteratively sends data to be hashed into the instance. Read more
Source§

fn finalize( &mut self, instance: Self::State, _last_chunk: &[u8], _target: &mut [u8], )

Extracts the hash into a target slice. Read more

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<H> HkdfProvider for H
where H: HmacProvider,

Source§

fn hkdf_extract( &mut self, alg: <H as HmacProvider>::Algorithm, salt: Option<&[u8]>, ikm: &[u8], ) -> Result<impl AsRef<[u8]> + use<H>, HkdfError>

HKDF-Extract (RFC 5869): returns a pseudorandom key. Read more
Source§

fn hkdf_expand( &mut self, alg: <H as HmacProvider>::Algorithm, prk: &[u8], info: &[u8], okm: &mut [u8], ) -> Result<(), HkdfError>

HKDF-Expand (RFC 5869): fills okm with derived key material.
Source§

fn hkdf( &mut self, alg: <Self as HmacProvider>::Algorithm, salt: Option<&[u8]>, ikm: &[u8], info: &[u8], okm: &mut [u8], ) -> Result<(), HkdfError>

Extract then expand in one call.
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.