zram: use __bio_add_page for adding single page to bio
[linux-block.git] / crypto / tcrypt.h
CommitLineData
2874c5fd 1/* SPDX-License-Identifier: GPL-2.0-or-later */
1da177e4
LT
2/*
3 * Quick & dirty crypto testing module.
4 *
5 * This will only exist until we have a better testing mechanism
6 * (e.g. a char device).
7 *
8 * Copyright (c) 2002 James Morris <jmorris@intercode.com.au>
9 * Copyright (c) 2002 Jean-Francois Dive <jef@linuxbe.org>
e3a4ea4f 10 * Copyright (c) 2007 Nokia Siemens Networks
1da177e4
LT
11 */
12#ifndef _CRYPTO_TCRYPT_H
13#define _CRYPTO_TCRYPT_H
14
da7f033d
HX
15struct cipher_speed_template {
16 const char *key;
17 unsigned int klen;
e3a4ea4f
MH
18};
19
53f52d7a
TC
20struct aead_speed_template {
21 const char *key;
22 unsigned int klen;
23};
24
e9d41164 25struct hash_speed {
e8057928
ML
26 unsigned int blen; /* buffer length */
27 unsigned int plen; /* per-update length */
28};
29
1da177e4
LT
30/*
31 * DES test vectors.
32 */
da7f033d 33#define DES3_SPEED_VECTORS 1
1da177e4 34
da7f033d 35static struct cipher_speed_template des3_speed_template[] = {
1da177e4 36 {
de224c30 37 .key = "\x01\x23\x45\x67\x89\xab\xcd\xef"
da7f033d 38 "\x55\x55\x55\x55\x55\x55\x55\x55"
de224c30 39 "\xfe\xdc\xba\x98\x76\x54\x32\x10",
02ab5a70 40 .klen = 24,
e2ee95b8
HSC
41 }
42};
43
ebfd9bcf
HW
44/*
45 * Cipher speed tests
46 */
d5dc3927 47static u8 speed_template_8[] = {8, 0};
95ba5973 48static u8 speed_template_16[] = {16, 0};
d5dc3927 49static u8 speed_template_24[] = {24, 0};
a2c58260 50static u8 speed_template_8_16[] = {8, 16, 0};
d5dc3927
SS
51static u8 speed_template_8_32[] = {8, 32, 0};
52static u8 speed_template_16_32[] = {16, 32, 0};
53static u8 speed_template_16_24_32[] = {16, 24, 32, 0};
69d3150c 54static u8 speed_template_20_28_36[] = {20, 28, 36, 0};
d5dc3927 55static u8 speed_template_32_40_48[] = {32, 40, 48, 0};
87aae4bf 56static u8 speed_template_32_48[] = {32, 48, 0};
d5dc3927 57static u8 speed_template_32_48_64[] = {32, 48, 64, 0};
5209c07a 58static u8 speed_template_32_64[] = {32, 64, 0};
2dce063a 59static u8 speed_template_32[] = {32, 0};
f19f5111 60
53f52d7a
TC
61/*
62 * AEAD speed tests
63 */
4e4aab63 64static u8 aead_speed_template_19[] = {19, 0};
425359ae 65static u8 aead_speed_template_20_28_36[] = {20, 28, 36, 0};
2dce063a 66static u8 aead_speed_template_36[] = {36, 0};
53f52d7a 67
e8057928
ML
68/*
69 * Digest speed tests
70 */
e9d41164 71static struct hash_speed generic_hash_speed_template[] = {
de224c30 72 { .blen = 16, .plen = 16, },
e8057928
ML
73 { .blen = 64, .plen = 16, },
74 { .blen = 64, .plen = 64, },
75 { .blen = 256, .plen = 16, },
76 { .blen = 256, .plen = 64, },
77 { .blen = 256, .plen = 256, },
78 { .blen = 1024, .plen = 16, },
79 { .blen = 1024, .plen = 256, },
80 { .blen = 1024, .plen = 1024, },
81 { .blen = 2048, .plen = 16, },
82 { .blen = 2048, .plen = 256, },
83 { .blen = 2048, .plen = 1024, },
84 { .blen = 2048, .plen = 2048, },
85 { .blen = 4096, .plen = 16, },
86 { .blen = 4096, .plen = 256, },
87 { .blen = 4096, .plen = 1024, },
88 { .blen = 4096, .plen = 4096, },
89 { .blen = 8192, .plen = 16, },
90 { .blen = 8192, .plen = 256, },
91 { .blen = 8192, .plen = 1024, },
92 { .blen = 8192, .plen = 4096, },
93 { .blen = 8192, .plen = 8192, },
94
95 /* End marker */
96 { .blen = 0, .plen = 0, }
97};
98
2dce063a
MW
99static struct hash_speed poly1305_speed_template[] = {
100 { .blen = 96, .plen = 16, },
101 { .blen = 96, .plen = 32, },
102 { .blen = 96, .plen = 96, },
103 { .blen = 288, .plen = 16, },
104 { .blen = 288, .plen = 32, },
105 { .blen = 288, .plen = 288, },
106 { .blen = 1056, .plen = 32, },
107 { .blen = 1056, .plen = 1056, },
108 { .blen = 2080, .plen = 32, },
109 { .blen = 2080, .plen = 2080, },
110 { .blen = 4128, .plen = 4128, },
111 { .blen = 8224, .plen = 8224, },
112
113 /* End marker */
114 { .blen = 0, .plen = 0, }
115};
116
1da177e4 117#endif /* _CRYPTO_TCRYPT_H */