]> gitweb.factorcode.org Git - factor.git/blob - basis/checksums/hmac/hmac-tests.factor
basis: Cleaning up tests using lists and IN: forms.
[factor.git] / basis / checksums / hmac / hmac-tests.factor
1 USING: checksums.hmac checksums.md5 checksums.sha math.parser
2 sequences strings tools.test ;
3
4 {
5     "\u000092\u000094rz68\u0000bb\u00001c\u000013\u0000f4\u00008e\u0000f8\u000015\u00008b\u0000fc\u00009d"
6 } [
7     "Hi There" 16 11 <string> md5 hmac-bytes >string ] unit-test
8
9 { "u\u00000cx>j\u0000b0\u0000b5\u000003\u0000ea\u0000a8n1\n]\u0000b78" }
10 [ "what do ya want for nothing?" "Jefe" md5 hmac-bytes >string ] unit-test
11
12 {
13     "V\u0000be4R\u00001d\u000014L\u000088\u0000db\u0000b8\u0000c73\u0000f0\u0000e8\u0000b3\u0000f6"
14 }
15 [
16     50 0xdd <repetition>
17     16 0xaa <string> md5 hmac-bytes >string
18 ] unit-test
19
20 {
21     "g[\u00000b:\eM\u0000dfN\u000012Hr\u0000dal/c+\u0000fe\u0000d9W\u0000e9"
22 } [
23     "Hi There" 16 11 <string> sha1 hmac-bytes >string
24 ] unit-test
25
26 {
27     "\u0000ef\u0000fc\u0000dfj\u0000e5\u0000eb/\u0000a2\u0000d2t\u000016\u0000d5\u0000f1\u000084\u0000df\u00009c%\u00009a|y"
28 } [
29     "what do ya want for nothing?" "Jefe" sha1 hmac-bytes >string
30 ] unit-test
31
32 {
33     "\u0000d70YM\u000016~5\u0000d5\u000095o\u0000d8\0=\r\u0000b3\u0000d3\u0000f4m\u0000c7\u0000bb"
34 } [
35     50 0xdd <repetition>
36     16 0xaa <string> sha1 hmac-bytes >string
37 ] unit-test
38
39 { "b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7" }
40 [ "Hi There" 20 0xb <string> sha-256 hmac-bytes bytes>hex-string ] unit-test
41
42 { "167f928588c5cc2eef8e3093caa0e87c9ff566a14794aa61648d81621a2a40c6" }
43 [
44     "what do ya want for nothing?"
45     "JefeJefeJefeJefeJefeJefeJefeJefe" sha-256 hmac-bytes bytes>hex-string
46 ] unit-test