Refactor signer implementation to use p8k package
- Replaced all instances of p256k1signer with the new p8k.Signer across various modules, including event creation, policy handling, and database interactions. - Updated related test cases and benchmarks to ensure compatibility with the new signer interface. - Bumped version to v0.25.0 to reflect these significant changes and improvements in cryptographic operations.
This commit is contained in:
@@ -4,8 +4,8 @@ import (
|
||||
"lol.mleku.dev/chk"
|
||||
"lol.mleku.dev/errorf"
|
||||
"lol.mleku.dev/log"
|
||||
p256k1signer "p256k1.mleku.dev/signer"
|
||||
"next.orly.dev/pkg/interfaces/signer"
|
||||
"next.orly.dev/pkg/interfaces/signer/p8k"
|
||||
"next.orly.dev/pkg/utils"
|
||||
)
|
||||
|
||||
@@ -26,7 +26,10 @@ func (ev *E) Sign(keys signer.I) (err error) {
|
||||
// Verify an event is signed by the pubkey it contains. Uses
|
||||
// github.com/bitcoin-core/secp256k1 if available for faster verification.
|
||||
func (ev *E) Verify() (valid bool, err error) {
|
||||
keys := p256k1signer.NewP256K1Signer()
|
||||
var keys *p8k.Signer
|
||||
if keys, err = p8k.New(); chk.E(err) {
|
||||
return
|
||||
}
|
||||
if err = keys.InitPub(ev.Pubkey); chk.E(err) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user