This repository has been archived by the owner on Apr 18, 2024. It is now read-only.
forked from tendermint/tendermint
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crypto/sr25519: Switch the sr25519 provider to curve25519-voi
Switch the sr25519 implementation to curve25519-voi for better performance, and code quality. Performance comparisions should still be taken with a grain of salt for the following reasons: * curve25519-voi's sr25519 support can use more optimization. * go-schnorrkel cuts corners in places by: * Not doing delinearization at all when verifying batches * Not using the secret key nonce at all when signing. * Not sampling random scalars at all when verifying batches, unless the import is bumped. WARNING: This is a breaking change as the original tendermint sr25519 support expands the MiniSecretKey twice, while this implementation only does it once.
- Loading branch information
Showing
9 changed files
with
203 additions
and
167 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
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
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,23 +1,13 @@ | ||
package sr25519 | ||
|
||
import ( | ||
"github.com/tendermint/tendermint/crypto" | ||
tmjson "github.com/tendermint/tendermint/libs/json" | ||
) | ||
|
||
var _ crypto.PrivKey = PrivKey{} | ||
import tmjson "github.com/tendermint/tendermint/libs/json" | ||
|
||
const ( | ||
PrivKeyName = "tendermint/PrivKeySr25519" | ||
PubKeyName = "tendermint/PubKeySr25519" | ||
|
||
// SignatureSize is the size of an Edwards25519 signature. Namely the size of a compressed | ||
// Sr25519 point, and a field element. Both of which are 32 bytes. | ||
SignatureSize = 64 | ||
) | ||
|
||
func init() { | ||
|
||
tmjson.RegisterType(PubKey{}, PubKeyName) | ||
tmjson.RegisterType(PrivKey{}, PrivKeyName) | ||
} |
Oops, something went wrong.