2 * Copyright 2001-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
11 * AES-NI support for AES CCM.
12 * This file is included by cipher_ccm_hw.c
15 static int ccm_aesni_initkey(PROV_CCM_CTX *ctx, const unsigned char *key,
18 PROV_AES_CCM_CTX *actx = (PROV_AES_CCM_CTX *)ctx;
20 AES_HW_CCM_SET_KEY_FN(aesni_set_encrypt_key, aesni_encrypt,
21 aesni_ccm64_encrypt_blocks,
22 aesni_ccm64_decrypt_blocks);
26 static const PROV_CCM_HW aesni_ccm = {
30 ccm_generic_auth_encrypt,
31 ccm_generic_auth_decrypt,
35 const PROV_CCM_HW *PROV_AES_HW_ccm(size_t keybits)
37 return AESNI_CAPABLE ? &aesni_ccm : &aes_ccm;