fedimint-core 0.13.0-beta.0

fedimint-core provides common code used by both client and server.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use super::super::tests::test_roundtrip;

#[test_log::test]
fn test_ciphertext() {
    let sks = threshold_crypto::SecretKeySet::random(1, &mut rand::thread_rng());
    let pks = sks.public_keys();
    let pk = pks.public_key();

    let message = b"Hello world!";
    let ciphertext = pk.encrypt(message);
    let decryption_share = sks.secret_key_share(0).decrypt_share(&ciphertext).unwrap();

    test_roundtrip(&ciphertext);
    test_roundtrip(&decryption_share);
}