crypto/elliptic: go 1.5 change to Unmarshal breaks use of non-standard curves

瀏覽次數:299 次
跳到第一則未讀訊息

Felix Lange

未讀,
2015年7月22日 凌晨12:32:412015/7/22
收件者:golang-dev
Hi,

in go-ethereum[1], we use elliptic.{Unmarshal,Marshal} with the secp256k1 curve.
This curve is not strictly supported by package elliptic because it is a short weierstrass curve 
with a=0 whereas the curves in package elliptic have a=-3.

CL 2421 changed elliptic.Unmarshal to verify that the point lies on the curve, but calls
IsOnCurve on CurveParams instead of using the method of the curve interface. This breaks
our use of Unmarshal because CurveParams.IsOnCurve assumes a=-3.

Would you accept a CL that changes elliptic.Unmarshal to call curve.IsOnCurve for Go 1.5,
or is it too late already?

Ian Lance Taylor

未讀,
2015年7月22日 凌晨12:44:432015/7/22
收件者:Felix Lange、golang-dev、Adam Langley
It is probably too late for 1.5, unless this is a real bug. I don't
know enough to tell.

Ian

Adam Langley

未讀,
2015年7月22日 中午12:37:212015/7/22
收件者:Ian Lance Taylor、Felix Lange、golang-dev
On Tue, Jul 21, 2015 at 9:44 PM, Ian Lance Taylor <ia...@golang.org> wrote:
> It is probably too late for 1.5, unless this is a real bug. I don't
> know enough to tell.

This is unfortunate. I've cooked up
https://go-review.googlesource.com/#/c/12506 but I don't know how
frozen 1.5 is now.

Can you confirm that change solves this issue for you at least?


Cheers

AGL

Felix Lange

未讀,
2015年7月22日 下午1:00:402015/7/22
收件者:golang-dev、ia...@golang.org
On Wednesday, July 22, 2015 at 6:37:21 PM UTC+2, agl wrote:

Can you confirm that change solves this issue for you at least?


Yes. It resolves our issue.

Ian Lance Taylor

未讀,
2015年7月22日 下午5:11:422015/7/22
收件者:Adam Langley、Felix Lange、golang-dev
On Wed, Jul 22, 2015 at 9:36 AM, Adam Langley <a...@golang.org> wrote:
> On Tue, Jul 21, 2015 at 9:44 PM, Ian Lance Taylor <ia...@golang.org> wrote:
>> It is probably too late for 1.5, unless this is a real bug. I don't
>> know enough to tell.
>
> This is unfortunate. I've cooked up
> https://go-review.googlesource.com/#/c/12506 but I don't know how
> frozen 1.5 is now.

This can still go in.

Ian

Adam Langley

未讀,
2015年7月22日 下午5:19:382015/7/22
收件者:Ian Lance Taylor、Felix Lange、golang-dev
On Wed, Jul 22, 2015 at 2:11 PM, Ian Lance Taylor <ia...@golang.org> wrote:
> This can still go in.

Yep, thanks. Russ landed it.


Cheers

AGL
回覆所有人
回覆作者
轉寄
0 則新訊息