We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug The BLS spec requires that the secret key (SK) must be a uniformly random integer such that 1 <= SK < r. Where r is the order curve.
The last check is missing:
Expected behavior
Check that the provided SK < r.
The text was updated successfully, but these errors were encountered:
Thanks for looking into this! I think BLST takes care of that, but it would be good to add a test. Transfering to bls repo.
Sorry, something went wrong.
The following test for SK = q+1 will pass and will not raise an exception.
describe("q+1 secret key", () => { const qHex = fromHex("73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000002"); const sk = bls.SecretKey.fromBytes(qHex); const msg = Buffer.from("sample-msg"); const sig = sk.sign(msg); const pk = sk.toPublicKey(); console.log(pk.toBytes()) it("verify", () => { const valid = bls.verify(msg, pk, sig); expect(valid).to.equal(true); }); });
Feel free to do a PR with the test and a fix if you want! I can do the latter if you need help.
No branches or pull requests
Describe the bug
The BLS spec requires that the secret key (SK) must be a uniformly random integer such that 1 <= SK < r.
Where r is the order curve.
The last check is missing:
Expected behavior
Check that the provided SK < r.
The text was updated successfully, but these errors were encountered: