changed PWSalt default size to 32 bytes (256 bits)
This commit is contained in:
parent
570cfe4af2
commit
2cb10b263e
@ -115,7 +115,7 @@ newPWSalt
|
|||||||
-> (PWSalt, g)
|
-> (PWSalt, g)
|
||||||
-- ^ the result and new random generator
|
-- ^ the result and new random generator
|
||||||
newPWSalt g = (result, g2) where
|
newPWSalt g = (result, g2) where
|
||||||
result = B.pack $ take 256 $ randoms g1
|
result = B.pack $ take 32 $ randoms g1
|
||||||
(g1, g2) = split g
|
(g1, g2) = split g
|
||||||
|
|
||||||
-- | validates a password database
|
-- | validates a password database
|
||||||
|
@ -36,7 +36,7 @@ tests = TestLabel "newPWSalt" $ TestList
|
|||||||
(salt', _) = newPWSalt g'
|
(salt', _) = newPWSalt g'
|
||||||
g = mkStdGen 1
|
g = mkStdGen 1
|
||||||
|
|
||||||
testLength x = TestLabel "salt length" $ B.length x ~?= 256
|
testLength x = TestLabel "salt length" $ B.length x ~?= 32
|
||||||
|
|
||||||
testDiff x y = TestLabel "different generators" $ TestCase $
|
testDiff x y = TestLabel "different generators" $ TestCase $
|
||||||
assertBool "salts match" $ x /= y
|
assertBool "salts match" $ x /= y
|
||||||
|
Loading…
x
Reference in New Issue
Block a user