2019-08-22 09:42:54 +08:00
|
|
|
/*
|
2020-10-15 21:10:06 +08:00
|
|
|
* Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.
|
2019-08-22 09:42:54 +08:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
|
|
|
* this file except in compliance with the License. You can obtain a copy
|
|
|
|
* in the file LICENSE in the source distribution or at
|
|
|
|
* https://www.openssl.org/source/license.html
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*-
|
|
|
|
* Fujitsu SPARC64 X support for AES CCM.
|
2019-12-04 02:41:05 +08:00
|
|
|
* This file is included by cipher_aes_ccm_hw.c
|
2019-08-22 09:42:54 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
static int ccm_t4_aes_initkey(PROV_CCM_CTX *ctx, const unsigned char *key,
|
|
|
|
size_t keylen)
|
|
|
|
{
|
|
|
|
PROV_AES_CCM_CTX *actx = (PROV_AES_CCM_CTX *)ctx;
|
|
|
|
|
2019-08-26 15:05:08 +08:00
|
|
|
AES_HW_CCM_SET_KEY_FN(aes_t4_set_encrypt_key, aes_t4_encrypt, NULL, NULL);
|
2019-08-22 09:42:54 +08:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const PROV_CCM_HW t4_aes_ccm = {
|
|
|
|
ccm_t4_aes_initkey,
|
|
|
|
ccm_generic_setiv,
|
|
|
|
ccm_generic_setaad,
|
|
|
|
ccm_generic_auth_encrypt,
|
|
|
|
ccm_generic_auth_decrypt,
|
|
|
|
ccm_generic_gettag
|
|
|
|
};
|
|
|
|
|
2020-09-28 10:47:04 +08:00
|
|
|
const PROV_CCM_HW *ossl_prov_aes_hw_ccm(size_t keybits)
|
2019-08-22 09:42:54 +08:00
|
|
|
{
|
|
|
|
return SPARC_AES_CAPABLE ? &t4_aes_ccm : &aes_ccm;
|
|
|
|
}
|