Crate tari_crypto

source ·
Expand description

Tari-Crypto

Re-exports

Modules

  • A commitment is like a sealed envelope. You put some information inside the envelope, and then seal (commit) it. You can’t change what you’ve said, but also, no-one knows what you’ve said until you’re ready to open (open) the envelope and reveal its contents. Also it’s a special envelope that can only be opened by a special opener that you keep safe in your drawer.
  • A deterministic randomizer with utility functions for operating on numbers and arrays in a reproducible and platform-indepdent way.
  • The robotic innards of a Diffie-Hellman key exchange (DHKE) producing a shared secret. Even though the result of a DHKE is the same type as a public key, it is typically treated as a secret value. To make this work more safely, we ensure that a DHKE result is cleared after use (but beware of subsequent copies or moves). Because a DHKE shared secret is intended to be used in further key derivation, the only visibility into it is as a byte array; it’s not possible to directly extract the underlying public key type, and you probably shouldn’t clone the byte array without a very good reason. If you need the underlying public key itself, you probably should be using something else.
  • Errors used in the Tari Crypto crate
  • Extended range proofs
  • The Hashing API
  • General definition of public-private key pairs for use in Tari. The traits and structs defined here are used in the Tari domain logic layer exclusively (as opposed to any specific implementation of ECC curve). The idea being that we can swap out the underlying implementation without worrying too much about the impact on upstream code.
  • Range proofs are used to determine if a value lies inside a particular range. Most commonly, we want to prove in zero knowledge that a value is non-negative.
  • This module contains implementations using the Ristretto curve.
  • This module defines generic traits for handling the digital signature operations, agnostic of the underlying elliptic curve implementation

Macros

  • Creates a DomainSeparation struct for a given domain.
  • Creates a domain separated hasher type and domain in one