id: crypto title: Crypto

customediturl: https://github.com/diem/diem/edit/master/crypto/crypto/README.md

The crypto component hosts all the implementations of cryptographic primitives we use in Diem: hashing, signing, and key derivation/generation. The parts of the library using traits.rs contains the crypto API enforcing type safety, verifiable random functions, EdDSA & MultiEdDSA signatures.

Overview

Diem makes use of several cryptographic algorithms:

How is this module organized?

crypto/src ├── hash.rs # Hash function (SHA-3) ├── hkdf.rs # HKDF implementation (HMAC-based Extract-and-Expand Key Derivation Function based on RFC 5869) ├── macros/ # Derivations for SilentDebug and SilentDisplay ├── utils.rs # Serialization utility functions ├── lib.rs ├── ed25519.rs # Ed25519 implementation of the signing/verification API in traits.rs ├── multi_ed25519.rs # MultiEd25519 implementation of the signing/verification API in traits.rs ├── x25519.rs # X25519 wrapper ├── test_utils.rs ├── traits.rs # New API design and the necessary abstractions └── unit_tests/ # Tests

Note: This crate historically had support for BLS12381, ECVRF, and SlIP-0010, though were removed due to lack of use. The last git revision before there removal is 00301524.