1 /* 2 * Copyright (C) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 /* 17 * Copyright (C) 2022 Huawei Device Co., Ltd. 18 * Licensed under the Apache License, Version 2.0 (the "License"); 19 * you may not use this file except in compliance with the License. 20 * You may obtain a copy of the License at 21 * 22 * http://www.apache.org/licenses/LICENSE-2.0 23 * 24 * Unless required by applicable law or agreed to in writing, software 25 * distributed under the License is distributed on an "AS IS" BASIS, 26 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 27 * See the License for the specific language governing permissions and 28 * limitations under the License. 29 */ 30 #ifndef HCF_AES_OPENSSL_COMMON_H 31 #define HCF_AES_OPENSSL_COMMON_H 32 33 #include "detailed_iv_params.h" 34 #include "detailed_ccm_params.h" 35 #include "detailed_gcm_params.h" 36 37 38 #include "aes_openssl.h" 39 40 #include <openssl/evp.h> 41 42 #ifdef __cplusplus 43 extern "C" { 44 #endif 45 const unsigned char *GetIv(HcfParamsSpec *params); 46 47 int32_t GetCcmTagLen(HcfParamsSpec *params); 48 49 void *GetCcmTag(HcfParamsSpec *params); 50 51 void FreeCipherData(CipherData **data); 52 53 void FreeRedundantOutput(HcfBlob *blob); 54 55 #ifdef __cplusplus 56 } 57 #endif 58 59 #endif 60