frost-core 3.0.0

Types and traits to support implementing Flexible Round-Optimized Schnorr Threshold signature schemes (FROST).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! Helper function for testing

use crate::{Ciphersuite, Field, Group};
use rand_core::{CryptoRng, RngCore};

/// Helper function for randomly generating an element
pub fn generate_element<C: Ciphersuite, R: RngCore + CryptoRng>(
    rng: &mut R,
) -> <<C as Ciphersuite>::Group as Group>::Element {
    let scalar = <<C::Group as Group>::Field>::random(rng);
    <C::Group>::generator() * scalar
}