MCPcopy Create free account
hub / github.com/chain/txvm / ReadFrom

Method ReadFrom

crypto/ed25519/ecmath/point_serialization.go:49–59  ·  view source on GitHub ↗

ReadFrom attempts to read 32 bytes and decode a point.

(r io.Reader)

Source from the content-addressed store, hash-verified

47
48// ReadFrom attempts to read 32 bytes and decode a point.
49func (p *Point) ReadFrom(r io.Reader) (n int64, err error) {
50 var buf [32]byte
51 m, err := io.ReadFull(r, buf[:])
52 if err != nil {
53 return
54 }
55 if !(*edwards25519.ExtendedGroupElement)(p).FromBytes(&buf) {
56 err = fmt.Errorf("invalid ecmath.Point encoding")
57 }
58 return int64(m), err
59}
60
61// MarshalText returns a hex-encoded point.
62func (p *Point) MarshalText() ([]byte, error) {

Callers

nothing calls this directly

Calls 1

FromBytesMethod · 0.45

Tested by

no test coverage detected