Module selenite::crypto[][src]

Expand description

Selenite: A Core Crypto Module

Lacuna’s Core Crypto Module consists of the structs of keypairs (FALCON512,FALCON1024,SPHINCS+), the signature struct, and most importantly the implemented traits.

When viewing documentation for a struct, make sure to look at the documentation for the traits Keypairs and Signatures as these contain the implemented methods.

Security Warning

This code is not audited and just recomended for educational purposes. Feel free to look through the code and help me out with it as the code is a bit… rusty.

Example Usage

use selenite::crypto::*;
 
fn main() {
    // Generates The Respected Keypair
    let keypair = SphincsKeypair::new();
 
    // Signs The Message as a UTF-8 Encoded String
    let mut sig = keypair.sign("message_to_sign");
     
    // Returns a boolean representing whether the signature is valid or not
    let is_verified = sig.verify();
}

How To Use

This is based upon my beliefs. You may choose yourself.

SPHINCS+ should be used for code signing as it is quite slow at signing/verifying but is based on some high security assumptions and has a high security bit level.

FALCON512/FALCON1024 is comparable to RSA2048/RSA4096 and is fast at signing/verifying. It produces much smaller signatures but has a larger public key size (but still quite small).

Serialization

Serde-yaml is implemented by default for the serialization/deserialization of the data to the human-readable .yaml format.

More Information

This library is built on bindings to pqcrypto, a portable, post-quantum, cryptographic library.

SPHINCS+ reaches a security bit level of 255 bytes which is well over what is needed and is Level 5. I have plans in the future to reduce this so the signature size is smaller.

References

pqcrypto-rust

SPHINCS+

SPHINCS+ REPO

Falcon-Sign

Structs

BLS12_381 Curve

ED25519 Keypair

Falcon512 Keypair

Falcon1024 Keypair

The Signature Struct

SPHINCS+ (SHAKE256) Keypair

Enums

Traits

Traits For Keypairs

Traits For Signatures