MCPcopy Create free account
hub / github.com/CovenantSQL/CovenantSQL / Unmarshal

Method Unmarshal

crypto/secp256k1/curve.go:297–308  ·  view source on GitHub ↗

Unmarshal converts a point, serialised by Marshal, into an x, y pair. On error, x = nil.

(data []byte)

Source from the content-addressed store, hash-verified

295// Unmarshal converts a point, serialised by Marshal, into an x, y pair. On
296// error, x = nil.
297func (BitCurve *BitCurve) Unmarshal(data []byte) (x, y *big.Int) {
298 byteLen := (BitCurve.BitSize + 7) >> 3
299 if len(data) != 1+2*byteLen {
300 return
301 }
302 if data[0] != 4 { // uncompressed form
303 return
304 }
305 x = new(big.Int).SetBytes(data[1 : 1+byteLen])
306 y = new(big.Int).SetBytes(data[1+byteLen:])
307 return
308}
309
310var theCurve = new(BitCurve)
311

Callers 15

UnmarshalJSONMethod · 0.80
TestTransactionWrapperFunction · 0.80
UnmarshalJSONMethod · 0.80
unmarshalAndMarshalFunction · 0.80
unmarshalAndMarshalYAMLFunction · 0.80
unmarshalAndMarshalJSONFunction · 0.80
UnmarshalJSONMethod · 0.80
LoadConfigFunction · 0.80
loadConfigFunction · 0.80
LoadConfigFunction · 0.80
GetTestNetConfigFunction · 0.80

Calls 1

SetBytesMethod · 0.80

Tested by 7

TestTransactionWrapperFunction · 0.64
unmarshalAndMarshalFunction · 0.64
unmarshalAndMarshalYAMLFunction · 0.64
unmarshalAndMarshalJSONFunction · 0.64