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
impl AeadProvider for EmptyCal
type Algorithm = NoAlgorithms
type Key = NoAlgorithms
type Tag = NoAlgorithms
Source§fn load_from_keydata(&mut self, alg: Self::Algorithm, _key: &[u8]) -> Self::Key
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
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>
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
impl Cal for EmptyCal
Source§type DhProvider = EmptyCal
type DhProvider = EmptyCal
The non-supertrait responsible for key establishment.
type AeadProvider = EmptyCal
type HashProvider = EmptyCal
type HmacProvider = EmptyCal
fn dh(&mut self) -> &mut Self::DhProvider
fn aead(&mut self) -> &mut Self::AeadProvider
fn hash(&mut self) -> &mut Self::HashProvider
fn hmac(&mut self) -> &mut Self::HmacProvider
Source§impl DhProvider for EmptyCal
impl DhProvider for EmptyCal
type Algorithm = NoAlgorithms
Source§type VisibleSecretKey = NoAlgorithms
type VisibleSecretKey = NoAlgorithms
A secret key that is intended to be exported. Read more
type SecretKey = NoAlgorithms
type PublicKey = NoAlgorithms
Source§fn generate_visible(&mut self, alg: Self::Algorithm) -> Self::VisibleSecretKey
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).
Derives a shared secret from a public and a private key. Read more
Source§fn public_key(&mut self, private: &Self::SecretKey) -> Self::PublicKey
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>
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 moreSource§fn export_secretkey_bytes<'s>(
&mut self,
secretkey: &'s Self::VisibleSecretKey,
) -> impl AsRef<[u8]> + use<'s>
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>
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>
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>
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§impl Ec for EmptyCal
impl Ec for EmptyCal
Source§const MAX_SCALAR_LENGTH: usize = 0
const MAX_SCALAR_LENGTH: usize = 0
The longest slice length ever usable with scalar import / export from any of the
primitives.
type PrimitivesP256 = EmptyCal
type PrimitivesX25519 = EmptyCal
type PrimitivesX448 = EmptyCal
fn p256(&mut self) -> &mut Self::PrimitivesP256
fn x25519(&mut self) -> &mut Self::PrimitivesX25519
fn x448(&mut self) -> &mut Self::PrimitivesX448
Source§impl<C: Curve> EcPrimitives<C> for EmptyCal
impl<C: Curve> EcPrimitives<C> for EmptyCal
Source§const HAS_MULTIPLY_SCALAR_POINT: bool = false
const HAS_MULTIPLY_SCALAR_POINT: bool = false
Indicates whether
Self::multiply_scalar_point() is available (otherwise it will likely
panic).type Scalar = NoAlgorithms
type Point = NoAlgorithms
Source§fn multiply_scalar_point(
&mut self,
a: &Self::Scalar,
_b: &Self::Point,
) -> Self::Point
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
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>
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>
fn export_scalar_bytes<'s>( &mut self, _scalar: &'s Self::Scalar, ) -> impl AsRef<[u8]> + use<'s, C>
Inverse function of
Self::import_scalar_bytes(). Read moreimpl Hash for EmptyCal
Source§impl HashProvider for EmptyCal
impl HashProvider for EmptyCal
type Algorithm = NoAlgorithms
Source§type State = NoAlgorithms
type State = NoAlgorithms
State in which is carried between rounds of feeding data. Read more
Source§type Output = NoAlgorithms
type Output = NoAlgorithms
Output of a hashing operation. Read more
fn init(&mut self, algorithm: Self::Algorithm) -> Self::State
fn update(&mut self, instance: &mut Self::State, _data: &[u8])
fn finalize(&mut self, instance: Self::State) -> Self::Output
Source§impl HmacProvider for EmptyCal
impl HmacProvider for EmptyCal
type Algorithm = NoAlgorithms
Source§type Key = NoAlgorithms
type Key = NoAlgorithms
A nascent state that has only received a key as input.
Source§type State = NoAlgorithms
type State = NoAlgorithms
State carried between rounds of feeding data into the HMAC.
Source§type Output = NoAlgorithms
type Output = NoAlgorithms
Output of an HMAC operation.
Source§fn load_from_keydata(
&mut self,
algorithm: Self::Algorithm,
_key: &[u8],
) -> Self::Key
fn load_from_keydata( &mut self, algorithm: Self::Algorithm, _key: &[u8], ) -> Self::Key
Initializes a key from raw bytes.
fn update(&mut self, state: &mut Self::State, _data: &[u8])
fn finalize(&mut self, state: Self::State) -> Self::Output
impl Plumbing for EmptyCal
Source§impl Sha2Short for EmptyCal
impl Sha2Short for EmptyCal
Source§const SUPPORTED: bool = false
const SUPPORTED: bool = false
Whether this trait is actually supported. See
Plumbing docs for
rationale..Source§const SEND_PADDING: bool = false
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
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 moreSource§const UPDATE_MULTICHUNK: bool = false
const UPDATE_MULTICHUNK: bool = false
If true, the
Self::update() function can be passed data from consecutive blocks.Source§type State = NoAlgorithms
type State = NoAlgorithms
State containing an ongoing operation. Read more
Source§fn init(&mut self, _variant: Sha2ShortVariant) -> Self::State
fn init(&mut self, _variant: Sha2ShortVariant) -> Self::State
Initiates a
Self::State according to the selected algorithm.Auto Trait Implementations§
impl Freeze for EmptyCal
impl RefUnwindSafe for EmptyCal
impl Send for EmptyCal
impl Sync for EmptyCal
impl Unpin for EmptyCal
impl UnsafeUnpin for EmptyCal
impl UnwindSafe for EmptyCal
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
Source§impl<H> HkdfProvider for Hwhere
H: HmacProvider,
impl<H> HkdfProvider for Hwhere
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>
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