pub fn sign_message(private_key: &FE, message: &str) -> MessageSigned {
    let g = Curve::generator();

    // Choose l a random field element. This element should be different in each signature.
    let rand = sample_field_elem(rand_chacha::ChaCha20Rng::from_entropy());

    // r = g^l.
    let r = g.operate_with_self(rand.representative());

    // We want to compute e = H(r || message).
    let mut hasher = Keccak256::new();

    // We append r to the hasher.
    let r_coordinate_x_bytes = &r.to_affine().x().to_bytes_be();
    let r_coordinate_y_bytes = &r.to_affine().y().to_bytes_be();
    hasher.update(r_coordinate_x_bytes);
    hasher.update(r_coordinate_y_bytes);

    // We append the message to the hasher.
    let message_bytes = message.as_bytes();
    hasher.update(message_bytes);

    // e = H(r || message)
    let hashed_data = hasher.finalize().to_vec();
    let e = FE::from_bytes_be(&hashed_data).unwrap();

    // s = l + private_key * e
    let s = rand + &(private_key * &e);

    MessageSigned {
        message: message.to_string(),
        signature: (s, e),
    }
}
Function that should use the signer to sign a message.
examples/schnorr-signature/src/schnorr_signature.rs