Documentation ¶
Overview ¶
Package rfc6979 generates deterministic nonce values for digital signatures.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Q ¶
type Q struct {
// contains filtered or unexported fields
}
Q represents a finite field order Q.
func (*Q) Bits2int ¶ added in v1.1.0
Bits2int converts a byte slice into a big.Int. Excess bits larger than the finite field order are right-shifted off.
func (*Q) Nonce ¶
Nonce calculates a deterministic value for K, to be used for digitally signing the given hash h1.
Example ¶
package main import ( "crypto/sha256" "fmt" "math/big" "github.com/kklash/rfc6979" ) func main() { q := rfc6979.NewQ(big.NewInt(31)) privateKey := big.NewInt(14) messageHash := sha256.Sum256([]byte("this is a message to sign")) k := q.Nonce(privateKey, messageHash[:], sha256.New) fmt.Println("k:", k) }
Output: k: 27
Click to show internal directories.
Click to hide internal directories.