Skip to content

Commit

Permalink
secp256k1/ecdsa: Expose r and s value of signature.
Browse files Browse the repository at this point in the history
  • Loading branch information
minizilla authored and davecgh committed Sep 21, 2023
1 parent a20782d commit 2daf6c9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dcrec/secp256k1/ecdsa/signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ func NewSignature(r, s *secp256k1.ModNScalar) *Signature {
return &Signature{*r, *s}
}

// R returns the r value of the signature.
func (sig *Signature) R() secp256k1.ModNScalar {
return sig.r
}

// S returns the s value of the signature.
func (sig *Signature) S() secp256k1.ModNScalar {
return sig.s
}

// Serialize returns the ECDSA signature in the Distinguished Encoding Rules
// (DER) format per section 10 of [ISO/IEC 8825-1] and such that the S component
// of the signature is less than or equal to the half order of the group.
Expand Down

0 comments on commit 2daf6c9

Please sign in to comment.