We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 99d9774 + 981822a commit 40ef465Copy full SHA for 40ef465
test/bls12-381.test.ts
@@ -975,6 +975,14 @@ describe('bls12-381 encoding', () => {
975
);
976
});
977
978
+
979
+ should('Fr toBytes + fromBytes roundtrip', () => {
980
+ const scalar = 42n;
981
+ const bytes = bls12_381.fields.Fr.toBytes(scalar);
982
+ eql(bytes, hexToBytes('000000000000000000000000000000000000000000000000000000000000002a'));
983
+ eql(bls12_381.fields.Fr.fromBytes(bytes), 42n);
984
+ });
985
986
should('G1 toBytes + fromBytes roundtrip', () => {
987
const priv = G1Point.BASE.multiply(42n);
988
const publicKey = priv.toBytes(true);
0 commit comments