15 Commits
Author SHA1 Message Date
cuishuang 9e92970a1e bn256: add missing symbols in comment
Change-Id: Ibd48a070bd8ce35ef5795a8b73bc4ecac43a993e
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/611735
Run-TryBot: shuang cui <imcusg@gmail.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-09-10 20:43:33 +00:00
Filippo Valsorda a6a393ffd6 all: bump go.mod version and drop compatibility shims
Also, remove the legacy import annotations.

Fixes golang/go#68147

Change-Id: Ibfcc9322f27224c0ba92ea42cd56912a7d8783fd
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/594256
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2024-06-26 15:12:35 +00:00
cui fliter 9be5aaad42 all: fix a few function names on comments
Change-Id: Iac9c8f06b874e62b56f634dede8757b87514f421
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/442135
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Joedian Reid <joedian@golang.org>
2022-10-12 13:45:58 +00:00
Sad Pencil 6635ad9975 bn256: fix String methods when g.p == nil
Previously, when g.p == nil, String() crashed. In other method like Add(),
a point with g.p == nil is treated as an identity element.

Besides, the following code is the only way to get an identity element
outside the library: g := bn256.G1{}. In this situation, g.p == nil.

For example, the following code will crash:

package main

import (
	"fmt"
	"golang.org/x/crypto/bn256"
)

func main() {
	g := bn256.G1{}
	fmt.Println(g.String())
}

Change-Id: Ied6f7c8197e7b79b0913c000a9cf1cf68f8188a9
GitHub-Last-Rev: 23246486a982ea54d6023726e048c74f02089f25
GitHub-Pull-Request: golang/crypto#75
Reviewed-on: https://go-review.googlesource.com/c/163118
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
2019-02-22 23:45:11 +00:00
Filippo Valsorda a57398324d all: deprecate broken and legacy packages
Fixes golang/go#30141

Change-Id: I76f8eae31cfd6d106440114685cc0d9abba374f8
Reviewed-on: https://go-review.googlesource.com/c/163537
Reviewed-by: Adam Langley <agl@golang.org>
2019-02-22 23:25:34 +00:00
kc1212 8d7daa0c54 bn256: fix gfp12 MulScalar
Previously MulScalar was ignoring the first parameter, which was inconsistent with gfp6 and gfp2.

Change-Id: I4f4a4ca2f07a25176ab159be684a02696f1580ba
GitHub-Last-Rev: ec40c0403614ed56cf329102eb274dc776fa3be8
GitHub-Pull-Request: golang/crypto#67
Reviewed-on: https://go-review.googlesource.com/c/154457
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-01-02 17:18:10 +00:00
ia 027cca12c2 all: gofmt
Just ran

	gofmt -w .

on the project root. That's all.

Change-Id: Ia90223dda399c1df67e7bcf75c6773de63902cc8
GitHub-Last-Rev: 8ba80b96761b077a4e084a93d5f18e6b2f7375ad
GitHub-Pull-Request: golang/crypto#52
Reviewed-on: https://go-review.googlesource.com/119375
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-06-17 04:21:18 +00:00
Filippo Valsorda 8b1d31080a bn256: explicitly fix MakeAffine for ∞
When c = ∞, z = 0 and 0 does not have a modular inverse, triggering
undefined behavior (recently changed to returning nil) in ModInverse.

Unclear how this used to work anyway. Looks like ModInverse was
leaving the receiver untouched, making zInv = 0 when pool = nil.

Fixes golang/go#25199

Change-Id: Ib39abf59f0e71cf43cdb5836142ebdd3b206fb3f
Reviewed-on: https://go-review.googlesource.com/110695
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
2018-05-02 18:48:08 +00:00
Adam Langley 0fcca4842a bn256: don't claim a 128-bit security level.
It's no longer true.

Fixes golang/go#19479

Change-Id: I85b0ce850ebde60b816924a25368208527a8e617
Reviewed-on: https://go-review.googlesource.com/79877
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-31 21:50:28 +00:00
Kevin Burke e8f229864d all: fix errors reported by vet, golint
None are "wrong" per se, but there are a lot of good suggestions and
in one case a docstring that was not present in godoc due to the
presence of an extra newline.

Changed "Id" in struct properties to "ID" in some non-exported
structs. Removed a trailing period from some error messages; I believe
the exact contents of error strings are not covered by the Go
compatibility promise.

Change-Id: I7c620582dc247396f72c52d38c909ccc0ec87b83
Reviewed-on: https://go-review.googlesource.com/80145
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-28 17:48:09 +00:00
David Lazar 3f77d69517 bn256: fix equations in comments
Change-Id: Icb220341756f472ade15f5fc6b91016214233da9
Reviewed-on: https://go-review.googlesource.com/34030
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-12-06 19:59:59 +00:00
David Symonds 1fbbd62cfe crypto: add import comments.
Change-Id: I33240faf1b8620d0cd600de661928d8e422ebdbc
Reviewed-on: https://go-review.googlesource.com/1235
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-09 23:26:36 +00:00
Adam Langley 84f97f92d0 go.crypto/bn256: updates tests in light of b2b2ae1f5140.
https://golang.org/cl/6850091 fixed the bug in question.
This change updates the tests so that they are broken without
that change.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6846091
2012-12-15 14:19:38 -05:00
Adam Langley 4c5258d8b6 go.crypto/bn256: ensure that t is initialised correctly.
t caches the value of z squared, but wasn't getting correctly
initialised when the value of z was reset.

R=golang-dev
CC=golang-dev
https://golang.org/cl/6850091
2012-11-22 13:44:59 -05:00
Adam Langley 71484c7202 bn256: add package
Package bn256 implements a particular bilinear group at the 128-bit
security level.

R=golang-dev, remyoudompheng, r, r, akumar
CC=golang-dev
https://golang.org/cl/6402052
2012-07-27 12:54:55 -04:00