• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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_MAC_TEST_H
16 #define OHCRYPTO_MAC_TEST_H
17 
18 #include "crypto_common.h"
19 #include "crypto_mac.h"
20 #include "crypto_rand.h"
21 #include "crypto_sym_key.h"
22 
23 #define OHTEST_MAC_HMAC "HMAC"
24 #define OHTEST_MAC_CMAC "CMAC"
25 
26 typedef struct {
27     const char *type;
28     const char *algoKeyName;
29     union {
30         const char *degistName;
31         const char *cipherName;
32     } paramType;
33 } MacSpec;
34 
35 typedef struct {
36     const char *macType;
37     const char *vectorSource;
38     const char *algoName;
39     uint8_t key[256];
40     size_t keyLen;
41     uint8_t msg[256];
42     size_t msgLen;
43     uint8_t expectMac[64];
44     size_t macLen;
45 } VectorMacSpec;
46 
47 #endif