// ScalarEncodeTo provides a generic implementation of Scalar.EncodeTo // based on Scalar.Encode. func ScalarMarshalTo(s abstract.Scalar, w io.Writer) (int, error) { buf, err := s.MarshalBinary() if err != nil { return 0, err } return w.Write(buf) }
// ScalarHex encodes a scalar to hexadecimal func ScalarHex(suite abstract.Suite, scalar abstract.Scalar) (string, error) { sbuf, err := scalar.MarshalBinary() return hex.EncodeToString(sbuf), err }