+// Unmarshal BE(X)||BE(Y) public key. "raw" must be 2*c.PointSize() length.
+func NewPublicKeyBE(c *Curve, raw []byte) (*PublicKey, error) {
+ pointSize := c.PointSize()
+ if len(raw) != 2*pointSize {
+ return nil, fmt.Errorf("gogost/gost3410: len(key) != %d", 2*pointSize)
+ }
+ return &PublicKey{
+ c,
+ bytes2big(raw[:pointSize]),
+ bytes2big(raw[pointSize:]),
+ }, nil
+}
+
+// This is an alias for NewPublicKeyLE().
+func NewPublicKey(c *Curve, raw []byte) (*PublicKey, error) {
+ return NewPublicKeyLE(c, raw)
+}
+
+// Marshal LE(X)||LE(Y) public key. raw will be 2*pub.C.PointSize() length.
+func (pub *PublicKey) RawLE() []byte {
+ pointSize := pub.C.PointSize()