// GoGOST -- Pure Go GOST cryptographic functions library
-// Copyright (C) 2015-2020 Sergey Matveev <stargrave@stargrave.org>
+// Copyright (C) 2015-2021 Sergey Matveev <stargrave@stargrave.org>
//
// 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
package gost3410
import (
+ "crypto"
"fmt"
"math/big"
)
lm.Mod(lm, pub.C.Q)
return lm.Cmp(r) == 0, nil
}
+
+func (our *PublicKey) Equal(theirKey crypto.PublicKey) bool {
+ their, ok := theirKey.(*PublicKey)
+ if !ok {
+ return false
+ }
+ return our.X.Cmp(their.X) == 0 && our.Y.Cmp(their.Y) == 0 && our.C.Equal(their.C)
+}