MCPcopy Create free account
hub / github.com/CPChain/chain / SignatureValues

Method SignatureValues

types/transaction_signing.go:183–191  ·  view source on GitHub ↗

SignatureValues returns signature values. This signature needs to be in the [R || S || V] format where V is 0 or 1.

(tx *Transaction, sig []byte)

Source from the content-addressed store, hash-verified

181// SignatureValues returns signature values. This signature
182// needs to be in the [R || S || V] format where V is 0 or 1.
183func (fs FrontierSigner) SignatureValues(tx *Transaction, sig []byte) (r, s, v *big.Int, err error) {
184 if len(sig) != 65 {
185 panic(fmt.Sprintf("wrong size for signature: got %d, want 65", len(sig)))
186 }
187 r = new(big.Int).SetBytes(sig[:32])
188 s = new(big.Int).SetBytes(sig[32:64])
189 v = new(big.Int).SetBytes([]byte{sig[64] + 27})
190 return r, s, v, nil
191}
192
193// Hash returns the hash to be signed by the sender.
194// It does not uniquely identify the transaction.

Callers

nothing calls this directly

Calls 1

SetBytesMethod · 0.80

Tested by

no test coverage detected