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

« back to all changes in this revision

Viewing changes to testsuite/cast128-test.c

  • Committer: Package Import Robot
  • Author(s): Magnus Holmgren
  • Date: 2013-05-07 22:57:14 UTC
  • mfrom: (8.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20130507225714-s331yr8ov53dtt17
Tags: 2.7-2
Tag some (ECC related) symbols that only exist on some architectures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include "testutils.h"
2
2
#include "cast128.h"
3
3
 
4
 
int
 
4
void
5
5
test_main(void)
6
6
{
7
7
  /* Test vectors from B.1. Single Plaintext-Key-Ciphertext Sets, RFC
9
9
 
10
10
  /* 128 bit key */
11
11
  test_cipher(&nettle_cast128,
12
 
              HL("01 23 45 67 12 34 56 78"
13
 
                 "23 45 67 89 34 56 78 9A"),
14
 
              HL("01 23 45 67 89 AB CD EF"),
15
 
              H("23 8B 4F E5 84 7E 44 B2"));
 
12
              SHEX("01 23 45 67 12 34 56 78"
 
13
                   "23 45 67 89 34 56 78 9A"),
 
14
              SHEX("01 23 45 67 89 AB CD EF"),
 
15
              SHEX("23 8B 4F E5 84 7E 44 B2"));
16
16
  
17
17
  /* 80 bit key */
18
18
  test_cipher(&nettle_cast128,
19
 
              HL("01 23 45 67 12 34 56 78 23 45"),
20
 
              HL("01 23 45 67 89 AB CD EF"),
21
 
              H("EB 6A 71 1A 2C 02 27 1B"));
 
19
              SHEX("01 23 45 67 12 34 56 78 23 45"),
 
20
              SHEX("01 23 45 67 89 AB CD EF"),
 
21
              SHEX("EB 6A 71 1A 2C 02 27 1B"));
22
22
 
23
23
  /* 40 bit key */
24
24
  test_cipher(&nettle_cast128,
25
 
              HL("01 23 45 67 12"),
26
 
              HL("01 23 45 67 89 AB CD EF"),
27
 
              H("7A C8 16 D1 6E 9B 30 2E"));
28
 
 
29
 
  SUCCESS();
 
25
              SHEX("01 23 45 67 12"),
 
26
              SHEX("01 23 45 67 89 AB CD EF"),
 
27
              SHEX("7A C8 16 D1 6E 9B 30 2E"));
30
28
}