Module crypto

Source
Expand description

This module defines a cryptographic abstraction layer for use in hax protocol specifications.

Structs§

AEADIV
An abstract AEAD initialization vector.
AEADKey
An abstract AEAD key.
AEADTag
An abstract AEAD authentication tag.
DHElement
An abstract Diffie-Hellman group element.
DHScalar
An abstract Diffie-Hellman scalar.

Enums§

AEADAlgorithm
Choice of AEAD algorithms.
DHGroup
Choice of Diffie-Hellman groups.
HMACAlgorithm
Choice of algorithms for instantiation of HMAC.
HashAlgorithm
Choice of hashing algorithms.

Functions§

aead_decrypt
Abstract AEAD decryption using algorithm. On success returns the decrypted plaintext, otherwise a CryptoError.
aead_encrypt
Abstract AEAD encryption using algorithm. Returns a pair of byte vectors (ciphertext, tag).
dh_scalar_multiply
Scalar multiplication of scalar and element.
dh_scalar_multiply_base
Scalar multiplication of a fixed generator and scalar.
hash
Abstract hashing using algorithm.
hmac
Abstract HMAC using algorithm as the hash function.