1 /* 2 * Copyright (c) 2021 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 #ifndef HKS_TEST_API_PERFORMANCE_H 17 #define HKS_TEST_API_PERFORMANCE_H 18 19 #include "hks_type.h" 20 21 #include "securec.h" 22 23 #ifdef __cplusplus 24 extern "C" { 25 #endif 26 27 int32_t HksGenerateKeyRun(const struct HksBlob *keyAlias, const struct HksParamSet *paramSetIn, 28 struct HksParamSet *paramSetOut, uint32_t performTimes); 29 30 int32_t HksEncryptRun(const struct HksBlob *key, const struct HksParamSet *paramSet, 31 const struct HksBlob *plainText, struct HksBlob *cipherText, uint32_t performTimes); 32 33 int32_t HksDecryptRun(const struct HksBlob *key, const struct HksParamSet *paramSet, 34 const struct HksBlob *cipherText, struct HksBlob *plainText, uint32_t performTimes); 35 36 int32_t HksMacRun(const struct HksBlob *key, const struct HksParamSet *paramSet, 37 const struct HksBlob *srcData, struct HksBlob *mac, uint32_t performTimes); 38 39 int32_t HksDeriveKeyRun(const struct HksParamSet *paramSet, const struct HksBlob *masterKey, 40 struct HksBlob *derivedKey, uint32_t performTimes); 41 42 int32_t HksDeleteKeyRun(const struct HksBlob *keyAlias, uint32_t performTimes); 43 44 int32_t HksKeyExistRun(const struct HksBlob *keyAlias, uint32_t performTimes); 45 46 int32_t HksGenerateRandomRun(struct HksBlob *random, uint32_t performTimes); 47 48 int32_t HksAgreeKeyRun(const struct HksParamSet *paramSet, const struct HksBlob *privateKey, 49 const struct HksBlob *peerPublicKey, struct HksBlob *agreedKey, uint32_t performTimes); 50 51 int32_t HksHashRun(const struct HksParamSet *paramSet, 52 const struct HksBlob *srcData, struct HksBlob *hash, uint32_t performTimes); 53 54 int32_t HksBnExpModRun(struct HksBlob *x, const struct HksBlob *a, 55 const struct HksBlob *e, const struct HksBlob *n, uint32_t performTimes); 56 57 #ifdef __cplusplus 58 } 59 #endif 60 61 #endif /* HKS_TEST_API_PERFORMANCE_H */