#crypto #lib #primitive


Crypto lib for pure crypto primitives

6 stable releases

Uses new Rust 2021

new 3.0.0 Oct 4, 2022
2.0.0 Aug 23, 2022
1.1.1 Aug 22, 2022
1.0.0 Jul 27, 2022

#301 in Cryptography

Download history 76/week @ 2022-07-21 274/week @ 2022-07-28 33/week @ 2022-08-04 76/week @ 2022-08-11 616/week @ 2022-08-18 466/week @ 2022-08-25 793/week @ 2022-09-01 433/week @ 2022-09-08 376/week @ 2022-09-15 610/week @ 2022-09-22 292/week @ 2022-09-29

1,756 downloads per month
Used in 4 crates (3 directly)


921 lines

cosmian_crypto_core   Build Status Latest Version

This crate implements crypto primitives which are used in many other Cosmian cryptographic resources:

  • symmetric cryptography primitives can be found in the symmetric_crypto module;
  • asymmetric cryptography primitives can be found in the asymmetric_crypto module;
  • a Random Number Generator (RNG) can be found in the entropy module.

The crate also defines CryptoCoreError, the error type, and a few traits.

Symmetric Crypto

This crate implements a Data Encapsulation Mechanism (DEM) based on the AES 256 GCM algorithm, as described in the ISO 2004. This implementation is 128-bits secure.

It uses the aes_gcm implementation of the AES GCM algorithm. This implementation makes use of the AES instruction set when available, which allows for a high encryption speed.

Asymmetric Crypto

This crate implements a public and a private key objects based on Curve25519. This one of the fastest elliptic curves known when implementing these objects. Its security level is also 128 bits.

It uses the Dalek implementation, which offers an implementation of the Ristretto technique to construct a prime order group on the curve. This group is used to implement the public key.

Random Number Generator (RNG)

This crate uses the implementation of the HC128 algorithm from the Rust standard library to construct our RNG. It is therefore 128-bits secure.


The default feature schemes can all be built to a WASM target.


~72K SLoC