mirror of
https://github.com/status-im/c-kzg-4844.git
synced 2025-02-05 06:43:53 +00:00
Probably need to bytes48 from g1 in the interface
This commit is contained in:
parent
be3f0c22cf
commit
9897fb2fa9
@ -71,6 +71,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
%array_class(scalar_t, scalars)
|
%array_class(scalar_t, scalars)
|
||||||
|
%array_class(uint8_t, bytes)
|
||||||
%array_class(BLSFieldElement, BLSFieldElements)
|
%array_class(BLSFieldElement, BLSFieldElements)
|
||||||
%pointer_class(PolynomialEvalForm, PolynomialEvalFormPtr)
|
%pointer_class(PolynomialEvalForm, PolynomialEvalFormPtr)
|
||||||
|
|
||||||
|
@ -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]) {
|
void BLSFieldElement_from_uint64s(BLSFieldElement *out, const uint64_t in[4]) {
|
||||||
blst_fr_from_uint64(out, in);
|
blst_fr_from_uint64(out, in);
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,11 @@ typedef g1_t KZGCommitment;
|
|||||||
typedef g1_t KZGProof;
|
typedef g1_t KZGProof;
|
||||||
typedef fr_t BLSFieldElement;
|
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,
|
* BLSFieldElements are communicated directly to/from clients,
|
||||||
* so we need to expose the functions for translating between this
|
* so we need to expose the functions for translating between this
|
||||||
|
Loading…
x
Reference in New Issue
Block a user