aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/crypto_test.go
diff options
context:
space:
mode:
authorGustav Simonsson <gustav.simonsson@gmail.com>2015-09-30 01:37:44 +0800
committerGustav Simonsson <gustav.simonsson@gmail.com>2015-11-30 20:43:32 +0800
commitc8ad64f33cd04fc10ac6681260ea06e464908c91 (patch)
treebd48055c50b57e2b17ca0bde4e9e5ae9ba7ca5ce /crypto/crypto_test.go
parent27a50c8f4bc69f98e20db361859bfbb6cf371c00 (diff)
downloadgo-tangerine-c8ad64f33cd04fc10ac6681260ea06e464908c91.tar
go-tangerine-c8ad64f33cd04fc10ac6681260ea06e464908c91.tar.gz
go-tangerine-c8ad64f33cd04fc10ac6681260ea06e464908c91.tar.bz2
go-tangerine-c8ad64f33cd04fc10ac6681260ea06e464908c91.tar.lz
go-tangerine-c8ad64f33cd04fc10ac6681260ea06e464908c91.tar.xz
go-tangerine-c8ad64f33cd04fc10ac6681260ea06e464908c91.tar.zst
go-tangerine-c8ad64f33cd04fc10ac6681260ea06e464908c91.zip
crypto, crypto/ecies, crypto/secp256k1: libsecp256k1 scalar mult
thanks to Felix Lange (fjl) for help with design & impl
Diffstat (limited to 'crypto/crypto_test.go')
-rw-r--r--crypto/crypto_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/crypto_test.go b/crypto/crypto_test.go
index fdd9c1ee8..d5e19a4bb 100644
--- a/crypto/crypto_test.go
+++ b/crypto/crypto_test.go
@@ -181,7 +181,7 @@ func TestValidateSignatureValues(t *testing.T) {
minusOne := big.NewInt(-1)
one := common.Big1
zero := common.Big0
- secp256k1nMinus1 := new(big.Int).Sub(secp256k1n, common.Big1)
+ secp256k1nMinus1 := new(big.Int).Sub(secp256k1.N, common.Big1)
// correct v,r,s
check(true, 27, one, one)
@@ -208,9 +208,9 @@ func TestValidateSignatureValues(t *testing.T) {
// correct sig with max r,s
check(true, 27, secp256k1nMinus1, secp256k1nMinus1)
// correct v, combinations of incorrect r,s at upper limit
- check(false, 27, secp256k1n, secp256k1nMinus1)
- check(false, 27, secp256k1nMinus1, secp256k1n)
- check(false, 27, secp256k1n, secp256k1n)
+ check(false, 27, secp256k1.N, secp256k1nMinus1)
+ check(false, 27, secp256k1nMinus1, secp256k1.N)
+ check(false, 27, secp256k1.N, secp256k1.N)
// current callers ensures r,s cannot be negative, but let's test for that too
// as crypto package could be used stand-alone