mirror of
https://github.com/arnaucube/go-blindsecp256k1.git
synced 2026-02-06 19:16:40 +01:00
Update Unblind inputs removing unnecessary m
- Update Unblind inputs removing unnecessary `m` - Add mod at Blind & BlindSign
This commit is contained in:
@@ -112,8 +112,8 @@ type Signature struct {
|
||||
}
|
||||
|
||||
// Unblind performs the unblinding operation of the blinded signature for the
|
||||
// given message m and the UserSecretData
|
||||
func Unblind(sBlind, m *big.Int, u *UserSecretData) *Signature {
|
||||
// given and the UserSecretData
|
||||
func Unblind(sBlind *big.Int, u *UserSecretData) *Signature {
|
||||
// s = b^-1 s' + c
|
||||
binv := new(big.Int).ModInverse(u.B, blindsecp256k1.N)
|
||||
bs := new(big.Int).Mul(binv, sBlind)
|
||||
|
||||
@@ -24,7 +24,7 @@ func TestFlow(t *testing.T) {
|
||||
sBlind := sk.BlindSign(msgBlinded, k)
|
||||
|
||||
// user: unblinds the blinded signature
|
||||
sig := Unblind(sBlind, msg, userSecretData)
|
||||
sig := Unblind(sBlind, userSecretData)
|
||||
|
||||
// signature can be verified with signer PublicKey (Q)
|
||||
verified := Verify(msg, sig, signerPubK)
|
||||
|
||||
Reference in New Issue
Block a user