add pbkdf2 test vectors
This commit is contained in:
parent
5e23ef92a5
commit
dc88806b29
@ -25,6 +25,9 @@ Links
|
||||
* [Salsa128-test-vectors](https://github.com/alexwebr/salsa20/blob/master/test_vectors.128)
|
||||
* [Salsa256-test-vectors](https://github.com/alexwebr/salsa20/blob/master/test_vectors.256)
|
||||
|
||||
* [PBKDF2](http://tools.ietf.org/html/rfc2898)
|
||||
* [PBKDF2-test-vectors](http://www.ietf.org/rfc/rfc6070.txt)
|
||||
|
||||
TODO
|
||||
----
|
||||
|
||||
|
||||
31
tests/KAT_PBKDF2.hs
Normal file
31
tests/KAT_PBKDF2.hs
Normal file
@ -0,0 +1,31 @@
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
-- from <http://www.ietf.org/rfc/rfc6070.txt>
|
||||
module KAT_PBKDF2 (vectors) where
|
||||
|
||||
import Data.ByteString (ByteString)
|
||||
import qualified Data.ByteString as B
|
||||
import Data.ByteString.Char8 ()
|
||||
|
||||
type VectParams = (ByteString, ByteString, Int, Int)
|
||||
|
||||
-- PBKDF-HMAC-SHA1
|
||||
vectors :: [ (VectParams, ByteString) ]
|
||||
vectors =
|
||||
[
|
||||
( ("password","salt",2,20)
|
||||
, "\xea\x6c\x01\x4d\xc7\x2d\x6f\x8c\xcd\x1e\xd9\x2a\xce\x1d\x41\xf0\xd8\xde\x89\x57"
|
||||
)
|
||||
, ( ("password","salt",4096,20)
|
||||
, "\x4b\x00\x79\x01\xb7\x65\x48\x9a\xbe\xad\x49\xd9\x26\xf7\x21\xd0\x65\xa4\x29\xc1"
|
||||
)
|
||||
|
||||
, ( ("passwordPASSWORDpassword", "saltSALTsaltSALTsaltSALTsaltSALTsalt", 4096, 25)
|
||||
, "\x3d\x2e\xec\x4f\xe4\x1c\x84\x9b\x80\xc8\xd8\x36\x62\xc0\xe4\x4a\x8b\x29\x1a\x96\x4c\xf2\xf0\x70\x38"
|
||||
)
|
||||
, ( ("pass\0word", "sa\0lt", 4096, 16)
|
||||
, "\x56\xfa\x6a\xa7\x55\x48\x09\x9d\xcc\x37\xd7\xf0\x34\x25\xe0\xc3"
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user