Blame view

crypto/tcrypt.h 2.27 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
3
4
5
6
7
8
  /*
   * Quick & dirty crypto testing module.
   *
   * This will only exist until we have a better testing mechanism
   * (e.g. a char device).
   *
   * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
   * Copyright (c) 2002 Jean-Francois Dive <jef@linuxbe.org>
e3a4ea4fd   Mikko Herranen   [CRYPTO] tcrypt: ...
9
   * Copyright (c) 2007 Nokia Siemens Networks
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
10
11
12
   *
   * This program is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License as published by the Free
ef2736fc7   Herbert Xu   [CRYPTO]: White s...
13
   * Software Foundation; either version 2 of the License, or (at your option)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
14
15
   * any later version.
   *
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
16
17
18
   */
  #ifndef _CRYPTO_TCRYPT_H
  #define _CRYPTO_TCRYPT_H
da7f033dd   Herbert Xu   crypto: cryptomgr...
19
20
21
  struct cipher_speed_template {
  	const char *key;
  	unsigned int klen;
e3a4ea4fd   Mikko Herranen   [CRYPTO] tcrypt: ...
22
  };
e9d41164e   Herbert Xu   [CRYPTO] tcrypt: ...
23
  struct hash_speed {
e80579285   Michal Ludvig   [CRYPTO] tcrypt: ...
24
25
26
  	unsigned int blen;	/* buffer length */
  	unsigned int plen;	/* per-update length */
  };
a28091ae1   Andrew Donofrio   [CRYPTO] tcrypt: ...
27
  /*
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
28
29
   * DES test vectors.
   */
da7f033dd   Herbert Xu   crypto: cryptomgr...
30
  #define DES3_SPEED_VECTORS	1
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
31

da7f033dd   Herbert Xu   crypto: cryptomgr...
32
  static struct cipher_speed_template des3_speed_template[] = {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
33
  	{
de224c309   Sebastian Siewior   [CRYPTO] tcrypt: ...
34
  		.key	= "\x01\x23\x45\x67\x89\xab\xcd\xef"
da7f033dd   Herbert Xu   crypto: cryptomgr...
35
  			  "\x55\x55\x55\x55\x55\x55\x55\x55"
de224c309   Sebastian Siewior   [CRYPTO] tcrypt: ...
36
  			  "\xfe\xdc\xba\x98\x76\x54\x32\x10",
02ab5a705   Noriaki TAKAMIYA   [CRYPTO] camellia...
37
  		.klen	= 24,
e2ee95b8c   Hye-Shik Chang   [CRYPTO] seed: Ne...
38
39
  	}
  };
c907ee76d   Herbert Xu   [CRYPTO] tcrypt: ...
40
  /*
ebfd9bcf1   Harald Welte   [CRYPTO]: Add cip...
41
42
   * Cipher speed tests
   */
d5dc39274   Sebastian Siewior   [CRYPTO] tcrypt: ...
43
44
45
46
47
48
49
  static u8 speed_template_8[] = {8, 0};
  static u8 speed_template_24[] = {24, 0};
  static u8 speed_template_8_32[] = {8, 32, 0};
  static u8 speed_template_16_32[] = {16, 32, 0};
  static u8 speed_template_16_24_32[] = {16, 24, 32, 0};
  static u8 speed_template_32_40_48[] = {32, 40, 48, 0};
  static u8 speed_template_32_48_64[] = {32, 48, 64, 0};
f19f5111c   Rik Snel   [CRYPTO] xts: XTS...
50

e80579285   Michal Ludvig   [CRYPTO] tcrypt: ...
51
52
53
  /*
   * Digest speed tests
   */
e9d41164e   Herbert Xu   [CRYPTO] tcrypt: ...
54
  static struct hash_speed generic_hash_speed_template[] = {
de224c309   Sebastian Siewior   [CRYPTO] tcrypt: ...
55
  	{ .blen = 16,	.plen = 16, },
e80579285   Michal Ludvig   [CRYPTO] tcrypt: ...
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
  	{ .blen = 64,	.plen = 16, },
  	{ .blen = 64,	.plen = 64, },
  	{ .blen = 256,	.plen = 16, },
  	{ .blen = 256,	.plen = 64, },
  	{ .blen = 256,	.plen = 256, },
  	{ .blen = 1024,	.plen = 16, },
  	{ .blen = 1024,	.plen = 256, },
  	{ .blen = 1024,	.plen = 1024, },
  	{ .blen = 2048,	.plen = 16, },
  	{ .blen = 2048,	.plen = 256, },
  	{ .blen = 2048,	.plen = 1024, },
  	{ .blen = 2048,	.plen = 2048, },
  	{ .blen = 4096,	.plen = 16, },
  	{ .blen = 4096,	.plen = 256, },
  	{ .blen = 4096,	.plen = 1024, },
  	{ .blen = 4096,	.plen = 4096, },
  	{ .blen = 8192,	.plen = 16, },
  	{ .blen = 8192,	.plen = 256, },
  	{ .blen = 8192,	.plen = 1024, },
  	{ .blen = 8192,	.plen = 4096, },
  	{ .blen = 8192,	.plen = 8192, },
  
  	/* End marker */
  	{  .blen = 0,	.plen = 0, }
  };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
81
  #endif	/* _CRYPTO_TCRYPT_H */