• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 #ifndef OHCRYPTO_DIGEST_TEST_H
16 #define OHCRYPTO_DIGEST_TEST_H
17 
18 #include "crypto_common.h"
19 #include "crypto_digest.h"
20 
21 typedef struct MdSpec {
22     uint8_t *algName;
23     int mdLen;
24 } MdSpec;
25 
26 typedef struct MdMultSpec {
27     OH_CryptoDigest *ctx;
28     Crypto_DataBlob *in;
29 } MdMultSpec;
30 
31 #define OH_CRYPTO_MD5_DIGESTSIZE    16
32 #define OH_CRYPTO_SHA1_DIGESTSIZE   20
33 #define OH_CRYPTO_SHA224_DIGESTSIZE 28
34 #define OH_CRYPTO_SHA256_DIGESTSIZE 32
35 #define OH_CRYPTO_SHA384_DIGESTSIZE 48
36 #define OH_CRYPTO_SHA512_DIGESTSIZE 64
37 #define OH_CRYPTO_SM3_DIGESTSIZE    32
38 
39 #define OH_CRYPTO_DIGEST_DATA_MAX   (1024 * 1024 * 100)
40 #define OH_CRYPTO_DIGEST_DATA_SIZE  64
41 #define OH_CRYPTO_ITERATIONS_NUMBER 3
42 
43 #define OH_CRYPTO_RETURN_NULL nullptr
44 #define OH_CRYPTO_STABILITY_RUN_TIMES 1000
45 
46 void OH_CryptoDigestMultUpdate(MdMultSpec *in);
47 
48 #endif
49