aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/crypto/elliptic/elliptic.go3
-rw-r--r--src/net/lookup_test.go9
2 files changed, 9 insertions, 3 deletions
diff --git a/src/crypto/elliptic/elliptic.go b/src/crypto/elliptic/elliptic.go
index 35aacf24e5..76b78a790e 100644
--- a/src/crypto/elliptic/elliptic.go
+++ b/src/crypto/elliptic/elliptic.go
@@ -210,8 +210,9 @@ func (curve *CurveParams) doubleJacobian(x, y, z *big.Int) (*big.Int, *big.Int,
x3 := new(big.Int).Mul(alpha, alpha)
beta8 := new(big.Int).Lsh(beta, 3)
+ beta8.Mod(beta8, curve.P)
x3.Sub(x3, beta8)
- for x3.Sign() == -1 {
+ if x3.Sign() == -1 {
x3.Add(x3, curve.P)
}
x3.Mod(x3, curve.P)
diff --git a/src/net/lookup_test.go b/src/net/lookup_test.go
index 24787ccf2b..01901e6217 100644
--- a/src/net/lookup_test.go
+++ b/src/net/lookup_test.go
@@ -184,11 +184,16 @@ func TestLookupGmailTXT(t *testing.T) {
if len(txts) == 0 {
t.Error("got no record")
}
+ found := false
for _, txt := range txts {
- if !strings.Contains(txt, tt.txt) || (!strings.HasSuffix(txt, tt.host) && !strings.HasSuffix(txt, tt.host+".")) {
- t.Errorf("got %s; want a record containing %s, %s", txt, tt.txt, tt.host)
+ if strings.Contains(txt, tt.txt) && (strings.HasSuffix(txt, tt.host) || strings.HasSuffix(txt, tt.host+".")) {
+ found = true
+ break
}
}
+ if !found {
+ t.Errorf("got %v; want a record containing %s, %s", txts, tt.txt, tt.host)
+ }
}
}