~ubuntu-branches/ubuntu/utopic/nettle/utopic

« back to all changes in this revision

Viewing changes to testsuite/md2-test.c

  • Committer: Package Import Robot
  • Author(s): Magnus Holmgren
  • Date: 2013-03-24 11:38:21 UTC
  • mto: (1.4.6) (3.1.11 experimental)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: package-import@ubuntu.com-20130324113821-3rsmekqi09c93lnh
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include "testutils.h"
2
2
#include "md2.h"
3
3
 
4
 
int
 
4
void
5
5
test_main(void)
6
6
{
7
7
  /* Testcases from RFC 1319 */
8
 
  test_hash(&nettle_md2, 0, "",
9
 
            H("8350e5a3e24c153df2275c9f80692773"));
10
 
  test_hash(&nettle_md2, LDATA("a"),
11
 
            H("32ec01ec4a6dac72c0ab96fb34c0b5d1"));
12
 
  test_hash(&nettle_md2, LDATA("abc"),
13
 
            H("da853b0d3f88d99b30283a69e6ded6bb"));
14
 
  test_hash(&nettle_md2, LDATA("message digest"),
15
 
            H("ab4f496bfb2a530b219ff33031fe06b0"));
16
 
  test_hash(&nettle_md2, LDATA("abcdefghijklmnopqrstuvwxyz"),
17
 
            H("4e8ddff3650292ab5a4108c3aa47940b"));
 
8
  test_hash(&nettle_md2, SDATA(""),
 
9
            SHEX("8350e5a3e24c153df2275c9f80692773"));
 
10
  test_hash(&nettle_md2, SDATA("a"),
 
11
            SHEX("32ec01ec4a6dac72c0ab96fb34c0b5d1"));
 
12
  test_hash(&nettle_md2, SDATA("abc"),
 
13
            SHEX("da853b0d3f88d99b30283a69e6ded6bb"));
 
14
  test_hash(&nettle_md2, SDATA("message digest"),
 
15
            SHEX("ab4f496bfb2a530b219ff33031fe06b0"));
 
16
  test_hash(&nettle_md2, SDATA("abcdefghijklmnopqrstuvwxyz"),
 
17
            SHEX("4e8ddff3650292ab5a4108c3aa47940b"));
18
18
  test_hash(&nettle_md2,
19
 
            LDATA("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
 
19
            SDATA("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
20
20
                  "0123456789"),
21
 
            H("da33def2a42df13975352846c30338cd"));
22
 
  test_hash(&nettle_md2, LDATA("1234567890123456789012345678901234567890"
 
21
            SHEX("da33def2a42df13975352846c30338cd"));
 
22
  test_hash(&nettle_md2, SDATA("1234567890123456789012345678901234567890"
23
23
                               "1234567890123456789012345678901234567890"),
24
 
            H("d5976f79d83d3a0dc9806c3c66f3efd8"));
25
 
 
26
 
  SUCCESS();
 
24
            SHEX("d5976f79d83d3a0dc9806c3c66f3efd8"));
27
25
}