Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 50 lines (39 sloc) 1.48 kB
058802f Add comment to tests.scm
Eric Knauel authored
1 ;;; test cases (SRFI-78) for SHA-1
2 ;;;
3 ;;; taken from:
4 ;;; Federal Information Processing Standard Publication 180-1
5 ;;; Secure Hash Standard
6 ;;; April 1995
7 ;;; available from
8 ;;; <http://www.itl.nist.gov/fipspubs/fip180-1.htm>
9
18f30e1 Add test-suite for SHA1 code
Eric Knauel authored
10 (check
11 (sha1-hash-string "")
12 => #xda39a3ee5e6b4b0d3255bfef95601890afd80709)
13
14 (check
15 (sha1-hash-string "a")
16 => #x86f7e437faa5a7fce15d1ddcb9eaeaea377667b8)
17
18 (check
19 (sha1-hash-string "abc")
20 => #xa9993e364706816aba3e25717850c26c9cd0d89d)
21
22 (check
23 (sha1-hash-string "message digest")
24 => #xc12252ceda8be8994d5fa0290a47231c1d16aae3)
25
26 (check
27 (sha1-hash-string "abcdefghijklmnopqrstuvwxyz")
28 => #x32d10c7b8cf96570ca04ce37f2a19d84240d3a89)
29
30 (check
31 (sha1-hash-string "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")
32 => #x761c457bf73b14d27e9e9265c46f4b4dda11f940)
33
34 (check
35 (sha1-hash-string "12345678901234567890123456789012345678901234567890123456789012345678901234567890")
36 => #x50abf5706a150990a08b2c5ea40fa0e585554732)
37
38 (check
39 (sha1-hash-string "MD5 has not yet (2001-09-03) been broken, but sufficient attacks have been made that its security is in some doubt")
40 => #x18eca4333979c4181199b7b4fab8786d16cf2846)
41
42 (check
43 (sha1-hash-string "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq")
44 => #x84983e441c3bd26ebaae4aa1f95129e5e54670f1)
45
46 ;;; run this test only if you want to burn many cpu cycles...
47 ;(check
48 ; (sha1-hash-string (make-string 1000000 #\a))
49 ; => #x34aa973cd4c4daa4f61eeb2bdbad27316534016f)
Something went wrong with that request. Please try again.