Commit 543dbe6c authored by Steven Allen's avatar Steven Allen

nit: simplify equality check

parent 963cc997
...@@ -109,14 +109,7 @@ func (sk *RsaPrivateKey) Equals(k Key) bool { ...@@ -109,14 +109,7 @@ func (sk *RsaPrivateKey) Equals(k Key) bool {
b := other.sk b := other.sk
// Don't care about constant time. We're only comparing the public half. // Don't care about constant time. We're only comparing the public half.
if a.PublicKey.N.Cmp(b.PublicKey.N) != 0 { return a.PublicKey.N.Cmp(b.PublicKey.N) == 0 && a.PublicKey.E == b.PublicKey.E
return false
}
if a.PublicKey.E != b.PublicKey.E {
return false
}
return true
} }
// UnmarshalRsaPrivateKey returns a private key from the input x509 bytes // UnmarshalRsaPrivateKey returns a private key from the input x509 bytes
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment