]>
git.ipfire.org Git - thirdparty/openssl.git/blob - providers/implementations/ciphers/cipher_aes_ocb.h
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 <openssl/aes.h>
11 #include "prov/ciphercommon.h"
13 #define OCB_MAX_TAG_LEN AES_BLOCK_SIZE
14 #define OCB_MAX_DATA_LEN AES_BLOCK_SIZE
15 #define OCB_MAX_AAD_LEN AES_BLOCK_SIZE
17 typedef struct prov_aes_ocb_ctx_st
{
18 PROV_CIPHER_CTX base
; /* Must be first */
22 } ksenc
; /* AES key schedule to use for encryption/aad */
26 } ksdec
; /* AES key schedule to use for decryption */
28 unsigned int iv_state
; /* set to one of IV_STATE_XXX */
29 unsigned int key_set
: 1;
33 unsigned char tag
[OCB_MAX_TAG_LEN
];
34 unsigned char data_buf
[OCB_MAX_DATA_LEN
]; /* Store partial data blocks */
35 unsigned char aad_buf
[OCB_MAX_AAD_LEN
]; /* Store partial AAD blocks */
38 const PROV_CIPHER_HW
*PROV_CIPHER_HW_aes_ocb(size_t keybits
);