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

Method Marshal

crypto/secp256k1/curve.go:286–293  ·  view source on GitHub ↗

Marshal converts a point into the form specified in section 4.3.6 of ANSI X9.62.

(x, y *big.Int)

Source from the content-addressed store, hash-verified

284// Marshal converts a point into the form specified in section 4.3.6 of ANSI
285// X9.62.
286func (BitCurve *BitCurve) Marshal(x, y *big.Int) []byte {
287 byteLen := (BitCurve.BitSize + 7) >> 3
288 ret := make([]byte, 1+2*byteLen)
289 ret[0] = 4 // uncompressed point flag
290 readBits(x, ret[1:1+byteLen])
291 readBits(y, ret[1+byteLen:])
292 return ret
293}
294
295// Unmarshal converts a point, serialised by Marshal, into an x, y pair. On
296// error, x = nil.

Callers 15

buildBlockIndexFunction · 0.80
MarshalJSONMethod · 0.80
TestTransactionWrapperFunction · 0.80
MarshalJSONMethod · 0.80
TestMarshalBPInfoFunction · 0.80
generateKeyPairFunction · 0.80
unmarshalAndMarshalFunction · 0.80
unmarshalAndMarshalYAMLFunction · 0.80
unmarshalAndMarshalJSONFunction · 0.80
MarshalJSONMethod · 0.80
CompressPubkeyFunction · 0.80

Calls 1

readBitsFunction · 0.85

Tested by 11

TestTransactionWrapperFunction · 0.64
TestMarshalBPInfoFunction · 0.64
generateKeyPairFunction · 0.64
unmarshalAndMarshalFunction · 0.64
unmarshalAndMarshalYAMLFunction · 0.64
unmarshalAndMarshalJSONFunction · 0.64
generateKeyPairFunction · 0.64
TestConfFunction · 0.64