diff options
author | Dmitri Shuralyov <dmitshur@google.com> | 2022-04-13 15:33:25 +0000 |
---|---|---|
committer | Dmitri Shuralyov <dmitshur@google.com> | 2022-04-13 15:33:25 +0000 |
commit | ed86dfc4e441ee7597586dd858fb87c987f1f3c8 (patch) | |
tree | 5a8bc12cf9f7ca932a82e4f8564b18ed928a93e9 /src/crypto/elliptic/p256_test.go | |
parent | 4ea866a9969f4ff2ffd975116a17bbe01ce00469 (diff) | |
parent | 346b18ee9d15410ab08dd583787c64dbed0666d2 (diff) | |
download | go-ed86dfc4e441ee7597586dd858fb87c987f1f3c8.tar.gz go-ed86dfc4e441ee7597586dd858fb87c987f1f3c8.zip |
[dev.boringcrypto.go1.17] all: merge go1.17.9 into dev.boringcrypto.go1.17
Change-Id: I65c66a480c706b9bf453e7df68afdb7fc163f58b
Diffstat (limited to 'src/crypto/elliptic/p256_test.go')
-rw-r--r-- | src/crypto/elliptic/p256_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/crypto/elliptic/p256_test.go b/src/crypto/elliptic/p256_test.go index 1435f5e1a5..694186df81 100644 --- a/src/crypto/elliptic/p256_test.go +++ b/src/crypto/elliptic/p256_test.go @@ -153,3 +153,17 @@ func TestP256CombinedMult(t *testing.T) { t.Errorf("1×G + (-1)×G = (%d, %d), should be ∞", x, y) } } + +func TestIssue52075(t *testing.T) { + Gx, Gy := P256().Params().Gx, P256().Params().Gy + scalar := make([]byte, 33) + scalar[32] = 1 + x, y := P256().ScalarBaseMult(scalar) + if x.Cmp(Gx) != 0 || y.Cmp(Gy) != 0 { + t.Errorf("unexpected output (%v,%v)", x, y) + } + x, y = P256().ScalarMult(Gx, Gy, scalar) + if x.Cmp(Gx) != 0 || y.Cmp(Gy) != 0 { + t.Errorf("unexpected output (%v,%v)", x, y) + } +} |