Type Alias dusk_jubjub::JubJubExtended
source · pub type JubJubExtended = ExtendedPoint;
Expand description
An alias for ExtendedPoint
Aliased Type§
struct JubJubExtended { /* private fields */ }
Implementations§
source§impl JubJubExtended
impl JubJubExtended
sourcepub const fn from_affine(affine: JubJubAffine) -> Self
pub const fn from_affine(affine: JubJubAffine) -> Self
Constructs an extended point (with Z = 1
) from
an affine point using the map (x, y) => (x, y, 1, x, y)
.
sourcepub const fn from_raw_unchecked(
u: BlsScalar,
v: BlsScalar,
z: BlsScalar,
t1: BlsScalar,
t2: BlsScalar
) -> Self
pub const fn from_raw_unchecked( u: BlsScalar, v: BlsScalar, z: BlsScalar, t1: BlsScalar, t2: BlsScalar ) -> Self
Constructs an extended point from its raw internals
sourcepub fn to_hash_inputs(&self) -> [BlsScalar; 2]
pub fn to_hash_inputs(&self) -> [BlsScalar; 2]
Returns two scalars suitable for hashing that represent the Extended Point.
sourcepub fn hash_to_point(input: &[u8]) -> Self
pub fn hash_to_point(input: &[u8]) -> Self
Hash an arbitrary slice of bytes to a point on the elliptic curve and in the prime order subgroup.
This algorithm uses rejection sampling to hash to a point on the curve:
The input together with a counter are hashed into an array of 32 bytes.
If the hash is a canonical representation of a point on the curve and
a member of the prime-order subgroup, we return it. If not, we increment
the counter, hash and try to de-serialize again.
This is the same algorithm we used to generate GENERATOR_NUMS
as
outlined here.
Note: This implementation of hash_to_point
is not constant time,
in the long run we want to implement an algorithm outlined
here, but we start with
this implementation in order to be able to use the API already.