mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-01-07 06:59:19 +01:00
Merged RIPEMD-160 support
This commit is contained in:
commit
5862eee4ca
19 changed files with 1232 additions and 128 deletions
1
tests/data_files/hash_file_5
Normal file
1
tests/data_files/hash_file_5
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -82,6 +82,38 @@ generic md5 Test vector RFC1321 #7
|
|||
depends_on:POLARSSL_MD5_C
|
||||
md_text:"md5":"12345678901234567890123456789012345678901234567890123456789012345678901234567890":"57edf4a22be3c955ac49da2e2107b67a"
|
||||
|
||||
ripemd160 Test vector from paper #1
|
||||
depends_on:POLARSSL_RIPEMD160_C
|
||||
md_text:"ripemd160":"":"9c1185a5c5e9fc54612808977ee8f548b2258d31"
|
||||
|
||||
ripemd160 Test vector from paper #2
|
||||
depends_on:POLARSSL_RIPEMD160_C
|
||||
md_text:"ripemd160":"a":"0bdc9d2d256b3ee9daae347be6f4dc835a467ffe"
|
||||
|
||||
ripemd160 Test vector from paper #3
|
||||
depends_on:POLARSSL_RIPEMD160_C
|
||||
md_text:"ripemd160":"abc":"8eb208f7e05d987a9b044a8e98c6b087f15a0bfc"
|
||||
|
||||
ripemd160 Test vector from paper #4
|
||||
depends_on:POLARSSL_RIPEMD160_C
|
||||
md_text:"ripemd160":"message digest":"5d0689ef49d2fae572b881b123a85ffa21595f36"
|
||||
|
||||
ripemd160 Test vector from paper #5
|
||||
depends_on:POLARSSL_RIPEMD160_C
|
||||
md_text:"ripemd160":"abcdefghijklmnopqrstuvwxyz":"f71c27109c692c1b56bbdceb5b9d2865b3708dbc"
|
||||
|
||||
ripemd160 Test vector from paper #6
|
||||
depends_on:POLARSSL_RIPEMD160_C
|
||||
md_text:"ripemd160":"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq":"12a053384a9c0c88e405a06c27dcf49ada62eb2b"
|
||||
|
||||
ripemd160 Test vector from paper #7
|
||||
depends_on:POLARSSL_RIPEMD160_C
|
||||
md_text:"ripemd160":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789":"b0e20b6e3116640286ed3a87a5713079b21f5189"
|
||||
|
||||
ripemd160 Test vector from paper #8
|
||||
depends_on:POLARSSL_RIPEMD160_C
|
||||
md_text:"ripemd160":"12345678901234567890123456789012345678901234567890123456789012345678901234567890":"9b752e45573d4b39f4dbd3323cab82bf63326bfb"
|
||||
|
||||
generic HMAC-MD2 Hash File OpenSSL test #1
|
||||
depends_on:POLARSSL_MD2_C
|
||||
md_hmac:"md2":16:"61616161616161616161616161616161":"b91ce5ac77d33c234e61002ed6":"d5732582f494f5ddf35efd166c85af9c"
|
||||
|
|
@ -146,6 +178,34 @@ generic HMAC-MD5 Test Vector RFC2202 #7
|
|||
depends_on:POLARSSL_MD5_C
|
||||
md_hmac:"md5":16:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa":"54657374205573696e67204c6172676572205468616e20426c6f636b2d53697a65204b657920616e64204c6172676572205468616e204f6e6520426c6f636b2d53697a652044617461":"6f630fad67cda0ee1fb1f562db3aa53e"
|
||||
|
||||
HMAC-RIPEMD160 Test vector RFC 2286 #1
|
||||
depends_on:POLARSSL_RIPEMD160_C
|
||||
md_hmac:"ripemd160":20:"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b":"4869205468657265":"24cb4bd67d20fc1a5d2ed7732dcc39377f0a5668"
|
||||
|
||||
HMAC-RIPEMD160 Test vector RFC 2286 #2
|
||||
depends_on:POLARSSL_RIPEMD160_C
|
||||
md_hmac:"ripemd160":20:"4a656665":"7768617420646f2079612077616e7420666f72206e6f7468696e673f":"dda6c0213a485a9e24f4742064a7f033b43c4069"
|
||||
|
||||
HMAC-RIPEMD160 Test vector RFC 2286 #3
|
||||
depends_on:POLARSSL_RIPEMD160_C
|
||||
md_hmac:"ripemd160":20:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa":"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd":"b0b105360de759960ab4f35298e116e295d8e7c1"
|
||||
|
||||
HMAC-RIPEMD160 Test vector RFC 2286 #4
|
||||
depends_on:POLARSSL_RIPEMD160_C
|
||||
md_hmac:"ripemd160":20:"0102030405060708090a0b0c0d0e0f10111213141516171819":"cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd":"d5ca862f4d21d5e610e18b4cf1beb97a4365ecf4"
|
||||
|
||||
HMAC-RIPEMD160 Test vector RFC 2286 #5
|
||||
depends_on:POLARSSL_RIPEMD160_C
|
||||
md_hmac:"ripemd160":20:"0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c":"546573742057697468205472756e636174696f6e":"7619693978f91d90539ae786500ff3d8e0518e39"
|
||||
|
||||
HMAC-RIPEMD160 Test vector RFC 2286 #6
|
||||
depends_on:POLARSSL_RIPEMD160_C
|
||||
md_hmac:"ripemd160":20:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa":"54657374205573696e67204c6172676572205468616e20426c6f636b2d53697a65204b6579202d2048617368204b6579204669727374":"6466ca07ac5eac29e1bd523e5ada7605b791fd8b"
|
||||
|
||||
HMAC-RIPEMD160 Test vector RFC 2286 #7
|
||||
depends_on:POLARSSL_RIPEMD160_C
|
||||
md_hmac:"ripemd160":20:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa":"54657374205573696e67204c6172676572205468616e20426c6f636b2d53697a65204b657920616e64204c6172676572205468616e204f6e6520426c6f636b2d53697a652044617461":"69ea60798d71616cce5fd0871e23754cd75d5a0a"
|
||||
|
||||
generic multi step md2 Test vector RFC1319 #1
|
||||
depends_on:POLARSSL_MD_C:POLARSSL_MD2_C
|
||||
md_text_multi:"md2":"":"8350e5a3e24c153df2275c9f80692773"
|
||||
|
|
@ -950,6 +1010,26 @@ generic multi step SHA-512 Test Vector NIST CAVS #8
|
|||
depends_on:POLARSSL_SHA512_C
|
||||
md_hex_multi:"sha512":"990d1ae71a62d7bda9bfdaa1762a68d296eee72a4cd946f287a898fbabc002ea941fd8d4d991030b4d27a637cce501a834bb95eab1b7889a3e784c7968e67cbf552006b206b68f76d9191327524fcc251aeb56af483d10b4e0c6c5e599ee8c0fe4faeca8293844a8547c6a9a90d093f2526873a19ad4a5e776794c68c742fb834793d2dfcb7fea46c63af4b70fd11cb6e41834e72ee40edb067b292a794990c288d5007e73f349fb383af6a756b8301ad6e5e0aa8cd614399bb3a452376b1575afa6bdaeaafc286cb064bb91edef97c632b6c1113d107fa93a0905098a105043c2f05397f702514439a08a9e5ddc196100721d45c8fc17d2ed659376f8a00bd5cb9a0860e26d8a29d8d6aaf52de97e9346033d6db501a35dbbaf97c20b830cd2d18c2532f3a59cc497ee64c0e57d8d060e5069b28d86edf1adcf59144b221ce3ddaef134b3124fbc7dd000240eff0f5f5f41e83cd7f5bb37c9ae21953fe302b0f6e8b68fa91c6ab99265c64b2fd9cd4942be04321bb5d6d71932376c6f2f88e02422ba6a5e2cb765df93fd5dd0728c6abdaf03bce22e0678a544e2c3636f741b6f4447ee58a8fc656b43ef817932176adbfc2e04b2c812c273cd6cbfa4098f0be036a34221fa02643f5ee2e0b38135f2a18ecd2f16ebc45f8eb31b8ab967a1567ee016904188910861ca1fa205c7adaa194b286893ffe2f4fbe0384c2aef72a4522aeafd3ebc71f9db71eeeef86c48394a1c86d5b36c352cc33a0a2c800bc99e62fd65b3a2fd69e0b53996ec13d8ce483ce9319efd9a85acefabdb5342226febb83fd1daf4b24265f50c61c6de74077ef89b6fecf9f29a1f871af1e9f89b2d345cda7499bd45c42fa5d195a1e1a6ba84851889e730da3b2b916e96152ae0c92154b49719841db7e7cc707ba8a5d7b101eb4ac7b629bb327817910fff61580b59aab78182d1a2e33473d05b00b170b29e331870826cfe45af206aa7d0246bbd8566ca7cfb2d3c10bfa1db7dd48dd786036469ce7282093d78b5e1a5b0fc81a54c8ed4ceac1e5305305e78284ac276f5d7862727aff246e17addde50c670028d572cbfc0be2e4f8b2eb28fa68ad7b4c6c2a239c460441bfb5ea049f23b08563b4e47729a59e5986a61a6093dbd54f8c36ebe87edae01f251cb060ad1364ce677d7e8d5a4a4ca966a7241cc360bc2acb280e5f9e9c1b032ad6a180a35e0c5180b9d16d026c865b252098cc1d99ba7375ca31c7702c0d943d5e3dd2f6861fa55bd46d94b67ed3e52eccd8dd06d968e01897d6de97ed3058d91dd":"8e4bc6f8b8c60fe4d68c61d9b159c8693c3151c46749af58da228442d927f23359bd6ccd6c2ec8fa3f00a86cecbfa728e1ad60b821ed22fcd309ba91a4138bc9"
|
||||
|
||||
RIPEMD160 Hash file #0 (from paper)
|
||||
depends_on:POLARSSL_RIPEMD160_C
|
||||
md_file:"ripemd160":"data_files/hash_file_5":"52783243c1697bdbe16d37f97f68f08325dc1528"
|
||||
|
||||
RIPEMD160 Hash file #1
|
||||
depends_on:POLARSSL_RIPEMD160_C
|
||||
md_file:"ripemd160":"data_files/hash_file_1":"82f1d072f0ec0c2b353703a7b575a04c113af1a6"
|
||||
|
||||
RIPEMD160 Hash file #2
|
||||
depends_on:POLARSSL_RIPEMD160_C
|
||||
md_file:"ripemd160":"data_files/hash_file_2":"996fbc8b79206ba7393ebcd246584069b1c08f0f"
|
||||
|
||||
RIPEMD160 Hash file #3
|
||||
depends_on:POLARSSL_RIPEMD160_C
|
||||
md_file:"ripemd160":"data_files/hash_file_3":"8653b46d65998fa8c8846efa17937e742533ae48"
|
||||
|
||||
RIPEMD160 Hash file #4
|
||||
depends_on:POLARSSL_RIPEMD160_C
|
||||
md_file:"ripemd160":"data_files/hash_file_4":"9c1185a5c5e9fc54612808977ee8f548b2258d31"
|
||||
|
||||
generic SHA1 Hash file #1
|
||||
depends_on:POLARSSL_SHA1_C
|
||||
md_file:"sha1":"data_files/hash_file_1":"d21c965b1e768bd7a6aa6869f5f821901d255f9f"
|
||||
|
|
|
|||
|
|
@ -1,11 +1,5 @@
|
|||
/* BEGIN_HEADER */
|
||||
#include <polarssl/md.h>
|
||||
#include <polarssl/md2.h>
|
||||
#include <polarssl/md4.h>
|
||||
#include <polarssl/md5.h>
|
||||
#include <polarssl/sha1.h>
|
||||
#include <polarssl/sha256.h>
|
||||
#include <polarssl/sha512.h>
|
||||
/* END_HEADER */
|
||||
|
||||
/* BEGIN_DEPENDENCIES
|
||||
|
|
|
|||
|
|
@ -1,219 +1,227 @@
|
|||
md2 Test vector RFC1319 #1
|
||||
depends_on:POLARSSL_MD2_C
|
||||
md2_text:"":"8350e5a3e24c153df2275c9f80692773"
|
||||
|
||||
md2 Test vector RFC1319 #2
|
||||
depends_on:POLARSSL_MD2_C
|
||||
md2_text:"a":"32ec01ec4a6dac72c0ab96fb34c0b5d1"
|
||||
|
||||
md2 Test vector RFC1319 #3
|
||||
depends_on:POLARSSL_MD2_C
|
||||
md2_text:"abc":"da853b0d3f88d99b30283a69e6ded6bb"
|
||||
|
||||
md2 Test vector RFC1319 #4
|
||||
depends_on:POLARSSL_MD2_C
|
||||
md2_text:"message digest":"ab4f496bfb2a530b219ff33031fe06b0"
|
||||
|
||||
md2 Test vector RFC1319 #5
|
||||
depends_on:POLARSSL_MD2_C
|
||||
md2_text:"abcdefghijklmnopqrstuvwxyz":"4e8ddff3650292ab5a4108c3aa47940b"
|
||||
|
||||
md2 Test vector RFC1319 #6
|
||||
depends_on:POLARSSL_MD2_C
|
||||
md2_text:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789":"da33def2a42df13975352846c30338cd"
|
||||
|
||||
md2 Test vector RFC1319 #7
|
||||
depends_on:POLARSSL_MD2_C
|
||||
md2_text:"12345678901234567890123456789012345678901234567890123456789012345678901234567890":"d5976f79d83d3a0dc9806c3c66f3efd8"
|
||||
|
||||
md4 Test vector RFC1320 #1
|
||||
depends_on:POLARSSL_MD4_C
|
||||
md4_text:"":"31d6cfe0d16ae931b73c59d7e0c089c0"
|
||||
|
||||
md4 Test vector RFC1320 #2
|
||||
depends_on:POLARSSL_MD4_C
|
||||
md4_text:"a":"bde52cb31de33e46245e05fbdbd6fb24"
|
||||
|
||||
md4 Test vector RFC1320 #3
|
||||
depends_on:POLARSSL_MD4_C
|
||||
md4_text:"abc":"a448017aaf21d8525fc10ae87aa6729d"
|
||||
|
||||
md4 Test vector RFC1320 #4
|
||||
depends_on:POLARSSL_MD4_C
|
||||
md4_text:"message digest":"d9130a8164549fe818874806e1c7014b"
|
||||
|
||||
md4 Test vector RFC1320 #5
|
||||
depends_on:POLARSSL_MD4_C
|
||||
md4_text:"abcdefghijklmnopqrstuvwxyz":"d79e1c308aa5bbcdeea8ed63df412da9"
|
||||
|
||||
md4 Test vector RFC1320 #6
|
||||
depends_on:POLARSSL_MD4_C
|
||||
md4_text:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789":"043f8582f241db351ce627e153e7f0e4"
|
||||
|
||||
md4 Test vector RFC1320 #7
|
||||
depends_on:POLARSSL_MD4_C
|
||||
md4_text:"12345678901234567890123456789012345678901234567890123456789012345678901234567890":"e33b4ddc9c38f2199c3e7b164fcc0536"
|
||||
|
||||
md5 Test vector RFC1321 #1
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_text:"":"d41d8cd98f00b204e9800998ecf8427e"
|
||||
|
||||
md5 Test vector RFC1321 #2
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_text:"a":"0cc175b9c0f1b6a831c399e269772661"
|
||||
|
||||
md5 Test vector RFC1321 #3
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_text:"abc":"900150983cd24fb0d6963f7d28e17f72"
|
||||
|
||||
md5 Test vector RFC1321 #4
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_text:"message digest":"f96b697d7cb7938d525a2f31aaf161d0"
|
||||
|
||||
md5 Test vector RFC1321 #5
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_text:"abcdefghijklmnopqrstuvwxyz":"c3fcd3d76192e4007dfb496cca67e13b"
|
||||
|
||||
md5 Test vector RFC1321 #6
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_text:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789":"d174ab98d277d9f5a5611c2c9f419d9f"
|
||||
|
||||
md5 Test vector RFC1321 #7
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_text:"12345678901234567890123456789012345678901234567890123456789012345678901234567890":"57edf4a22be3c955ac49da2e2107b67a"
|
||||
|
||||
ripemd160 Test vector from paper #1
|
||||
ripemd160_text:"":"9c1185a5c5e9fc54612808977ee8f548b2258d31"
|
||||
|
||||
ripemd160 Test vector from paper #2
|
||||
ripemd160_text:"a":"0bdc9d2d256b3ee9daae347be6f4dc835a467ffe"
|
||||
|
||||
ripemd160 Test vector from paper #3
|
||||
ripemd160_text:"abc":"8eb208f7e05d987a9b044a8e98c6b087f15a0bfc"
|
||||
|
||||
ripemd160 Test vector from paper #4
|
||||
ripemd160_text:"message digest":"5d0689ef49d2fae572b881b123a85ffa21595f36"
|
||||
|
||||
ripemd160 Test vector from paper #5
|
||||
ripemd160_text:"abcdefghijklmnopqrstuvwxyz":"f71c27109c692c1b56bbdceb5b9d2865b3708dbc"
|
||||
|
||||
ripemd160 Test vector from paper #6
|
||||
ripemd160_text:"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq":"12a053384a9c0c88e405a06c27dcf49ada62eb2b"
|
||||
|
||||
ripemd160 Test vector from paper #7
|
||||
ripemd160_text:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789":"b0e20b6e3116640286ed3a87a5713079b21f5189"
|
||||
|
||||
ripemd160 Test vector from paper #8
|
||||
ripemd160_text:"12345678901234567890123456789012345678901234567890123456789012345678901234567890":"9b752e45573d4b39f4dbd3323cab82bf63326bfb"
|
||||
|
||||
HMAC-MD2 Hash File OpenSSL test #1
|
||||
depends_on:POLARSSL_MD2_C
|
||||
md2_hmac:16:"61616161616161616161616161616161":"b91ce5ac77d33c234e61002ed6":"d5732582f494f5ddf35efd166c85af9c"
|
||||
|
||||
HMAC-MD2 Hash File OpenSSL test #2
|
||||
depends_on:POLARSSL_MD2_C
|
||||
md2_hmac:16:"61616161616161616161616161616161":"270fcf11f27c27448457d7049a7edb084a3e554e0b2acf5806982213f0ad516402e4c869c4ff2171e18e3489baa3125d2c3056ebb616296f9b6aa97ef68eeabcdc0b6dde47775004096a241efcf0a90d19b34e898cc7340cdc940f8bdd46e23e352f34bca131d4d67a7c2ddb8d0d68b67f06152a128168e1c341c37e0a66c5018999b7059bcc300beed2c19dd1152d2fe062853293b8f3c8b5":"54ab68503f7d1b5c7741340dff2722a9"
|
||||
|
||||
HMAC-MD2 Hash File OpenSSL test #3
|
||||
depends_on:POLARSSL_MD2_C
|
||||
md2_hmac:16:"61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161":"b91ce5ac77d33c234e61002ed6":"d850e5f554558cf0fe79a0612e1d0365"
|
||||
|
||||
HMAC-MD4 Hash File OpenSSL test #1
|
||||
depends_on:POLARSSL_MD4_C
|
||||
md4_hmac:16:"61616161616161616161616161616161":"b91ce5ac77d33c234e61002ed6":"eabd0fbefb82fb0063a25a6d7b8bdc0f"
|
||||
|
||||
HMAC-MD4 Hash File OpenSSL test #2
|
||||
depends_on:POLARSSL_MD4_C
|
||||
md4_hmac:16:"61616161616161616161616161616161":"270fcf11f27c27448457d7049a7edb084a3e554e0b2acf5806982213f0ad516402e4c869c4ff2171e18e3489baa3125d2c3056ebb616296f9b6aa97ef68eeabcdc0b6dde47775004096a241efcf0a90d19b34e898cc7340cdc940f8bdd46e23e352f34bca131d4d67a7c2ddb8d0d68b67f06152a128168e1c341c37e0a66c5018999b7059bcc300beed2c19dd1152d2fe062853293b8f3c8b5":"cec3c5e421a7b783aa89cacf78daf6dc"
|
||||
|
||||
HMAC-MD4 Hash File OpenSSL test #3
|
||||
depends_on:POLARSSL_MD4_C
|
||||
md4_hmac:16:"61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161":"b91ce5ac77d33c234e61002ed6":"ad5f0a04116109b397b57f9cc9b6df4b"
|
||||
|
||||
HMAC-MD5 Hash File OpenSSL test #1
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_hmac:16:"61616161616161616161616161616161":"b91ce5ac77d33c234e61002ed6":"42552882f00bd4633ea81135a184b284"
|
||||
|
||||
HMAC-MD5 Hash File OpenSSL test #2
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_hmac:16:"61616161616161616161616161616161":"270fcf11f27c27448457d7049a7edb084a3e554e0b2acf5806982213f0ad516402e4c869c4ff2171e18e3489baa3125d2c3056ebb616296f9b6aa97ef68eeabcdc0b6dde47775004096a241efcf0a90d19b34e898cc7340cdc940f8bdd46e23e352f34bca131d4d67a7c2ddb8d0d68b67f06152a128168e1c341c37e0a66c5018999b7059bcc300beed2c19dd1152d2fe062853293b8f3c8b5":"a16a842891786d01fe50ba7731db7464"
|
||||
|
||||
HMAC-MD5 Hash File OpenSSL test #3
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_hmac:16:"61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161":"b91ce5ac77d33c234e61002ed6":"e97f623936f98a7f741c4bd0612fecc2"
|
||||
|
||||
HMAC-MD5 Test Vector RFC2202 #1
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_hmac:16:"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b":"4869205468657265":"9294727a3638bb1c13f48ef8158bfc9d"
|
||||
|
||||
HMAC-MD5 Test Vector RFC2202 #2
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_hmac:16:"4a656665":"7768617420646f2079612077616e7420666f72206e6f7468696e673f":"750c783e6ab0b503eaa86e310a5db738"
|
||||
|
||||
HMAC-MD5 Test Vector RFC2202 #3
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_hmac:16:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa":"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd":"56be34521d144c88dbb8c733f0e8b3f6"
|
||||
|
||||
HMAC-MD5 Test Vector RFC2202 #4
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_hmac:16:"0102030405060708090a0b0c0d0e0f10111213141516171819":"cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd":"697eaf0aca3a3aea3a75164746ffaa79"
|
||||
|
||||
HMAC-MD5 Test Vector RFC2202 #5
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_hmac:12:"0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c":"546573742057697468205472756e636174696f6e":"56461ef2342edc00f9bab995"
|
||||
|
||||
HMAC-MD5 Test Vector RFC2202 #6
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_hmac:16:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa":"54657374205573696e67204c6172676572205468616e20426c6f636b2d53697a65204b6579202d2048617368204b6579204669727374":"6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd"
|
||||
|
||||
HMAC-MD5 Test Vector RFC2202 #7
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_hmac:16:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa":"54657374205573696e67204c6172676572205468616e20426c6f636b2d53697a65204b657920616e64204c6172676572205468616e204f6e6520426c6f636b2d53697a652044617461":"6f630fad67cda0ee1fb1f562db3aa53e"
|
||||
|
||||
HMAC-MD2 Bouncy Castle test #1
|
||||
depends_on:POLARSSL_MD2_C
|
||||
md2_hmac:16:"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b":"4869205468657265":"dc1923ef5f161d35bef839ca8c807808"
|
||||
|
||||
HMAC-MD4 Bouncy Castle test #1
|
||||
depends_on:POLARSSL_MD4_C
|
||||
md4_hmac:16:"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b":"4869205468657265":"5570ce964ba8c11756cdc3970278ff5a"
|
||||
|
||||
HMAC-MD5 Bouncy Castle test #1
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_hmac:16:"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b":"4869205468657265":"5ccec34ea9656392457fa1ac27f08fbc"
|
||||
|
||||
HMAC-RIPEMD160 Test vector RFC 2286 #1
|
||||
ripemd160_hmac:20:"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b":"4869205468657265":"24cb4bd67d20fc1a5d2ed7732dcc39377f0a5668"
|
||||
|
||||
HMAC-RIPEMD160 Test vector RFC 2286 #2
|
||||
ripemd160_hmac:20:"4a656665":"7768617420646f2079612077616e7420666f72206e6f7468696e673f":"dda6c0213a485a9e24f4742064a7f033b43c4069"
|
||||
|
||||
HMAC-RIPEMD160 Test vector RFC 2286 #3
|
||||
ripemd160_hmac:20:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa":"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd":"b0b105360de759960ab4f35298e116e295d8e7c1"
|
||||
|
||||
HMAC-RIPEMD160 Test vector RFC 2286 #4
|
||||
ripemd160_hmac:20:"0102030405060708090a0b0c0d0e0f10111213141516171819":"cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd":"d5ca862f4d21d5e610e18b4cf1beb97a4365ecf4"
|
||||
|
||||
HMAC-RIPEMD160 Test vector RFC 2286 #5
|
||||
ripemd160_hmac:20:"0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c":"546573742057697468205472756e636174696f6e":"7619693978f91d90539ae786500ff3d8e0518e39"
|
||||
|
||||
HMAC-RIPEMD160 Test vector RFC 2286 #6
|
||||
ripemd160_hmac:20:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa":"54657374205573696e67204c6172676572205468616e20426c6f636b2d53697a65204b6579202d2048617368204b6579204669727374":"6466ca07ac5eac29e1bd523e5ada7605b791fd8b"
|
||||
|
||||
HMAC-RIPEMD160 Test vector RFC 2286 #7
|
||||
ripemd160_hmac:20:"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa":"54657374205573696e67204c6172676572205468616e20426c6f636b2d53697a65204b657920616e64204c6172676572205468616e204f6e6520426c6f636b2d53697a652044617461":"69ea60798d71616cce5fd0871e23754cd75d5a0a"
|
||||
|
||||
MD2 Hash file #1
|
||||
depends_on:POLARSSL_MD2_C
|
||||
md2_file:"data_files/hash_file_1":"b593c098712d2e21628c8986695451a8"
|
||||
|
||||
MD2 Hash file #2
|
||||
depends_on:POLARSSL_MD2_C
|
||||
md2_file:"data_files/hash_file_2":"3c027b7409909a4c4b26bbab69ad9f4f"
|
||||
|
||||
MD2 Hash file #3
|
||||
depends_on:POLARSSL_MD2_C
|
||||
md2_file:"data_files/hash_file_3":"6bb43eb285e81f414083a94cdbe2989d"
|
||||
|
||||
MD2 Hash file #4
|
||||
depends_on:POLARSSL_MD2_C
|
||||
md2_file:"data_files/hash_file_4":"8350e5a3e24c153df2275c9f80692773"
|
||||
|
||||
MD4 Hash file #1
|
||||
depends_on:POLARSSL_MD4_C
|
||||
md4_file:"data_files/hash_file_1":"8d19772c176bd27153b9486715e2c0b9"
|
||||
|
||||
MD4 Hash file #2
|
||||
depends_on:POLARSSL_MD4_C
|
||||
md4_file:"data_files/hash_file_2":"f2ac53b8542882a5a0007c6f84b4d9fd"
|
||||
|
||||
MD4 Hash file #3
|
||||
depends_on:POLARSSL_MD4_C
|
||||
md4_file:"data_files/hash_file_3":"195c15158e2d07881d9a654095ce4a42"
|
||||
|
||||
MD4 Hash file #4
|
||||
depends_on:POLARSSL_MD4_C
|
||||
md4_file:"data_files/hash_file_4":"31d6cfe0d16ae931b73c59d7e0c089c0"
|
||||
|
||||
MD5 Hash file #1
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_file:"data_files/hash_file_1":"52bcdc983c9ed64fc148a759b3c7a415"
|
||||
|
||||
MD5 Hash file #2
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_file:"data_files/hash_file_2":"d17d466f15891df10542207ae78277f0"
|
||||
|
||||
MD5 Hash file #3
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_file:"data_files/hash_file_3":"d945bcc6200ea95d061a2a818167d920"
|
||||
|
||||
MD5 Hash file #4
|
||||
depends_on:POLARSSL_MD5_C
|
||||
md5_file:"data_files/hash_file_4":"d41d8cd98f00b204e9800998ecf8427e"
|
||||
|
||||
RIPEMD160 Hash file #0 (from paper)
|
||||
ripemd160_file:"data_files/hash_file_5":"52783243c1697bdbe16d37f97f68f08325dc1528"
|
||||
|
||||
RIPEMD160 Hash file #1
|
||||
ripemd160_file:"data_files/hash_file_1":"82f1d072f0ec0c2b353703a7b575a04c113af1a6"
|
||||
|
||||
RIPEMD160 Hash file #2
|
||||
ripemd160_file:"data_files/hash_file_2":"996fbc8b79206ba7393ebcd246584069b1c08f0f"
|
||||
|
||||
RIPEMD160 Hash file #3
|
||||
ripemd160_file:"data_files/hash_file_3":"8653b46d65998fa8c8846efa17937e742533ae48"
|
||||
|
||||
RIPEMD160 Hash file #4
|
||||
ripemd160_file:"data_files/hash_file_4":"9c1185a5c5e9fc54612808977ee8f548b2258d31"
|
||||
|
||||
MD2 Selftest
|
||||
depends_on:POLARSSL_MD2_C:POLARSSL_SELF_TEST
|
||||
md2_selftest:
|
||||
|
||||
MD4 Selftest
|
||||
depends_on:POLARSSL_MD4_C:POLARSSL_SELF_TEST
|
||||
md4_selftest:
|
||||
|
||||
MD5 Selftest
|
||||
depends_on:POLARSSL_MD5_C:POLARSSL_SELF_TEST
|
||||
md5_selftest:
|
||||
|
||||
RIPEMD160 Selftest
|
||||
ripemd160_selftest:
|
||||
|
|
|
|||
|
|
@ -2,23 +2,24 @@
|
|||
#include <polarssl/md2.h>
|
||||
#include <polarssl/md4.h>
|
||||
#include <polarssl/md5.h>
|
||||
#include <polarssl/ripemd160.h>
|
||||
/* END_HEADER */
|
||||
|
||||
/* BEGIN_CASE depends_on:POLARSSL_MD2_C */
|
||||
void md2_text( char *text_src_string, char *hex_hash_string )
|
||||
{
|
||||
unsigned char src_str[1000];
|
||||
unsigned char hash_str[1000];
|
||||
unsigned char output[33];
|
||||
unsigned char src_str[100];
|
||||
unsigned char hash_str[33];
|
||||
unsigned char output[16];
|
||||
|
||||
memset(src_str, 0x00, 1000);
|
||||
memset(hash_str, 0x00, 1000);
|
||||
memset(output, 0x00, 33);
|
||||
memset( src_str, 0x00, sizeof src_str );
|
||||
memset( hash_str, 0x00, sizeof hash_str );
|
||||
memset( output, 0x00, sizeof output );
|
||||
|
||||
strcpy( (char *) src_str, text_src_string );
|
||||
|
||||
md2( src_str, strlen( (char *) src_str ), output );
|
||||
hexify( hash_str, output, 16 );
|
||||
hexify( hash_str, output, sizeof output );
|
||||
|
||||
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
|
||||
}
|
||||
|
|
@ -27,18 +28,18 @@ void md2_text( char *text_src_string, char *hex_hash_string )
|
|||
/* BEGIN_CASE depends_on:POLARSSL_MD4_C */
|
||||
void md4_text( char *text_src_string, char *hex_hash_string )
|
||||
{
|
||||
unsigned char src_str[1000];
|
||||
unsigned char hash_str[1000];
|
||||
unsigned char output[33];
|
||||
unsigned char src_str[100];
|
||||
unsigned char hash_str[33];
|
||||
unsigned char output[16];
|
||||
|
||||
memset(src_str, 0x00, 1000);
|
||||
memset(hash_str, 0x00, 1000);
|
||||
memset(output, 0x00, 33);
|
||||
memset( src_str, 0x00, sizeof src_str );
|
||||
memset( hash_str, 0x00, sizeof hash_str );
|
||||
memset( output, 0x00, sizeof output );
|
||||
|
||||
strcpy( (char *) src_str, text_src_string );
|
||||
|
||||
md4( src_str, strlen( (char *) src_str ), output );
|
||||
hexify( hash_str, output, 16 );
|
||||
hexify( hash_str, output, sizeof output );
|
||||
|
||||
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
|
||||
}
|
||||
|
|
@ -47,18 +48,38 @@ void md4_text( char *text_src_string, char *hex_hash_string )
|
|||
/* BEGIN_CASE depends_on:POLARSSL_MD5_C */
|
||||
void md5_text( char *text_src_string, char *hex_hash_string )
|
||||
{
|
||||
unsigned char src_str[1000];
|
||||
unsigned char hash_str[1000];
|
||||
unsigned char output[33];
|
||||
unsigned char src_str[100];
|
||||
unsigned char hash_str[33];
|
||||
unsigned char output[16];
|
||||
|
||||
memset(src_str, 0x00, 1000);
|
||||
memset(hash_str, 0x00, 1000);
|
||||
memset(output, 0x00, 33);
|
||||
memset( src_str, 0x00, sizeof src_str );
|
||||
memset( hash_str, 0x00, sizeof hash_str );
|
||||
memset( output, 0x00, sizeof output );
|
||||
|
||||
strcpy( (char *) src_str, text_src_string );
|
||||
|
||||
md5( src_str, strlen( (char *) src_str ), output );
|
||||
hexify( hash_str, output, 16 );
|
||||
hexify( hash_str, output, sizeof output );
|
||||
|
||||
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE depends_on:POLARSSL_RIPEMD160_C */
|
||||
void ripemd160_text( char *text_src_string, char *hex_hash_string )
|
||||
{
|
||||
unsigned char src_str[100];
|
||||
unsigned char hash_str[41];
|
||||
unsigned char output[20];
|
||||
|
||||
memset(src_str, 0x00, sizeof src_str);
|
||||
memset(hash_str, 0x00, sizeof hash_str);
|
||||
memset(output, 0x00, sizeof output);
|
||||
|
||||
strcpy( (char *) src_str, text_src_string );
|
||||
|
||||
ripemd160( src_str, strlen( (char *) src_str ), output );
|
||||
hexify( hash_str, output, sizeof output );
|
||||
|
||||
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
|
||||
}
|
||||
|
|
@ -68,22 +89,22 @@ void md5_text( char *text_src_string, char *hex_hash_string )
|
|||
void md2_hmac( int trunc_size, char *hex_key_string, char *hex_src_string,
|
||||
char *hex_hash_string )
|
||||
{
|
||||
unsigned char src_str[10000];
|
||||
unsigned char key_str[10000];
|
||||
unsigned char hash_str[10000];
|
||||
unsigned char output[33];
|
||||
unsigned char src_str[200];
|
||||
unsigned char key_str[200];
|
||||
unsigned char hash_str[33];
|
||||
unsigned char output[16];
|
||||
int key_len, src_len;
|
||||
|
||||
memset(src_str, 0x00, 10000);
|
||||
memset(key_str, 0x00, 10000);
|
||||
memset(hash_str, 0x00, 10000);
|
||||
memset(output, 0x00, 33);
|
||||
memset( src_str, 0x00, sizeof src_str );
|
||||
memset( key_str, 0x00, sizeof key_str );
|
||||
memset( hash_str, 0x00, sizeof hash_str );
|
||||
memset( output, 0x00, sizeof output );
|
||||
|
||||
key_len = unhexify( key_str, hex_key_string );
|
||||
src_len = unhexify( src_str, hex_src_string );
|
||||
|
||||
md2_hmac( key_str, key_len, src_str, src_len, output );
|
||||
hexify( hash_str, output, 16 );
|
||||
hexify( hash_str, output, sizeof output );
|
||||
|
||||
TEST_ASSERT( strncmp( (char *) hash_str, hex_hash_string, trunc_size * 2 ) == 0 );
|
||||
}
|
||||
|
|
@ -93,22 +114,22 @@ void md2_hmac( int trunc_size, char *hex_key_string, char *hex_src_string,
|
|||
void md4_hmac( int trunc_size, char *hex_key_string, char *hex_src_string,
|
||||
char *hex_hash_string )
|
||||
{
|
||||
unsigned char src_str[10000];
|
||||
unsigned char key_str[10000];
|
||||
unsigned char hash_str[10000];
|
||||
unsigned char output[33];
|
||||
unsigned char src_str[200];
|
||||
unsigned char key_str[200];
|
||||
unsigned char hash_str[33];
|
||||
unsigned char output[16];
|
||||
int key_len, src_len;
|
||||
|
||||
memset(src_str, 0x00, 10000);
|
||||
memset(key_str, 0x00, 10000);
|
||||
memset(hash_str, 0x00, 10000);
|
||||
memset(output, 0x00, 33);
|
||||
memset( src_str, 0x00, sizeof src_str );
|
||||
memset( key_str, 0x00, sizeof key_str );
|
||||
memset( hash_str, 0x00, sizeof hash_str );
|
||||
memset( output, 0x00, sizeof output );
|
||||
|
||||
key_len = unhexify( key_str, hex_key_string );
|
||||
src_len = unhexify( src_str, hex_src_string );
|
||||
|
||||
md4_hmac( key_str, key_len, src_str, src_len, output );
|
||||
hexify( hash_str, output, 16 );
|
||||
hexify( hash_str, output, sizeof output );
|
||||
|
||||
TEST_ASSERT( strncmp( (char *) hash_str, hex_hash_string, trunc_size * 2 ) == 0 );
|
||||
}
|
||||
|
|
@ -118,22 +139,47 @@ void md4_hmac( int trunc_size, char *hex_key_string, char *hex_src_string,
|
|||
void md5_hmac( int trunc_size, char *hex_key_string, char *hex_src_string,
|
||||
char *hex_hash_string )
|
||||
{
|
||||
unsigned char src_str[10000];
|
||||
unsigned char key_str[10000];
|
||||
unsigned char hash_str[10000];
|
||||
unsigned char output[33];
|
||||
unsigned char src_str[200];
|
||||
unsigned char key_str[200];
|
||||
unsigned char hash_str[33];
|
||||
unsigned char output[16];
|
||||
int key_len, src_len;
|
||||
|
||||
memset(src_str, 0x00, 10000);
|
||||
memset(key_str, 0x00, 10000);
|
||||
memset(hash_str, 0x00, 10000);
|
||||
memset(output, 0x00, 33);
|
||||
memset( src_str, 0x00, sizeof src_str );
|
||||
memset( key_str, 0x00, sizeof key_str );
|
||||
memset( hash_str, 0x00, sizeof hash_str );
|
||||
memset( output, 0x00, sizeof output );
|
||||
|
||||
key_len = unhexify( key_str, hex_key_string );
|
||||
src_len = unhexify( src_str, hex_src_string );
|
||||
|
||||
md5_hmac( key_str, key_len, src_str, src_len, output );
|
||||
hexify( hash_str, output, 16 );
|
||||
hexify( hash_str, output, sizeof output );
|
||||
|
||||
TEST_ASSERT( strncmp( (char *) hash_str, hex_hash_string, trunc_size * 2 ) == 0 );
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE depends_on:POLARSSL_RIPEMD160_C */
|
||||
void ripemd160_hmac( int trunc_size, char *hex_key_string, char *hex_src_string,
|
||||
char *hex_hash_string )
|
||||
{
|
||||
unsigned char src_str[200];
|
||||
unsigned char key_str[200];
|
||||
unsigned char hash_str[41];
|
||||
unsigned char output[20];
|
||||
int key_len, src_len;
|
||||
|
||||
memset( src_str, 0x00, sizeof src_str );
|
||||
memset( key_str, 0x00, sizeof key_str );
|
||||
memset( hash_str, 0x00, sizeof hash_str );
|
||||
memset( output, 0x00, sizeof output );
|
||||
|
||||
key_len = unhexify( key_str, hex_key_string );
|
||||
src_len = unhexify( src_str, hex_src_string );
|
||||
|
||||
ripemd160_hmac( key_str, key_len, src_str, src_len, output );
|
||||
hexify( hash_str, output, sizeof output );
|
||||
|
||||
TEST_ASSERT( strncmp( (char *) hash_str, hex_hash_string, trunc_size * 2 ) == 0 );
|
||||
}
|
||||
|
|
@ -142,14 +188,14 @@ void md5_hmac( int trunc_size, char *hex_key_string, char *hex_src_string,
|
|||
/* BEGIN_CASE depends_on:POLARSSL_MD2_C:POLARSSL_FS_IO */
|
||||
void md2_file( char *filename, char *hex_hash_string )
|
||||
{
|
||||
unsigned char hash_str[65];
|
||||
unsigned char output[33];
|
||||
unsigned char hash_str[33];
|
||||
unsigned char output[16];
|
||||
|
||||
memset(hash_str, 0x00, 65);
|
||||
memset(output, 0x00, 33);
|
||||
memset( hash_str, 0x00, sizeof hash_str );
|
||||
memset( output, 0x00, sizeof output );
|
||||
|
||||
md2_file( filename, output);
|
||||
hexify( hash_str, output, 16 );
|
||||
hexify( hash_str, output, sizeof output );
|
||||
|
||||
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
|
||||
}
|
||||
|
|
@ -158,14 +204,14 @@ void md2_file( char *filename, char *hex_hash_string )
|
|||
/* BEGIN_CASE depends_on:POLARSSL_MD4_C:POLARSSL_FS_IO */
|
||||
void md4_file( char *filename, char *hex_hash_string )
|
||||
{
|
||||
unsigned char hash_str[65];
|
||||
unsigned char output[33];
|
||||
unsigned char hash_str[33];
|
||||
unsigned char output[16];
|
||||
|
||||
memset(hash_str, 0x00, 65);
|
||||
memset(output, 0x00, 33);
|
||||
memset( hash_str, 0x00, sizeof hash_str );
|
||||
memset( output, 0x00, sizeof output );
|
||||
|
||||
md4_file( filename, output);
|
||||
hexify( hash_str, output, 16 );
|
||||
hexify( hash_str, output, sizeof output );
|
||||
|
||||
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
|
||||
}
|
||||
|
|
@ -174,14 +220,30 @@ void md4_file( char *filename, char *hex_hash_string )
|
|||
/* BEGIN_CASE depends_on:POLARSSL_MD5_C:POLARSSL_FS_IO */
|
||||
void md5_file( char *filename, char *hex_hash_string )
|
||||
{
|
||||
unsigned char hash_str[65];
|
||||
unsigned char output[33];
|
||||
unsigned char hash_str[33];
|
||||
unsigned char output[16];
|
||||
|
||||
memset(hash_str, 0x00, 65);
|
||||
memset(output, 0x00, 33);
|
||||
memset( hash_str, 0x00, sizeof hash_str );
|
||||
memset( output, 0x00, sizeof output );
|
||||
|
||||
md5_file( filename, output);
|
||||
hexify( hash_str, output, 16 );
|
||||
hexify( hash_str, output, sizeof output );
|
||||
|
||||
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE depends_on:POLARSSL_RIPEMD160_C:POLARSSL_FS_IO */
|
||||
void ripemd160_file( char *filename, char *hex_hash_string )
|
||||
{
|
||||
unsigned char hash_str[41];
|
||||
unsigned char output[20];
|
||||
|
||||
memset(hash_str, 0x00, sizeof hash_str );
|
||||
memset(output, 0x00, sizeof output );
|
||||
|
||||
ripemd160_file( filename, output);
|
||||
hexify( hash_str, output, sizeof output );
|
||||
|
||||
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
|
||||
}
|
||||
|
|
@ -207,3 +269,10 @@ void md5_selftest()
|
|||
TEST_ASSERT( md5_self_test( 0 ) == 0 );
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE depends_on:POLARSSL_RIPEMD160_C:POLARSSL_SELF_TEST */
|
||||
void ripemd160_selftest()
|
||||
{
|
||||
TEST_ASSERT( ripemd160_self_test( 0 ) == 0 );
|
||||
}
|
||||
/* END_CASE */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue