//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
-func NewPublicKey(curve *Curve, raw []byte) (*PublicKey, error) {
- pointSize := curve.PointSize()
+func NewPublicKey(c *Curve, raw []byte) (*PublicKey, error) {
+ pointSize := c.PointSize()
key := make([]byte, 2*pointSize)
if len(raw) != len(key) {
return nil, fmt.Errorf("gogost/gost3410: len(key) != %d", len(key))
key := make([]byte, 2*pointSize)
if len(raw) != len(key) {
return nil, fmt.Errorf("gogost/gost3410: len(key) != %d", len(key))
bytes2big(key[pointSize : 2*pointSize]),
bytes2big(key[:pointSize]),
}, nil
bytes2big(key[pointSize : 2*pointSize]),
bytes2big(key[:pointSize]),
}, nil
func (pub *PublicKey) VerifyDigest(digest, signature []byte) (bool, error) {
pointSize := pub.C.PointSize()
if len(signature) != 2*pointSize {
func (pub *PublicKey) VerifyDigest(digest, signature []byte) (bool, error) {
pointSize := pub.C.PointSize()
if len(signature) != 2*pointSize {
- return false, fmt.Errorf("gogost/gost3410: len(signature) != %d", 2*pointSize)
+ return false, fmt.Errorf("gogost/gost3410: len(signature)=%d != %d", len(signature), 2*pointSize)