Blame view

crypto/tcrypt.h 3.04 KB
2874c5fd2   Thomas Gleixner   treewide: Replace...
1
  /* SPDX-License-Identifier: GPL-2.0-or-later */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
2
3
4
5
6
7
8
9
  /*
   * 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: ...
10
   * Copyright (c) 2007 Nokia Siemens Networks
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
11
12
13
   */
  #ifndef _CRYPTO_TCRYPT_H
  #define _CRYPTO_TCRYPT_H
da7f033dd   Herbert Xu   crypto: cryptomgr...
14
15
16
  struct cipher_speed_template {
  	const char *key;
  	unsigned int klen;
e3a4ea4fd   Mikko Herranen   [CRYPTO] tcrypt: ...
17
  };
53f52d7ae   Tim Chen   crypto: tcrypt - ...
18
19
20
21
  struct aead_speed_template {
  	const char *key;
  	unsigned int klen;
  };
e9d41164e   Herbert Xu   [CRYPTO] tcrypt: ...
22
  struct hash_speed {
e80579285   Michal Ludvig   [CRYPTO] tcrypt: ...
23
24
25
  	unsigned int blen;	/* buffer length */
  	unsigned int plen;	/* per-update length */
  };
a28091ae1   Andrew Donofrio   [CRYPTO] tcrypt: ...
26
  /*
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
27
28
   * DES test vectors.
   */
da7f033dd   Herbert Xu   crypto: cryptomgr...
29
  #define DES3_SPEED_VECTORS	1
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
30

da7f033dd   Herbert Xu   crypto: cryptomgr...
31
  static struct cipher_speed_template des3_speed_template[] = {
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
32
  	{
de224c309   Sebastian Siewior   [CRYPTO] tcrypt: ...
33
  		.key	= "\x01\x23\x45\x67\x89\xab\xcd\xef"
da7f033dd   Herbert Xu   crypto: cryptomgr...
34
  			  "\x55\x55\x55\x55\x55\x55\x55\x55"
de224c309   Sebastian Siewior   [CRYPTO] tcrypt: ...
35
  			  "\xfe\xdc\xba\x98\x76\x54\x32\x10",
02ab5a705   Noriaki TAKAMIYA   [CRYPTO] camellia...
36
  		.klen	= 24,
e2ee95b8c   Hye-Shik Chang   [CRYPTO] seed: Ne...
37
38
  	}
  };
c907ee76d   Herbert Xu   [CRYPTO] tcrypt: ...
39
  /*
ebfd9bcf1   Harald Welte   [CRYPTO]: Add cip...
40
41
   * Cipher speed tests
   */
d5dc39274   Sebastian Siewior   [CRYPTO] tcrypt: ...
42
  static u8 speed_template_8[] = {8, 0};
95ba59736   Gilad Ben-Yossef   crypto: testmgr -...
43
  static u8 speed_template_16[] = {16, 0};
d5dc39274   Sebastian Siewior   [CRYPTO] tcrypt: ...
44
  static u8 speed_template_24[] = {24, 0};
a2c582609   Johannes Goetzfried   crypto: testmgr -...
45
  static u8 speed_template_8_16[] = {8, 16, 0};
d5dc39274   Sebastian Siewior   [CRYPTO] tcrypt: ...
46
47
48
  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};
69d3150cf   Jussi Kivilinna   crypto: ctr - mak...
49
  static u8 speed_template_20_28_36[] = {20, 28, 36, 0};
d5dc39274   Sebastian Siewior   [CRYPTO] tcrypt: ...
50
  static u8 speed_template_32_40_48[] = {32, 40, 48, 0};
87aae4bfb   Jussi Kivilinna   crypto: tcrypt - ...
51
  static u8 speed_template_32_48[] = {32, 48, 0};
d5dc39274   Sebastian Siewior   [CRYPTO] tcrypt: ...
52
  static u8 speed_template_32_48_64[] = {32, 48, 64, 0};
5209c07ac   Jussi Kivilinna   crypto: tcrypt - ...
53
  static u8 speed_template_32_64[] = {32, 64, 0};
2dce063a3   Martin Willi   crypto: tcrypt - ...
54
  static u8 speed_template_32[] = {32, 0};
f19f5111c   Rik Snel   [CRYPTO] xts: XTS...
55

e80579285   Michal Ludvig   [CRYPTO] tcrypt: ...
56
  /*
53f52d7ae   Tim Chen   crypto: tcrypt - ...
57
58
   * AEAD speed tests
   */
4e4aab63d   Herbert Xu   crypto: tcrypt - ...
59
  static u8 aead_speed_template_19[] = {19, 0};
53f52d7ae   Tim Chen   crypto: tcrypt - ...
60
  static u8 aead_speed_template_20[] = {20, 0};
2dce063a3   Martin Willi   crypto: tcrypt - ...
61
  static u8 aead_speed_template_36[] = {36, 0};
53f52d7ae   Tim Chen   crypto: tcrypt - ...
62
63
  
  /*
e80579285   Michal Ludvig   [CRYPTO] tcrypt: ...
64
65
   * Digest speed tests
   */
e9d41164e   Herbert Xu   [CRYPTO] tcrypt: ...
66
  static struct hash_speed generic_hash_speed_template[] = {
de224c309   Sebastian Siewior   [CRYPTO] tcrypt: ...
67
  	{ .blen = 16,	.plen = 16, },
e80579285   Michal Ludvig   [CRYPTO] tcrypt: ...
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
  	{ .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, }
  };
2dce063a3   Martin Willi   crypto: tcrypt - ...
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
  static struct hash_speed poly1305_speed_template[] = {
  	{ .blen = 96,	.plen = 16, },
  	{ .blen = 96,	.plen = 32, },
  	{ .blen = 96,	.plen = 96, },
  	{ .blen = 288,	.plen = 16, },
  	{ .blen = 288,	.plen = 32, },
  	{ .blen = 288,	.plen = 288, },
  	{ .blen = 1056,	.plen = 32, },
  	{ .blen = 1056,	.plen = 1056, },
  	{ .blen = 2080,	.plen = 32, },
  	{ .blen = 2080,	.plen = 2080, },
  	{ .blen = 4128,	.plen = 4128, },
  	{ .blen = 8224,	.plen = 8224, },
  
  	/* End marker */
  	{  .blen = 0,	.plen = 0, }
  };
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
110
  #endif	/* _CRYPTO_TCRYPT_H */