Documentation ¶
Overview ¶
Package encoding provides encoding utilities.
Package encoding provides encoding utilities.
Index ¶
- Variables
- func Concat(a, b []byte) []byte
- func Concat3(a, b, c []byte) []byte
- func Concatenate(input ...[]byte) []byte
- func DecodeVector(in []byte) (data []byte, offset int, err error)
- func EncodeVector(input []byte) []byte
- func EncodeVectorLen(input []byte, length int) []byte
- func I2OSP(value, length int) []byte
- func OS2IP(input []byte) int
- func PadPoint(point []byte, c group.Group) []byte
- func SerializePoint(e *group.Point, c group.Group) []byte
- func SerializeScalar(s *group.Scalar, c group.Group) []byte
- func SuffixString(a []byte, b string) []byte
Constants ¶
This section is empty.
Variables ¶
var PointLength = map[group.Group]int{ group.Ristretto255Sha512: ristrettoPointLength, group.P256Sha256: p256PointLength, group.P384Sha512: p384PointLength, group.P521Sha512: p521PointLength, group.Curve25519Sha512: curve25519PointLength, }
PointLength indexes the length of elements.
var ScalarLength = map[group.Group]int{ group.Ristretto255Sha512: ristrettoScalarLength, group.P256Sha256: p256ScalarLength, group.P384Sha512: p384ScalarLength, group.P521Sha512: p521ScalarLength, group.Curve25519Sha512: curve25519ScalarLength, }
ScalarLength indexes the length of scalars.
Functions ¶
func Concatenate ¶
Concatenate takes the variadic array of input and returns a concatenation of it.
func DecodeVector ¶
DecodeVector returns the byte-slice of length indexed in the first two bytes.
func EncodeVector ¶
EncodeVector returns the input with a two-byte encoding of its length.
func EncodeVectorLen ¶
EncodeVectorLen returns the input prepended with a byte encoding of its length.
func SerializePoint ¶
SerializePoint pads the given element if necessary.
func SerializeScalar ¶
SerializeScalar pads the given scalar if necessary.
func SuffixString ¶
SuffixString returns the concatenation of the input byte string and the string argument.
Types ¶
This section is empty.