diff --git a/internal/edwards25519/const.go b/internal/edwards25519/const.go index 1f2bb66..ce41506 100644 --- a/internal/edwards25519/const.go +++ b/internal/edwards25519/const.go @@ -1,19 +1,13 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Copyright 2019 George Tankersley. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + package edwards25519 -import ( - "math/big" - "sync" - - . "github.com/gtank/ristretto255/internal/edwards25519/internal/edwards25519" -) +import "math/big" var ( - CONST_SQRT_M1, _ = new(big.Int).SetString("19681161376707505956807079304988542015446066515923890162744021073123829784752", 10) - CONST_SQRT_AD_MINUS_ONE, _ = new(big.Int).SetString("25063068953384623474111414158702152701244531502492656460079210482610430750235", 10) - CONST_INVSQRT_A_MINUS_D, _ = new(big.Int).SetString("54469307008909316920995813868745141605393597292927456921205312896311721017578", 10) - CONST_ONE_MINUS_D_SQ, _ = new(big.Int).SetString("1159843021668779879193775521855586647937357759715417654439879720876111806838", 10) - CONST_D_MINUS_ONE_SQ, _ = new(big.Int).SetString("40440834346308536858101042469323190826248399146238708352240133220865137265952", 10) - SQRT_M1 FieldElement SQRT_AD_MINUS_ONE FieldElement INVSQRT_A_MINUS_D FieldElement @@ -21,13 +15,15 @@ var ( D_MINUS_ONE_SQ FieldElement ) -var once sync.Once - func init() { - once.Do(initConstants) -} + var ( + CONST_SQRT_M1, _ = new(big.Int).SetString("19681161376707505956807079304988542015446066515923890162744021073123829784752", 10) + CONST_SQRT_AD_MINUS_ONE, _ = new(big.Int).SetString("25063068953384623474111414158702152701244531502492656460079210482610430750235", 10) + CONST_INVSQRT_A_MINUS_D, _ = new(big.Int).SetString("54469307008909316920995813868745141605393597292927456921205312896311721017578", 10) + CONST_ONE_MINUS_D_SQ, _ = new(big.Int).SetString("1159843021668779879193775521855586647937357759715417654439879720876111806838", 10) + CONST_D_MINUS_ONE_SQ, _ = new(big.Int).SetString("40440834346308536858101042469323190826248399146238708352240133220865137265952", 10) + ) -func initConstants() { feFromBig(&SQRT_M1, CONST_SQRT_M1) feFromBig(&SQRT_AD_MINUS_ONE, CONST_SQRT_AD_MINUS_ONE) feFromBig(&INVSQRT_A_MINUS_D, CONST_INVSQRT_A_MINUS_D) diff --git a/internal/edwards25519/fe.go b/internal/edwards25519/fe.go index 76e5364..403c0d5 100644 --- a/internal/edwards25519/fe.go +++ b/internal/edwards25519/fe.go @@ -1,4 +1,4 @@ -// Copyright 2016 The Go Authors. All rights reserved. +// Copyright 2019 The Go Authors. All rights reserved. // Copyright 2019 George Tankersley. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/internal/edwards25519/xcrypto.go b/internal/edwards25519/xcrypto.go index 7e3e2fa..f6c457a 100644 --- a/internal/edwards25519/xcrypto.go +++ b/internal/edwards25519/xcrypto.go @@ -1,4 +1,4 @@ -// Copyright 2016 The Go Authors. All rights reserved. +// Copyright 2019 The Go Authors. All rights reserved. // Copyright 2019 George Tankersley. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. diff --git a/ristretto255.go b/ristretto255.go index 1f92c58..ed1a39e 100644 --- a/ristretto255.go +++ b/ristretto255.go @@ -1,4 +1,4 @@ -// Copyright 2016 The Go Authors. All rights reserved. +// Copyright 2019 The Go Authors. All rights reserved. // Copyright 2019 George Tankersley. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file.