2 * Copyright 2019 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 #include "prov/ciphercommon.h"
11 #include "include/crypto/siv.h"
13 typedef struct prov_cipher_hw_aes_siv_st {
14 int (*initkey)(void *ctx, const uint8_t *key, size_t keylen);
15 int (*cipher)(void *ctx, unsigned char *out, const unsigned char *in,
17 void (*setspeed)(void *ctx, int speed);
18 int (*settag)(void *ctx, const unsigned char *tag, size_t tagl);
19 void (*cleanup)(void *ctx);
20 } PROV_CIPHER_HW_AES_SIV;
22 typedef struct prov_siv_ctx_st {
23 unsigned int mode; /* The mode that we are using */
24 unsigned int enc : 1; /* Set to 1 if we are encrypting or 0 otherwise */
26 size_t keylen; /* The input keylength (twice the alg key length) */
27 size_t taglen; /* the taglen is the same as the sivlen */
29 EVP_CIPHER *ctr; /* These are fetched - so we need to free them */
31 const PROV_CIPHER_HW_AES_SIV *hw;
34 const PROV_CIPHER_HW_AES_SIV *PROV_CIPHER_HW_aes_siv(size_t keybits);