Skip to content

Common cryptographic library used in software at Mysten Labs.

License

Notifications You must be signed in to change notification settings

arnab-roy/fastcrypto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fastcrypto

Common cryptographic library used in softwares at Mysten Labs.

This crate contains:

  • useful traits that should be implemented by concrete types that represent digital cryptographic material (keys). For signatures, we rely on signature::Signature, which may be more widely implemented.
  • concrete implementations of the following signature schemes that implement the recommended traits required for cryptographic agility. The following schemes are implemented (wrappers over existing popular crates):
    • ed25519 (EdDSA), backed by the ed25519-consensus crate.
    • Secp256k1, backed by the secp256k1 crate.
    • BLS12-381, backed by the blst crate.
    • BLS12-377, backed by the ark_bls12_377 crate. Note that this implementation is under the non-default conditional compilation feature celo, and is not compiled or linked without that explicit flag being passed in. The goal of this implementation is to provide an experimental benchmark, it is NOT meant as a production implementation.
  • An asynchronous [SignatureService] (which lives in lib.rs) that is instantiated by a Signer object.

Traits

  • [ToFromBytes]: this trait aims to minimize the number of steps involved in obtaining a serializable key.
  • [EncodeDecodeBase64]: an extension trait of ToFromBytes for immediate conversion to/from base64 strings.
  • [VerifyingKey]: which denotes associated types for private key and signature material, while it includes a default naive implementation of batch verification (which can be overridden).
  • [SigningKey]: associated types for public key and signature material.
  • [Authenticator]: associated types for private key and public key material.
  • [KeyPair]: which includes the common get priv/pub key functions and a key-pair generation function.

Tests and Benchmarks

There exist tests for all the three schemes, which can be run by:

$ cargo test

One can compare all currently implemented schemes for sign, verify, verify_batch and key-generation by running:

$ cargo bench

About

Common cryptographic library used in software at Mysten Labs.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 99.7%
  • Shell 0.3%