Skip to content

Commit

Permalink
crypto.pbkdf2: move extensive test cases to https://github.com/vlang/…
Browse files Browse the repository at this point in the history
…slower_tests, but keep `test case 7`, where the key_size is > block_size for sha224 and sha256
  • Loading branch information
spytheman committed Sep 13, 2024
1 parent b49e796 commit 56013a4
Showing 1 changed file with 0 additions and 57 deletions.
57 changes: 0 additions & 57 deletions vlib/crypto/pbkdf2/pbkdf2_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -49,41 +49,6 @@ const cases = [
sha384: '559726be38db125bc85ed7895f6e3cf574c7a01c'
sha512: 'd197b1b33db0143e018b12f3d1d1479e6cdebdcc'
},
/* this test takes several minutes
TestCaseData{
name: 'test case 4'
password: 'password'
salt: 'salt'
count: 16777216
key_length: 20
sha224: 'b49925184cb4b559f365e94fcafcd4cdb9f7aef4'
sha256: 'cf81c66fe8cfc04d1f31ecb65dab4089f7f179e8'
sha384: 'a7fdb349ba2bfa6bf647bb0161bae1320df27e64'
sha512: '6180a3ceabab45cc3964112c811e0131bca93a35'
},
*/
TestCaseData{
name: 'test case 5'
password: 'passwordPASSWORDpassword'
salt: 'saltSALTsaltSALTsaltSALTsaltSALTsalt'
count: 4096
key_length: 25
sha224: '056c4ba438ded91fc14e0594e6f52b87e1f3690c0dc0fbc057'
sha256: '348c89dbcbd32b2f32d814b8116e84cf2b17347ebc1800181c'
sha384: '819143ad66df9a552559b9e131c52ae6c5c1b0eed18f4d283b'
sha512: '8c0511f4c6e597c6ac6315d8f0362e225f3c501495ba23b868'
},
TestCaseData{
name: 'test case 6'
password: 'pass\0word'
salt: 'sa\0lt'
count: 4096
key_length: 16
sha224: '9b4011b641f40a2a500a31d4a392d15c'
sha256: '89b69d0516f829893c696226650a8687'
sha384: 'a3f00ac8657e095f8e0823d232fc60b3'
sha512: '9d9e9c4cd21fe4be24d5b8244c759665'
},
TestCaseData{
name: 'test case 7'
password: 'passwd'
Expand All @@ -95,28 +60,6 @@ const cases = [
sha384: 'cd3443723a41cf1460cca9efeede428a8898a82d2ad4d1fc5cca08ed3f4d3cb47a62a70b3cb9ce65dcbfb9fb9d425027a8be69b53e2a22674b0939e5e0a682f76d21f449ad184562a3bc4c519b4d048de6d8e0999fb88770f95e40185e19fc8b68767417ccc064f47a455d045b3bafda7e81b97ad0e4c5581af1aa27871cd5e4'
sha512: 'c74319d99499fc3e9013acff597c23c5baf0a0bec5634c46b8352b793e324723d55caa76b2b25c43402dcfdc06cdcf66f95b7d0429420b39520006749c51a04ef3eb99e576617395a178ba33214793e48045132928a9e9bf2661769fdc668f31798597aaf6da70dd996a81019726084d70f152baed8aafe2227c07636c6ddece'
},
TestCaseData{
name: 'test case 8'
password: 'Password'
salt: 'NaCl'
count: 80000
key_length: 128
sha224: 'bebbdf809d53fc84531d0abe06679a8c8526fde47b47245634186908335857334a7578543f9241726d845ee8e575105e4a733b5dcaefa7560af3d028eccf95937535918dbaa84269fc0586711e7a5b9dc0d4c28fc7a89469db7ff5829b8fc1ef709d7ef95c6c7db24cece88f7c1408c8e7cee55c84db0eebb8d8e419bb50e17b'
sha256: '4ddcd8f60b98be21830cee5ef22701f9641a4418d04c0414aeff08876b34ab56a1d425a1225833549adb841b51c9b3176a272bdebba1d078478f62b397f33c8d62aae85a11cdde829d89cb6ffd1ab0e63a981f8747d2f2f9fe5874165c83c168d2eed1d2d5ca4052dec2be5715623da019b8c0ec87dc36aa751c38f9893d15c3'
sha384: '11c198987730fa113458053cd5cc9b51d7024a35f9134f1ee8740923c901aab23bbaea43686981b6e6a9f4130a1401daeeec74060246ebac958f3cfc3c65579b6e3d08b94ade5fc257a6902a0a1664b8dbd5a8ae2af70438931d3f3679abffc7a17770582f1ee413cc0d9914ce5f8143c8a7dc9c43fbc31e3d41b2030fb73c02'
sha512: 'e6337d6fbeb645c794d4a9b5b75b7b30dac9ac50376a91df1f4460f6060d5addb2c1fd1f84409abacc67de7eb4056e6bb06c2d82c3ef4ccd1bded0f675ed97c65c33d39f81248454327aa6d03fd049fc5cbb2b5e6dac08e8ace996cdc960b1bd4530b7e754773d75f67a733fdb99baf6470e42ffcb753c15c352d4800fb6f9d6'
},
TestCaseData{
name: 'test case 9'
password: 'Password'
salt: 'sa\0lt'
count: 4096
key_length: 256
sha224: 'a329a360c825e12e454ad8633a842a06ba1456907770779d1fa4e0b61a5b1c6ce02e71de74ae433bbf14b907690d008d0cab5b01c976c1e627b027a9a809fd001082c809650344ecfcdebdf0d64b92cb1e869bf91b75517ea36918127b1eccc4cac145fb965071292a6dfa388d8ad893d2541f83a0dac1c55d2d90709963b066de985e92974e87b7d8c0e8026d96684bb0425203919b4792962b065e2b2b815ba888b8428ae51f57a74f637a658e27cf5fbc5593e85f775a1f81660850a723e2eb565f30dfc2cf2973ad57ec95b89c0979c7bab81c11d8987540a32badb2f7bbe4ff21a4f0d91dbd911b88ddd928603fd27b0ede994ee99edd2c04667b82067f'
sha256: '436c82c6af9010bb0fdb274791934ac7dee21745dd11fb57bb90112ab187c495ad82df776ad7cefb606f34fedca59baa5922a57f3e91bc0e11960da7ec87ed0471b456a0808b60dff757b7d313d4068bf8d337a99caede24f3248f87d1bf16892b70b076a07dd163a8a09db788ae34300ff2f2d0a92c9e678186183622a636f4cbce15680dfea46f6d224e51c299d4946aa2471133a649288eef3e4227b609cf203dba65e9fa69e63d35b6ff435ff51664cbd6773d72ebc341d239f0084b004388d6afa504eee6719a7ae1bb9daf6b7628d851fab335f1d13948e8ee6f7ab033a32df447f8d0950809a70066605d6960847ed436fa52cdfbcf261b44d2a87061'
sha384: 'cf6f194aaf4e970afea1f41169045029e34759e124a670b5f73053da552a190ad2d7085533b8b22901f0e3caeeb431ba673468f981352dfcbe517699db791777cf52346a460b093c59ea300fb18daee270e2ea8473806da1663cebe7438b51fe56ba832c13d88ad5b2e46404457c34cc6ad8e5cd8707a1acfa737f3617628a5983d8d10fa16a92652cfa736d4610132710a517c216cc3252e6c2b8aae0275d04a49756fa5bf1bb067bc367d1b8c80c3df7dc22ee74b4be4150871624bfdde3f86f5fbd4e0828af7d5a4f01b5605e54471435d827eaecf199db315ae60d1a6350105c0e1a71b40518a4a66ebba4792a511f8f52aeac961ebea215f8fb89ba998b'
sha512: '10176fb32cb98cd7bb31e2bb5c8f6e425c103333a2e496058e3fd2bd88f657485c89ef92daa0668316bc23ebd1ef88f6dd14157b2320b5d54b5f26377c5dc279b1dcdec044bd6f91b166917c80e1e99ef861b1d2c7bce1b961178125fb86867f6db489a2eae0022e7bc9cf421f044319fac765d70cb89b45c214590e2ffb2c2b565ab3b9d07571fde0027b1dc57f8fd25afa842c1056dd459af4074d7510a0c020b914a5e202445d4d3f151070589dd6a2554fc506018c4f001df6239643dc86771286ae4910769d8385531bba57544d63c3640b90c98f1445ebdd129475e02086b600f0beb5b05cc6ca9b3633b452b7dad634e9336f56ec4c3ac0b4fe54ced8'
},
]

fn test_sha224() {
Expand Down

0 comments on commit 56013a4

Please sign in to comment.