aztec-nr - noir_aztec::keys::ephemeral

Function generate_positive_ephemeral_key_pair

pub fn generate_positive_ephemeral_key_pair(
) -> (EmbeddedCurveScalar, EmbeddedCurvePoint)

Generates a random ephemeral key pair with a positive y-coordinate.

Unlike generate_ephemeral_key_pair, the y-coordinate of the public key is guaranteed to be a positive value (i.e. crate::utils::point::get_sign_of_point will return true).

This is useful as it means it is possible to just broadcast the x-coordinate as a single Field and then reconstruct the original public key using crate::utils::point::point_from_x_coord_and_sign with sign: true.