rinjdael: add parallel processing for CFB decryption with AES-NI
[libgcrypt.git] / cipher / cipher-selftest.h
1 /* cipher-selftest.h - Helper functions for bulk encryption selftests.
2  *      Copyright © 2013 Jussi Kivilinna <jussi.kivilinna@iki.fi>
3  *
4  * This file is part of Libgcrypt.
5  *
6  * Libgcrypt is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser general Public License as
8  * published by the Free Software Foundation; either version 2.1 of
9  * the License, or (at your option) any later version.
10  *
11  * Libgcrypt is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this program; if not, see <http://www.gnu.org/licenses/>.
18  */
19
20 #ifndef G10_SELFTEST_HELP_H
21 #define G10_SELFTEST_HELP_H
22
23 #include <config.h>
24 #include "types.h"
25 #include "g10lib.h"
26 #include "cipher.h"
27
28 typedef void (*gcry_cipher_bulk_cbc_dec_t)(void *context, unsigned char *iv,
29                                            void *outbuf_arg,
30                                            const void *inbuf_arg,
31                                            unsigned int nblocks);
32
33 typedef void (*gcry_cipher_bulk_cfb_dec_t)(void *context, unsigned char *iv,
34                                            void *outbuf_arg,
35                                            const void *inbuf_arg,
36                                            unsigned int nblocks);
37
38 typedef void (*gcry_cipher_bulk_ctr_enc_t)(void *context, unsigned char *iv,
39                                            void *outbuf_arg,
40                                            const void *inbuf_arg,
41                                            unsigned int nblocks);
42
43 /* Helper function for bulk CBC decryption selftest */
44 const char *
45 _gcry_selftest_helper_cbc_128 (const char *cipher, gcry_cipher_setkey_t setkey,
46                                gcry_cipher_encrypt_t encrypt_one,
47                                gcry_cipher_bulk_cbc_dec_t bulk_cbc_dec,
48                                const int nblocks, const int blocksize,
49                                const int context_size);
50
51 /* Helper function for bulk CFB decryption selftest */
52 const char *
53 _gcry_selftest_helper_cfb_128 (const char *cipher, gcry_cipher_setkey_t setkey,
54                                gcry_cipher_encrypt_t encrypt_one,
55                                gcry_cipher_bulk_cfb_dec_t bulk_cfb_dec,
56                                const int nblocks, const int blocksize,
57                                const int context_size);
58
59 /* Helper function for bulk CTR encryption selftest */
60 const char *
61 _gcry_selftest_helper_ctr_128 (const char *cipher, gcry_cipher_setkey_t setkey,
62                                gcry_cipher_encrypt_t encrypt_one,
63                                gcry_cipher_bulk_ctr_enc_t bulk_ctr_enc,
64                                const int nblocks, const int blocksize,
65                                const int context_size);
66
67 #endif /*G10_SELFTEST_HELP_H*/