Add fr_to_uint64s() function
This commit is contained in:
parent
ba81164330
commit
fc641a2197
|
@ -121,6 +121,16 @@ void fr_from_uint64(fr_t *out, uint64_t n) {
|
||||||
fr_from_uint64s(out, vals);
|
fr_from_uint64s(out, vals);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert the field element to an array of four 64-bit unsigned integers.
|
||||||
|
*
|
||||||
|
* @param out array for returned values, little-endian ordering of the 64-bit words
|
||||||
|
* @param vals The field element equivalent of @p n
|
||||||
|
*/
|
||||||
|
void fr_to_uint64s(uint64_t out[4], const fr_t* fr) {
|
||||||
|
blst_uint64_from_fr(out, fr);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test whether two field elements are equal.
|
* Test whether two field elements are equal.
|
||||||
*
|
*
|
||||||
|
|
|
@ -104,6 +104,7 @@ bool fr_is_null(const fr_t *p);
|
||||||
void fr_from_scalar(fr_t *out, const scalar_t *a);
|
void fr_from_scalar(fr_t *out, const scalar_t *a);
|
||||||
void fr_from_uint64s(fr_t *out, const uint64_t *vals);
|
void fr_from_uint64s(fr_t *out, const uint64_t *vals);
|
||||||
void fr_from_uint64(fr_t *out, uint64_t n);
|
void fr_from_uint64(fr_t *out, uint64_t n);
|
||||||
|
void fr_to_uint64s(uint64_t out[4], const fr_t* fr);
|
||||||
bool fr_equal(const fr_t *aa, const fr_t *bb);
|
bool fr_equal(const fr_t *aa, const fr_t *bb);
|
||||||
void fr_negate(fr_t *out, const fr_t *in);
|
void fr_negate(fr_t *out, const fr_t *in);
|
||||||
void fr_add(fr_t *out, const fr_t *a, const fr_t *b);
|
void fr_add(fr_t *out, const fr_t *a, const fr_t *b);
|
||||||
|
|
Loading…
Reference in New Issue