2 * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
10 #ifndef HEADER_AFALG_H
11 # define HEADER_AFALG_H
13 # if defined(__GNUC__) && __GNUC__ >= 4 && \
14 (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L)
15 # pragma GCC diagnostic ignored "-Wvariadic-macros"
19 # define ALG_DGB(x, ...) fprintf(stderr, "ALG_DBG: " x, __VA_ARGS__)
20 # define ALG_INFO(x, ...) fprintf(stderr, "ALG_INFO: " x, __VA_ARGS__)
21 # define ALG_WARN(x, ...) fprintf(stderr, "ALG_WARN: " x, __VA_ARGS__)
23 # define ALG_DGB(x, ...)
24 # define ALG_INFO(x, ...)
25 # define ALG_WARN(x, ...)
28 # define ALG_ERR(x, ...) fprintf(stderr, "ALG_ERR: " x, __VA_ARGS__)
29 # define ALG_PERR(x, ...) \
31 fprintf(stderr, "ALG_PERR: " x, __VA_ARGS__); \
34 # define ALG_PWARN(x, ...) \
36 fprintf(stderr, "ALG_PERR: " x, __VA_ARGS__); \
40 # ifndef AES_BLOCK_SIZE
41 # define AES_BLOCK_SIZE 16
43 # define AES_KEY_SIZE_128 16
44 # define AES_KEY_SIZE_192 24
45 # define AES_KEY_SIZE_256 32
46 # define AES_IV_LEN 16
48 # define MAX_INFLIGHTS 1
62 struct cbc_cipher_handles {
67 typedef struct cbc_cipher_handles cbc_handles;
72 aio_context_t aio_ctx;
73 struct io_event events[MAX_INFLIGHTS];
74 struct iocb cbt[MAX_INFLIGHTS];
76 typedef struct afalg_aio_st afalg_aio;
79 * MAGIC Number to identify correct initialisation
82 # define MAGIC_INIT_NUM 0x1890671
94 typedef struct afalg_ctx_st afalg_ctx;