;;;; md5-test.scm -*- Scheme -*- ;;;; Kon Lovett, Jul '18 (import test) (test-begin "Md5") ;;; (import md5) ;; (import message-digest-primitive) (test-group "MD5 Primitive" (let ((md5 (md5-primitive))) (test-assert (message-digest-primitive? md5)) (test 'md5 (message-digest-primitive-name md5)) ;FIXME this is an impl detail that shouldn't be tested (test-assert (not (equal? (message-digest-primitive-update md5) (message-digest-primitive-raw-update md5)))) ) ) #| (test-group "MD5 Strings" (test-group "RFC1321 tests" (test "d41d8cd98f00b204e9800998ecf8427e" (message-digest-string (md5-primitive) "")) (test "0cc175b9c0f1b6a831c399e269772661" (message-digest-string (md5-primitive) "a")) (test "900150983cd24fb0d6963f7d28e17f72" (message-digest-string (md5-primitive) "abc")) (test "f96b697d7cb7938d525a2f31aaf161d0" (message-digest-string (md5-primitive) "message digest")) (test "c3fcd3d76192e4007dfb496cca67e13b" (message-digest-string (md5-primitive) "abcdefghijklmnopqrstuvwxyz")) (test "d174ab98d277d9f5a5611c2c9f419d9f" (message-digest-string (md5-primitive) "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")) (test "57edf4a22be3c955ac49da2e2107b67a" (message-digest-string (md5-primitive) "12345678901234567890123456789012345678901234567890123456789012345678901234567890"))) ;; These tests from "a fast implementation of MD5" for CL: ;; http://www.pmsf.de/resources/lisp/MD5.html (test-group "Padding tests" ;; From padding bug report by Edi Weitz (test "d734945e5930bb28859ccd13c830358b" (message-digest-string (md5-primitive) "1631901HERR BUCHHEISTERCITROEN NORD1043360796beckenbauer")) ;; Test padding for strings from 0 to 69*8 bits in size. (test "d41d8cd98f00b204e9800998ecf8427e" (message-digest-string (md5-primitive) "")) (test "0cc175b9c0f1b6a831c399e269772661" (message-digest-string (md5-primitive) "a")) (test "4124bc0a9335c27f086f24ba207a4912" (message-digest-string (md5-primitive) "aa")) (test "47bce5c74f589f4867dbd57e9ca9f808" (message-digest-string (md5-primitive) "aaa")) (test "74b87337454200d4d33f80c4663dc5e5" (message-digest-string (md5-primitive) "aaaa")) (test "594f803b380a41396ed63dca39503542" (message-digest-string (md5-primitive) "aaaaa")) (test "0b4e7a0e5fe84ad35fb5f95b9ceeac79" (message-digest-string (md5-primitive) "aaaaaa")) (test "5d793fc5b00a2348c3fb9ab59e5ca98a" (message-digest-string (md5-primitive) "aaaaaaa")) (test "3dbe00a167653a1aaee01d93e77e730e" (message-digest-string (md5-primitive) "aaaaaaaa")) (test "552e6a97297c53e592208cf97fbb3b60" (message-digest-string (md5-primitive) "aaaaaaaaa")) (test "e09c80c42fda55f9d992e59ca6b3307d" (message-digest-string (md5-primitive) "aaaaaaaaaa")) (test "d57f21e6a273781dbf8b7657940f3b03" (message-digest-string (md5-primitive) "aaaaaaaaaaa")) (test "45e4812014d83dde5666ebdf5a8ed1ed" (message-digest-string (md5-primitive) "aaaaaaaaaaaa")) (test "c162de19c4c3731ca3428769d0cd593d" (message-digest-string (md5-primitive) "aaaaaaaaaaaaa")) (test "451599a5f9afa91a0f2097040a796f3d" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaa")) (test "12f9cf6998d52dbe773b06f848bb3608" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaa")) (test "23ca472302f49b3ea5592b146a312da0" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaa")) (test "88e42e96cc71151b6e1938a1699b0a27" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaa")) (test "2c60c24e7087e18e45055a33f9a5be91" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaa")) (test "639d76897485360b3147e66e0a8a3d6c" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaa")) (test "22d42eb002cefa81e9ad604ea57bc01d" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaa")) (test "bd049f221af82804c5a2826809337c9b" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaa")) (test "ff49cfac3968dbce26ebe7d4823e58bd" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaa")) (test "d95dbfee231e34cccb8c04444412ed7d" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaa")) (test "40edae4bad0e5bf6d6c2dc5615a86afb" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaa")) (test "a5a8bfa3962f49330227955e24a2e67c" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaa")) (test "ae791f19bdf77357ff10bb6b0e97e121" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "aaab9c59a88bf0bdfcb170546c5459d6" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "b0f0545856af1a340acdedce23c54b97" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "f7ce3d7d44f3342107d884bfa90c966a" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "59e794d45697b360e18ba972bada0123" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "3b0845db57c200be6052466f87b2198a" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "5eca9bd3eb07c006cd43ae48dfde7fd3" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "b4f13cb081e412f44e99742cb128a1a5" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "4c660346451b8cf91ef50f4634458d41" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "11db24dc3f6c2145701db08625dd6d76" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "80dad3aad8584778352c68ab06250327" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "1227fe415e79db47285cb2689c93963f" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "8e084f489f1bdf08c39f98ff6447ce6d" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "08b2f2b0864bac1ba1585043362cbec9" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "4697843037d962f62a5a429e611e0f5f" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "10c4da18575c092b486f8ab96c01c02f" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "af205d729450b663f48b11d839a1c8df" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "0d3f91798fac6ee279ec2485b25f1124" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "4c3c7c067634daec9716a80ea886d123" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "d1e358e6e3b707282cdd06e919f7e08c" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "8c6ded4f0af86e0a7e301f8a716c4363" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "4c2d8bcb02d982d7cb77f649c0a2dea8" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "bdb662f765cd310f2a547cab1cfecef6" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "08ff5f7301d30200ab89169f6afdb7af" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "6eb6a030bcce166534b95bc2ab45d9cf" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "1bb77918e5695c944be02c16ae29b25e" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "b6fe77c19f0f0f4946c761d62585bfea" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "e9e7e260dce84ffa6e0e7eb5fd9d37fc" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "eced9e0b81ef2bba605cbc5e2e76a1d0" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "ef1772b6dff9a122358552954ad0df65" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "3b0c8ac703f828b04c6c197006d17218" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "652b906d60af96844ebd21b674f35e93" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "dc2f2f2462a0d72358b2f99389458606" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "762fc2665994b217c52c3c2eb7d9f406" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "cc7ed669cf88f201c3297c6a91e1d18d" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "cced11f7bbbffea2f718903216643648" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "24612f0ce2c9d2cf2b022ef1e027a54f" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "b06521f39153d618550606be297466d5" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "014842d480b571495a4a0363793f7367" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "c743a45e0d2e6a95cb859adae0248435" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "def5d97e01e1219fb2fc8da6c4d6ba2f" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "92cb737f8687ccb93022fdb411a77cca" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "a0d1395c7fb36247bfe2d49376d9d133" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")) (test "ab75504250558b788f99d1ebd219abf2" (message-digest-string (md5-primitive) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")))) |# ;;; (test-end "Md5") (test-exit)