Add conversions to/from uint64s to the interface
This commit is contained in:
parent
8a072d68ba
commit
24212039b2
|
@ -753,6 +753,15 @@ static bool pairings_verify(const g1_t *a1, const g2_t *a2, const g1_t *b1, cons
|
|||
}
|
||||
|
||||
|
||||
void BLSFieldElement_from_uint64s(BLSFieldElement *out, const uint64_t in[4]) {
|
||||
blst_fr_from_uint64(out, in);
|
||||
}
|
||||
|
||||
void uint64s_from_BLSFieldElement(uint64_t out[4], const BLSFieldElement *in) {
|
||||
blst_uint64_from_fr(out, in);
|
||||
}
|
||||
|
||||
|
||||
C_KZG_RET load_trusted_setup(KZGSettings *out, FILE *in) {
|
||||
|
||||
uint64_t n2, i;
|
||||
|
|
|
@ -38,6 +38,14 @@ typedef g1_t KZGCommitment;
|
|||
typedef g1_t KZGProof;
|
||||
typedef fr_t BLSFieldElement;
|
||||
|
||||
/**
|
||||
* BLSFieldElements are communicated directly to/from clients,
|
||||
* so we need to expose the functions for translating between this
|
||||
* type and uint256. BLST represents uint256 as uint64[4].
|
||||
*/
|
||||
void BLSFieldElement_from_uint64s(BLSFieldElement *out, const uint64_t[4]);
|
||||
void uint64s_from_BLSFieldElement(uint64_t out[4], const BLSFieldElement*);
|
||||
|
||||
/**
|
||||
* The common return type for all routines in which something can go wrong.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue