**Describe the bug** The BLS spec [requires](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-04#section-2.3) 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: - [fromBytes](https://github.com/ChainSafe/bls/blob/master/src/blst/secretKey.ts#L15) - [fromBytes](https://github.com/ChainSafe/blst-ts/blob/master/src/lib.ts#L57) **Expected behavior** Check that the provided SK < r.
Activity
dapplion commentedon Jun 3, 2021
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.
dnkolegov commentedon Jun 3, 2021
The following test for SK = q+1 will pass and will not raise an exception.
dapplion commentedon Jun 3, 2021
Feel free to do a PR with the test and a fix if you want! I can do the latter if you need help.