]> git.ipfire.org Git - thirdparty/openssl.git/blob - providers/implementations/ciphers/cipher_aes_ccm_hw_t4.inc
Providers: move all digests
[thirdparty/openssl.git] / providers / implementations / ciphers / cipher_aes_ccm_hw_t4.inc
1 /*
2 * Copyright 2001-2019 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_ccm_hw.c
13 */
14
15 static 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
24 static const PROV_CCM_HW t4_aes_ccm = {
25 ccm_t4_aes_initkey,
26 ccm_generic_setiv,
27 ccm_generic_setaad,
28 ccm_generic_auth_encrypt,
29 ccm_generic_auth_decrypt,
30 ccm_generic_gettag
31 };
32
33 const PROV_CCM_HW *PROV_AES_HW_ccm(size_t keybits)
34 {
35 return SPARC_AES_CAPABLE ? &t4_aes_ccm : &aes_ccm;
36 }