From 543dbe6c2964df7c9006994de63afc6f77462d2c Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 1 Aug 2019 16:09:09 -0700 Subject: [PATCH] nit: simplify equality check --- crypto/rsa_go.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/crypto/rsa_go.go b/crypto/rsa_go.go index f8b5999..d774991 100644 --- a/crypto/rsa_go.go +++ b/crypto/rsa_go.go @@ -109,14 +109,7 @@ func (sk *RsaPrivateKey) Equals(k Key) bool { b := other.sk // Don't care about constant time. We're only comparing the public half. - if a.PublicKey.N.Cmp(b.PublicKey.N) != 0 { - return false - } - if a.PublicKey.E != b.PublicKey.E { - return false - } - - return true + return a.PublicKey.N.Cmp(b.PublicKey.N) == 0 && a.PublicKey.E == b.PublicKey.E } // UnmarshalRsaPrivateKey returns a private key from the input x509 bytes