hopr_crypto_types

Module utils

Source
Expand description

Contains small utility functions used in the other hopr-crypto-... crates

Structs§

SecretValue
Represents a secret value of a fixed length that is zeroized on drop. Secret values are always compared in constant time. The default value is all zeroes.

Functions§

k256_scalar_from_bytes
Creates secp256k1 secret scalar from the given bytes. Note that this function allows zero scalars.
x25519_scalar_from_bytes
Creates X25519 secret scalar (also compatible with Ed25519 scalar) from the given bytes. This function ensures the value is pre-multiplied by the curve’s co-factor and already reduced mod 2^255-19.
xor_inplace
Convenience method to XOR one slice onto other.