Module util

Source
Expand description

Utilities for hashing and encryption

Constants§

AES_GCM_NONCE_SIZE
Size of the AES-GCM nonce

Functions§

ansi_x963_derive_key
Derive a shared key using the ANSI-x963 standard https://www.secg.org/sec1-v2.pdf (section 3.6.1)
create_rng
Creates a new random number generator.
decrypt
Decrypt the passed data using the key
encrypt
Encrypt the passed data using the key
expand_to_scalar
Expands a message using the XMD (eXpandable Message Digest) method with SHA-256, and reduces the result modulo the curve order to produce a Scalar.
hash_to_scalar
Digest the hasher to a Scalar
make_shared_secret
Do a Diffie-Hellman key exchange to create a shared secret from the passed private/public keys
make_shared_secret_from_key
Create a shared secret from the passed Diffie-Hellman shared key