1/*
2 * Copyright 2001-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 * Fujitsu SPARC64 X support for AES CCM.
12 * This file is included by cipher_aes_ccm_hw.c
13 */
14
15static int ccm_t4_aes_initkey(PROV_CCM_CTX *ctx, const unsigned char *key,
16                              size_t keylen)
17{
18    PROV_AES_CCM_CTX *actx = (PROV_AES_CCM_CTX *)ctx;
19
20    AES_HW_CCM_SET_KEY_FN(aes_t4_set_encrypt_key, aes_t4_encrypt, NULL, NULL);
21    return 1;
22}
23
24static const PROV_CCM_HW t4_aes_ccm = {
25    ccm_t4_aes_initkey,
26    ossl_ccm_generic_setiv,
27    ossl_ccm_generic_setaad,
28    ossl_ccm_generic_auth_encrypt,
29    ossl_ccm_generic_auth_decrypt,
30    ossl_ccm_generic_gettag
31};
32
33const PROV_CCM_HW *ossl_prov_aes_hw_ccm(size_t keybits)
34{
35    return SPARC_AES_CAPABLE ? &t4_aes_ccm : &aes_ccm;
36}
37