forked from cometbft/cometbft
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(crypto): handle errors and more in
bls12381
(cometbft#2832)
- pin cometbft-db-testing image version - extract const in a separate file - return err in GenPrivKey and NewPrivateKeyFromBytes Follow-up to cometbft#2765 --- #### PR checklist - [x] Tests written/updated - [ ] ~~Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog)~~ - [x] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec --------- Co-authored-by: Sergio Mena <[email protected]>
- Loading branch information
1 parent
b846639
commit d27732a
Showing
7 changed files
with
173 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
- `[crypto]` Add support for BLS12-381 keys. Use `bls12381` build flag to enable | ||
it ([\#2765](https://github.com/cometbft/cometbft/pull/2765)) | ||
- `[crypto]` Add support for BLS12-381 keys. Since the implementation needs | ||
`cgo` and brings in new dependencies, we use the `bls12381` build flag to | ||
enable it ([\#2765](https://github.com/cometbft/cometbft/pull/2765)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package bls12381 | ||
|
||
const ( | ||
// PrivKeySize defines the length of the PrivKey byte array. | ||
PrivKeySize = 32 | ||
// PubKeySize defines the length of the PubKey byte array. | ||
PubKeySize = 48 | ||
// SignatureLength defines the byte length of a BLS signature. | ||
SignatureLength = 96 | ||
// KeyType is the string constant for the BLS12-381 algorithm. | ||
KeyType = "bls12_381" | ||
// MaxMsgLen defines the maximum length of the message bytes as passed to Sign. | ||
MaxMsgLen = 32 | ||
// BLS12-381 private key name. | ||
PrivKeyName = "cometbft/PrivKeyBls12_381" | ||
// BLS12-381 public key name. | ||
PubKeyName = "cometbft/PubKeyBls12_381" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.