blob: 966bbfaf95b15346e00f25f1394ceda3ec96f5d6 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Quick & dirty crypto testing module.
3 *
4 * This will only exist until we have a better testing mechanism
5 * (e.g. a char device).
6 *
7 * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
8 * Copyright (c) 2002 Jean-Francois Dive <jef@linuxbe.org>
Mikko Herranene3a4ea42007-11-26 22:12:07 +08009 * Copyright (c) 2007 Nokia Siemens Networks
Linus Torvalds1da177e2005-04-16 15:20:36 -070010 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the Free
Herbert Xuef2736f2005-06-22 13:26:03 -070013 * Software Foundation; either version 2 of the License, or (at your option)
Linus Torvalds1da177e2005-04-16 15:20:36 -070014 * any later version.
15 *
Linus Torvalds1da177e2005-04-16 15:20:36 -070016 */
17#ifndef _CRYPTO_TCRYPT_H
18#define _CRYPTO_TCRYPT_H
19
Herbert Xuda7f0332008-07-31 17:08:25 +080020struct cipher_speed_template {
21 const char *key;
22 unsigned int klen;
Mikko Herranene3a4ea42007-11-26 22:12:07 +080023};
24
Herbert Xue9d41162006-08-19 21:38:49 +100025struct hash_speed {
Michal Ludvige8057922006-05-30 22:04:19 +100026 unsigned int blen; /* buffer length */
27 unsigned int plen; /* per-update length */
28};
29
Andrew Donofrioa28091a2006-12-10 12:10:20 +110030/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070031 * DES test vectors.
32 */
Herbert Xuda7f0332008-07-31 17:08:25 +080033#define DES3_SPEED_VECTORS 1
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
Herbert Xuda7f0332008-07-31 17:08:25 +080035static struct cipher_speed_template des3_speed_template[] = {
36 {
Sebastian Siewiorde224c32008-03-13 20:21:51 +080037 .key = "\x01\x23\x45\x67\x89\xab\xcd\xef"
38 "\x55\x55\x55\x55\x55\x55\x55\x55"
39 "\xfe\xdc\xba\x98\x76\x54\x32\x10",
Linus Torvalds1da177e2005-04-16 15:20:36 -070040 .klen = 24,
Rik Snelf3d10442006-11-29 19:01:41 +110041 }
42};
43
Herbert Xuc907ee72006-08-21 22:04:03 +100044/*
Harald Welteebfd9bc2005-06-22 13:27:23 -070045 * Cipher speed tests
46 */
Sebastian Siewiord5dc3922008-03-11 21:27:11 +080047static u8 speed_template_8[] = {8, 0};
48static u8 speed_template_24[] = {24, 0};
49static u8 speed_template_8_32[] = {8, 32, 0};
50static u8 speed_template_16_32[] = {16, 32, 0};
51static u8 speed_template_16_24_32[] = {16, 24, 32, 0};
52static u8 speed_template_32_40_48[] = {32, 40, 48, 0};
53static u8 speed_template_32_48_64[] = {32, 48, 64, 0};
Rik Snelf19f5112007-09-19 20:23:13 +080054
Michal Ludvige8057922006-05-30 22:04:19 +100055/*
56 * Digest speed tests
57 */
Herbert Xue9d41162006-08-19 21:38:49 +100058static struct hash_speed generic_hash_speed_template[] = {
Sebastian Siewiorde224c32008-03-13 20:21:51 +080059 { .blen = 16, .plen = 16, },
Michal Ludvige8057922006-05-30 22:04:19 +100060 { .blen = 64, .plen = 16, },
61 { .blen = 64, .plen = 64, },
62 { .blen = 256, .plen = 16, },
63 { .blen = 256, .plen = 64, },
64 { .blen = 256, .plen = 256, },
65 { .blen = 1024, .plen = 16, },
66 { .blen = 1024, .plen = 256, },
67 { .blen = 1024, .plen = 1024, },
68 { .blen = 2048, .plen = 16, },
69 { .blen = 2048, .plen = 256, },
70 { .blen = 2048, .plen = 1024, },
71 { .blen = 2048, .plen = 2048, },
72 { .blen = 4096, .plen = 16, },
73 { .blen = 4096, .plen = 256, },
74 { .blen = 4096, .plen = 1024, },
75 { .blen = 4096, .plen = 4096, },
76 { .blen = 8192, .plen = 16, },
77 { .blen = 8192, .plen = 256, },
78 { .blen = 8192, .plen = 1024, },
79 { .blen = 8192, .plen = 4096, },
80 { .blen = 8192, .plen = 8192, },
81
82 /* End marker */
83 { .blen = 0, .plen = 0, }
84};
85
Linus Torvalds1da177e2005-04-16 15:20:36 -070086#endif /* _CRYPTO_TCRYPT_H */