From 3b29ae3c9985634dda114599699987fd15ad76f1 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sat, 19 Nov 2016 17:13:13 +0100 Subject: [PATCH] Update github.com/elithrar/simple-scrypt Closes #676 --- vendor/manifest | 2 +- vendor/src/github.com/elithrar/simple-scrypt/scrypt.go | 2 +- vendor/src/github.com/elithrar/simple-scrypt/scrypt_test.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vendor/manifest b/vendor/manifest index d9f18b5f4..7deaab850 100644 --- a/vendor/manifest +++ b/vendor/manifest @@ -10,7 +10,7 @@ { "importpath": "github.com/elithrar/simple-scrypt", "repository": "https://github.com/elithrar/simple-scrypt", - "revision": "cbb1ebac08e2ca5495a43f4ef5555e61a7ec7677", + "revision": "2325946f714c95de4a6088202c402fbdfa64163b", "branch": "master" }, { diff --git a/vendor/src/github.com/elithrar/simple-scrypt/scrypt.go b/vendor/src/github.com/elithrar/simple-scrypt/scrypt.go index 1f1c085b6..4e3570ccb 100644 --- a/vendor/src/github.com/elithrar/simple-scrypt/scrypt.go +++ b/vendor/src/github.com/elithrar/simple-scrypt/scrypt.go @@ -260,7 +260,7 @@ func Calibrate(timeout time.Duration, memMiBytes int, params Params) (Params, er var again bool memBytes := memMiBytes << 20 // If we'd use more memory then the allowed, we can tune the memory usage - for 128*p.R*p.N > memBytes { + for 128*int64(p.R)*int64(p.N) > int64(memBytes) { if p.R > 1 { // by lowering r p.R-- diff --git a/vendor/src/github.com/elithrar/simple-scrypt/scrypt_test.go b/vendor/src/github.com/elithrar/simple-scrypt/scrypt_test.go index bf438b190..dbb9bdb28 100644 --- a/vendor/src/github.com/elithrar/simple-scrypt/scrypt_test.go +++ b/vendor/src/github.com/elithrar/simple-scrypt/scrypt_test.go @@ -23,11 +23,11 @@ var testParams = []struct { {true, Params{1048576, 8, 2, 64, 128}}, {false, Params{-1, 8, 1, 16, 32}}, // invalid N {false, Params{0, 8, 1, 16, 32}}, // invalid N - {false, Params{1 << 31, 8, 1, 16, 32}}, // invalid N + {false, Params{1<<31 - 1, 8, 1, 16, 32}}, // invalid N {false, Params{16384, 0, 12, 16, 32}}, // invalid R {false, Params{16384, 8, 0, 16, 32}}, // invalid R > maxInt/128/P {false, Params{16384, 1 << 24, 1, 16, 32}}, // invalid R > maxInt/256 - {false, Params{1 << 31, 8, 0, 16, 32}}, // invalid p < 0 + {false, Params{1<<31 - 1, 8, 0, 16, 32}}, // invalid p < 0 {false, Params{4096, 8, 1, 5, 32}}, // invalid SaltLen {false, Params{4096, 8, 1, 16, 2}}, // invalid DKLen }