11 releases

0.2.1 Apr 25, 2024
0.2.0 Jul 24, 2023
0.2.0-pre.2 Jun 26, 2023
0.2.0-pre.1 Feb 3, 2023
0.0.1 Feb 13, 2022

#1933 in Magic Beans

Download history 106/week @ 2024-02-26 75/week @ 2024-03-04 67/week @ 2024-03-11 88/week @ 2024-03-18 90/week @ 2024-03-25 192/week @ 2024-04-01 120/week @ 2024-04-08 98/week @ 2024-04-15 308/week @ 2024-04-22 128/week @ 2024-04-29 52/week @ 2024-05-06 38/week @ 2024-05-13 113/week @ 2024-05-20 51/week @ 2024-05-27 125/week @ 2024-06-03 82/week @ 2024-06-10

373 downloads per month
Used in 4 crates (3 directly)

Custom license

21KB
446 lines

everscale-crypto   Latest Version everscale-crypto: rustc 1.56+ Workflow badge License MIT badge

Cryptography primitives for Everscale

Examples

use everscale_crypto::ed25519;

fn main() {
    let data: &[u8] = b"hello world";

    let keys = ed25519::KeyPair::generate(&mut rand::thread_rng());

    // Simple bytes signature
    let signature = keys.sign_raw(data);
    assert!(keys.public_key.verify_raw(&data, &signature));

    // Sign TL data without intermediate serialization
    let signature = keys.sign(keys.public_key.as_tl());
    assert!(keys.public_key.verify(keys.public_key.as_tl(), &signature));

    // Shared secret
    let other_keys = ed25519::KeyPair::generate(&mut rand::thread_rng());
    let secret1 = keys.compute_shared_secret(&other_keys.public_key);
    let secret2 = other_keys.compute_shared_secret(&keys.public_key);
    assert_eq!(secret1, secret2);
}

Dependencies

~2.3–3.5MB
~78K SLoC