Module blockify::crypto

source ·

Modules

Structs

  • An AuthKeyPair is a cryptographic key pair that can be used for digital signing and verification.
  • A DigitalSignature is a cryptographic signature that can be used to verify the authenticity of a message.
  • A Hash is the result of hashing a value.
  • A PrivateKey is a cryptographic key that can be used to sign data.
  • A PublicKey is a cryptographic key that can be used to verify digital signatures that are signed with the equivalent AuthKeyPair or PrivateKey.

Enums

  • An enum representing the different algorithms that can be used to generate key pairs.
  • An error that can occur while signing a piece of message
  • An error that can occur while verifying a digital signature

Functions

  • Generates a new Ed25519 key pair using the ed25519_dalek crate and returns it as an AuthKeyPair.
  • Hashes the provided data using the SHA-256 algorithm and returns the computed hash.
  • Hashes a block of records along with other parameters to compute the block’s hash using the SHA-256 algorithm.
  • Hashes the given byte slice using the SHA-256 algorithm and returns the resulting hash as a byte vector.
  • Generates a random byte array of size N.
  • Generates a random byte vector of the specified length.
  • Generates a random SHA-256 hash.
  • Hashes the provided value using the SHA-256 algorithm and returns the computed hash.
  • Computes the combined SHA-256 hash of an array of values.
  • Signs a message using the provided authentication key pair and returns the digital signature.
  • Verifies whether a given object’s hash matches the provided hash value.
  • Verifies the digital signature for the given message using the provided public key.
  • Verifies the Ed25519 digital signature for the given message using a public key.