~ubuntu-branches/ubuntu/dapper/nettle/dapper

« back to all changes in this revision

Viewing changes to testsuite/serpent-test.c

  • Committer: Bazaar Package Importer
  • Author(s): Marek Habersack
  • Date: 2004-05-04 15:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20040504155602-7jbhw5mabvwksl3j
Tags: upstream-1.10
ImportĀ upstreamĀ versionĀ 1.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "testutils.h"
 
2
#include "serpent.h"
 
3
 
 
4
int
 
5
test_main(void)
 
6
{
 
7
  /* The first test for each key size from the ecb_vk.txt and ecb_vt.txt
 
8
   * files in the serpent package. */
 
9
 
 
10
  /* 128 bit key */
 
11
 
 
12
  /* vk, 1 */
 
13
  test_cipher(&nettle_serpent128,
 
14
              HL("8000000000000000 0000000000000000"),
 
15
              HL("0000000000000000 0000000000000000"),
 
16
              H("49AFBFAD9D5A3405 2CD8FFA5986BD2DD"));
 
17
 
 
18
  /* vt, 1 */
 
19
  test_cipher(&nettle_serpent128,
 
20
              HL("0000000000000000 0000000000000000"),
 
21
              HL("8000000000000000 0000000000000000"),
 
22
              H("10B5FFB720B8CB90 02A1142B0BA2E94A"));
 
23
 
 
24
  /* 192 bit key */
 
25
 
 
26
  /* vk, 1 */
 
27
  test_cipher(&nettle_serpent192,
 
28
              HL("8000000000000000 0000000000000000"
 
29
                 "0000000000000000"),
 
30
              HL("0000000000000000 0000000000000000"),
 
31
              H("E78E5402C7195568 AC3678F7A3F60C66"));
 
32
 
 
33
  /* vt, 1 */
 
34
  test_cipher(&nettle_serpent192,
 
35
              HL("0000000000000000 0000000000000000"
 
36
                 "0000000000000000"),
 
37
              HL("8000000000000000 0000000000000000"),
 
38
              H("B10B271BA25257E1 294F2B51F076D0D9"));
 
39
 
 
40
  /* 256 bit key */
 
41
 
 
42
  /* vk, 1 */
 
43
  test_cipher(&nettle_serpent256,
 
44
              HL("8000000000000000 0000000000000000"
 
45
                 "0000000000000000 0000000000000000"),
 
46
              HL("0000000000000000 0000000000000000"),
 
47
              H("ABED96E766BF28CB C0EBD21A82EF0819"));
 
48
 
 
49
  /* vt, 1 */
 
50
  test_cipher(&nettle_serpent256,
 
51
              HL("0000000000000000 0000000000000000"
 
52
                 "0000000000000000 0000000000000000"),
 
53
              HL("8000000000000000 0000000000000000"),
 
54
              H("DA5A7992B1B4AE6F 8C004BC8A7DE5520"));
 
55
 
 
56
  SUCCESS();
 
57
}