| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * 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> | 
					
						
							| 
									
										
										
										
											2007-11-26 22:12:07 +08:00
										 |  |  |  * Copyright (c) 2007 Nokia Siemens Networks | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  * | 
					
						
							|  |  |  |  * 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 | 
					
						
							| 
									
										
										
										
											2005-06-22 13:26:03 -07:00
										 |  |  |  * Software Foundation; either version 2 of the License, or (at your option) | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  |  * any later version. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | #ifndef _CRYPTO_TCRYPT_H
 | 
					
						
							|  |  |  | #define _CRYPTO_TCRYPT_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-07-31 17:08:25 +08:00
										 |  |  | struct cipher_speed_template { | 
					
						
							|  |  |  | 	const char *key; | 
					
						
							|  |  |  | 	unsigned int klen; | 
					
						
							| 
									
										
										
										
											2007-11-26 22:12:07 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-08-19 21:38:49 +10:00
										 |  |  | struct hash_speed { | 
					
						
							| 
									
										
										
										
											2006-05-30 22:04:19 +10:00
										 |  |  | 	unsigned int blen;	/* buffer length */ | 
					
						
							|  |  |  | 	unsigned int plen;	/* per-update length */ | 
					
						
							| 
									
										
										
										
											2010-03-10 18:30:32 +08:00
										 |  |  | 	unsigned int klen;	/* key length */ | 
					
						
							| 
									
										
										
										
											2006-05-30 22:04:19 +10:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * DES test vectors. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2008-07-31 17:08:25 +08:00
										 |  |  | #define DES3_SPEED_VECTORS	1
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-07-31 17:08:25 +08:00
										 |  |  | static struct cipher_speed_template des3_speed_template[] = { | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2008-03-13 20:21:51 +08:00
										 |  |  | 		.key	= "\x01\x23\x45\x67\x89\xab\xcd\xef" | 
					
						
							| 
									
										
										
										
											2008-07-31 17:08:25 +08:00
										 |  |  | 			  "\x55\x55\x55\x55\x55\x55\x55\x55" | 
					
						
							| 
									
										
										
										
											2008-03-13 20:21:51 +08:00
										 |  |  | 			  "\xfe\xdc\xba\x98\x76\x54\x32\x10", | 
					
						
							| 
									
										
										
										
											2007-01-24 21:48:19 +11:00
										 |  |  | 		.klen	= 24, | 
					
						
							| 
									
										
										
										
											2007-08-21 20:01:03 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-06-22 13:27:23 -07:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Cipher speed tests | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2008-03-11 21:27:11 +08:00
										 |  |  | static u8 speed_template_8[] = {8, 0}; | 
					
						
							|  |  |  | static u8 speed_template_24[] = {24, 0}; | 
					
						
							| 
									
										
										
										
											2012-07-11 19:37:21 +02:00
										 |  |  | static u8 speed_template_8_16[] = {8, 16, 0}; | 
					
						
							| 
									
										
										
										
											2008-03-11 21:27:11 +08:00
										 |  |  | 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}; | 
					
						
							| 
									
										
										
										
											2012-12-28 12:04:58 +02:00
										 |  |  | static u8 speed_template_20_28_36[] = {20, 28, 36, 0}; | 
					
						
							| 
									
										
										
										
											2008-03-11 21:27:11 +08:00
										 |  |  | static u8 speed_template_32_40_48[] = {32, 40, 48, 0}; | 
					
						
							| 
									
										
										
										
											2011-10-18 13:32:39 +03:00
										 |  |  | static u8 speed_template_32_48[] = {32, 48, 0}; | 
					
						
							| 
									
										
										
										
											2008-03-11 21:27:11 +08:00
										 |  |  | static u8 speed_template_32_48_64[] = {32, 48, 64, 0}; | 
					
						
							| 
									
										
										
										
											2011-10-18 13:33:22 +03:00
										 |  |  | static u8 speed_template_32_64[] = {32, 64, 0}; | 
					
						
							| 
									
										
										
										
											2007-09-19 20:23:13 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-05-30 22:04:19 +10:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Digest speed tests | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2006-08-19 21:38:49 +10:00
										 |  |  | static struct hash_speed generic_hash_speed_template[] = { | 
					
						
							| 
									
										
										
										
											2008-03-13 20:21:51 +08:00
										 |  |  | 	{ .blen = 16,	.plen = 16, }, | 
					
						
							| 
									
										
										
										
											2006-05-30 22:04:19 +10:00
										 |  |  | 	{ .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, } | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-10 18:30:32 +08:00
										 |  |  | static struct hash_speed hash_speed_template_16[] = { | 
					
						
							|  |  |  | 	{ .blen = 16,	.plen = 16,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 64,	.plen = 16,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 64,	.plen = 64,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 256,	.plen = 16,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 256,	.plen = 64,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 256,	.plen = 256,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 1024,	.plen = 16,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 1024,	.plen = 256,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 1024,	.plen = 1024,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 2048,	.plen = 16,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 2048,	.plen = 256,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 2048,	.plen = 1024,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 2048,	.plen = 2048,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 4096,	.plen = 16,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 4096,	.plen = 256,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 4096,	.plen = 1024,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 4096,	.plen = 4096,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 8192,	.plen = 16,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 8192,	.plen = 256,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 8192,	.plen = 1024,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 8192,	.plen = 4096,	.klen = 16, }, | 
					
						
							|  |  |  | 	{ .blen = 8192,	.plen = 8192,	.klen = 16, }, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* End marker */ | 
					
						
							|  |  |  | 	{  .blen = 0,	.plen = 0,	.klen = 0, } | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-04-16 15:20:36 -07:00
										 |  |  | #endif	/* _CRYPTO_TCRYPT_H */
 |