Probably need to bytes48 from g1 in the interface

This commit is contained in:
Ramana Kumar 2022-10-01 11:50:21 +01:00
parent be3f0c22cf
commit 9897fb2fa9
No known key found for this signature in database
GPG Key ID: ED471C788B900433
3 changed files with 10 additions and 0 deletions

View File

@ -71,6 +71,7 @@
#endif
%array_class(scalar_t, scalars)
%array_class(uint8_t, bytes)
%array_class(BLSFieldElement, BLSFieldElements)
%pointer_class(PolynomialEvalForm, PolynomialEvalFormPtr)

View File

@ -753,6 +753,10 @@ static bool pairings_verify(const g1_t *a1, const g2_t *a2, const g1_t *b1, cons
}
void Bytes48_from_G1(uint8_t out[48], const g1_t *in) {
blst_p1_compress(out, in);
}
void BLSFieldElement_from_uint64s(BLSFieldElement *out, const uint64_t in[4]) {
blst_fr_from_uint64(out, in);
}

View File

@ -38,6 +38,11 @@ typedef g1_t KZGCommitment;
typedef g1_t KZGProof;
typedef fr_t BLSFieldElement;
/**
* KZGCommitment and KZGProof can be recovered as 48 bytes
*/
void Bytes48_from_G1(uint8_t out[48], const g1_t*);
/**
* BLSFieldElements are communicated directly to/from clients,
* so we need to expose the functions for translating between this