id: crypto title: Crypto

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

Legacy Crypto

The crypto component hosts all the implementations of cryptographic primitives we use in Libra: hashing, signing, and key derivation/generation. The NextGen directory contains implementations of cryptographic primitives that will be used in the upcoming versions: new crypto API Enforcing type safety, verifiable random functions, BLS signatures.

Overview

Libra makes use of several cryptographic algorithms:

How is this module organized?

legacy_crypto/src ├── signing.rs # Ed25519 signature scheme ├── hash.rs # Hash function (SHA-3) ├── hkdf.rs # HKDF implementation (HMAC-based Extract-and-Expand Key Derivation Function based on RFC 5869) ├── x25519.rs # X25519 keys generation ├── macros/ # Derivations for SilentDebug and SilentDisplay ├── utils.rs # Serialization utility functions ├── unit_tests # Tests └── lib.rs

Currently x25519.rs only exposes the logic for managing keys. The relevant cryptographic primitives to the Noise Protocol Framework are under the snow crate.