VirtualBox

source: vbox/trunk/src/libs/openssl-3.1.0/providers/implementations/ciphers/cipher_aria_gcm.c@ 100947

Last change on this file since 100947 was 99366, checked in by vboxsync, 22 months ago

openssl-3.1.0: Applied and adjusted our OpenSSL changes to 3.0.7. bugref:10418

File size: 1.3 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/* Dispatch functions for ARIA GCM mode */
11
12#include "cipher_aria_gcm.h"
13#include "prov/implementations.h"
14#include "prov/providercommon.h"
15
16static void *aria_gcm_newctx(void *provctx, size_t keybits)
17{
18 PROV_ARIA_GCM_CTX *ctx;
19
20 if (!ossl_prov_is_running())
21 return NULL;
22
23 ctx = OPENSSL_zalloc(sizeof(*ctx));
24 if (ctx != NULL)
25 ossl_gcm_initctx(provctx, &ctx->base, keybits,
26 ossl_prov_aria_hw_gcm(keybits));
27 return ctx;
28}
29
30static OSSL_FUNC_cipher_freectx_fn aria_gcm_freectx;
31static void aria_gcm_freectx(void *vctx)
32{
33 PROV_ARIA_GCM_CTX *ctx = (PROV_ARIA_GCM_CTX *)vctx;
34
35 OPENSSL_clear_free(ctx, sizeof(*ctx));
36}
37
38/* ossl_aria128gcm_functions */
39IMPLEMENT_aead_cipher(aria, gcm, GCM, AEAD_FLAGS, 128, 8, 96);
40/* ossl_aria192gcm_functions */
41IMPLEMENT_aead_cipher(aria, gcm, GCM, AEAD_FLAGS, 192, 8, 96);
42/* ossl_aria256gcm_functions */
43IMPLEMENT_aead_cipher(aria, gcm, GCM, AEAD_FLAGS, 256, 8, 96);
44
Note: See TracBrowser for help on using the repository browser.

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