We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 162d3ea commit 04fc5fcCopy full SHA for 04fc5fc
hppk.go
@@ -67,6 +67,27 @@ type KEM struct {
67
Q *big.Int
68
}
69
70
+// Equal checks if two public keys are equal
71
+func (pub *PublicKey) Equal(other *PublicKey) bool {
72
+ if len(pub.P) != len(other.P) || len(pub.Q) != len(other.Q) {
73
+ return false
74
+ }
75
+
76
+ for i := 0; i < len(pub.P); i++ {
77
+ if pub.P[i].Cmp(other.P[i]) != 0 {
78
79
80
81
82
+ for i := 0; i < len(pub.Q); i++ {
83
+ if pub.Q[i].Cmp(other.Q[i]) != 0 {
84
85
86
87
88
+ return true
89
+}
90
91
// GenerateKey generates a new HPPK private key with the given order and default prime number.
92
func GenerateKey(order int) (*PrivateKey, error) {
93
// Ensure the order is at least 5
0 commit comments