Crate bramble_crypto

Crate bramble_crypto 

Source
Expand description

The cryptographic primitives used in the Bramble protocols

Structs§

Hash
The output of a hash function
KeyPair
An asymmetric cryptography key pair
Mac
A message-authentication code
Nonce
A nonce
PublicKey
An asymmetric public key
SecretKey
An asymmetric secret key
SymmetricKey
A symmetric cryptography key

Enums§

Error
Bramble errors
Role
The role a peer plays in a protocol, either Alice or Bob.

Constants§

AUTH_LEN
The length of the AEAD auth tags
HASH_LEN
The length of hashes
KEY_LEN
The length of keys
MAC_LEN
The length of MACs
NONCE_LEN
The length of the AEAD nonces
PRF_LEN
The length of the PRF output

Functions§

dec
Decrypts an authenticated ciphertext.
dh
Performs a Diffie-Hellman operation between the two given keys.
enc
Encrypts a plaintext with an authenticated cipher
hash
Computes a hash of the given messages with the given label as domain separator.
kdf
Derives a key from the given key and messages with the given label as domain separator.
kex
Performs a key exchange from the given DH keys and the given messages with the given label as domain separator.
mac
Derives a MAC from the given key and messages with the given label as domain separator.
prf
A pseudo-random function.
stream
Expands a key into a stream of pseudo-random bytes.

Type Aliases§

Result
Result type for Bramble errors.