VirtualBox

source: vbox/trunk/src/libs/openssl-3.0.1/providers/implementations/ciphers/cipher_aes_ccm.c@ 94320

Last change on this file since 94320 was 94320, checked in by vboxsync, 3 years ago

libs/openssl-3.0.1: Export to OSE and fix copyright headers in Makefiles, bugref:10128

File size: 1.4 KB
Line 
1/*
2 * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
3 *
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
8 */
9
10/*
11 * AES low level APIs are deprecated for public use, but still ok for internal
12 * use where we're using them to implement the higher level EVP interface, as is
13 * the case here.
14 */
15#include "internal/deprecated.h"
16
17/* Dispatch functions for AES CCM mode */
18
19#include "cipher_aes_ccm.h"
20#include "prov/implementations.h"
21#include "prov/providercommon.h"
22
23static void *aes_ccm_newctx(void *provctx, size_t keybits)
24{
25 PROV_AES_CCM_CTX *ctx;
26
27 if (!ossl_prov_is_running())
28 return NULL;
29
30 ctx = OPENSSL_zalloc(sizeof(*ctx));
31 if (ctx != NULL)
32 ossl_ccm_initctx(&ctx->base, keybits, ossl_prov_aes_hw_ccm(keybits));
33 return ctx;
34}
35
36static OSSL_FUNC_cipher_freectx_fn aes_ccm_freectx;
37static void aes_ccm_freectx(void *vctx)
38{
39 PROV_AES_CCM_CTX *ctx = (PROV_AES_CCM_CTX *)vctx;
40
41 OPENSSL_clear_free(ctx, sizeof(*ctx));
42}
43
44/* ossl_aes128ccm_functions */
45IMPLEMENT_aead_cipher(aes, ccm, CCM, AEAD_FLAGS, 128, 8, 96);
46/* ossl_aes192ccm_functions */
47IMPLEMENT_aead_cipher(aes, ccm, CCM, AEAD_FLAGS, 192, 8, 96);
48/* ossl_aes256ccm_functions */
49IMPLEMENT_aead_cipher(aes, ccm, CCM, AEAD_FLAGS, 256, 8, 96);
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette