Mistake on this page?
Report an issue in GitHub or email us
pal_crypto_intf.h
Go to the documentation of this file.
1 /** @file
2  * Copyright (c) 2018, Arm Limited or its affiliates. All rights reserved.
3  * SPDX-License-Identifier : Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16 **/
17 
18 #ifndef _PAL_CRYPTO_H_
19 #define _PAL_CRYPTO_H_
20 
21 #include <stdarg.h>
22 #include "pal_common.h"
23 
24 #if PSA_IPC_IMPLEMENTED
25 #include "psa/client.h"
26 #endif
27 
28 #if PSA_CRYPTO_IMPLEMENTED
29 #include "psa/crypto.h"
30 #endif
31 
32 enum crypto_function_code {
33  PAL_CRYPTO_INIT = 0x1,
34  PAL_CRYPTO_GENERATE_RANDOM = 0x2,
35  PAL_CRYPTO_IMPORT_KEY = 0x3,
36  PAL_CRYPTO_EXPORT_KEY = 0x4,
37  PAL_CRYPTO_EXPORT_PUBLIC_KEY = 0x5,
38  PAL_CRYPTO_DESTROY_KEY = 0x6,
39  PAL_CRYPTO_GET_KEY_INFO = 0x7,
40  PAL_CRYPTO_KEY_POLICY_INIT = 0x8,
41  PAL_CRYPTO_KEY_POLICY_SET_USAGE = 0x9,
42  PAL_CRYPTO_KEY_POLICY_GET_USAGE = 0xA,
43  PAL_CRYPTO_KEY_POLICY_GET_ALGORITHM = 0xB,
44  PAL_CRYPTO_SET_KEY_POLICY = 0xC,
45  PAL_CRYPTO_GET_KEY_POLICY = 0xD,
46  PAL_CRYPTO_GET_KEY_INFORMATION = 0xE,
47  PAL_CRYPTO_GET_KEY_LIFETIME = 0xF,
48  PAL_CRYPTO_HASH_SETUP = 0x11,
49  PAL_CRYPTO_HASH_UPDATE = 0x12,
50  PAL_CRYPTO_HASH_VERIFY = 0x13,
51  PAL_CRYPTO_HASH_FINISH = 0x14,
52  PAL_CRYPTO_HASH_ABORT = 0x15,
53  PAL_CRYPTO_GENERATE_KEY = 0x16,
54  PAL_CRYPTO_GENERATOR_READ = 0x17,
55  PAL_CRYPTO_KEY_DERIVATION = 0x18,
56  PAL_CRYPTO_GET_GENERATOR_CAPACITY = 0x19,
57  PAL_CRYPTO_GENERATOR_IMPORT_KEY = 0x1A,
58  PAL_CRYPTO_GENERATOR_ABORT = 0x1B,
59  PAL_CRYPTO_AEAD_ENCRYPT = 0x1C,
60  PAL_CRYPTO_AEAD_DECRYPT = 0x1D,
61  PAL_CRYPTO_MAC_SIGN_SETUP = 0x1E,
62  PAL_CRYPTO_MAC_UPDATE = 0x1F,
63  PAL_CRYPTO_MAC_SIGN_FINISH = 0x20,
64  PAL_CRYPTO_MAC_VERIFY_SETUP = 0x21,
65  PAL_CRYPTO_MAC_VERIFY_FINISH = 0x22,
66  PAL_CRYPTO_MAC_ABORT = 0x23,
67  PAL_CRYPTO_ASYMMTERIC_ENCRYPT = 0x24,
68  PAL_CRYPTO_ASYMMTERIC_DECRYPT = 0x25,
69  PAL_CRYPTO_CIPHER_ENCRYPT_SETUP = 0x26,
70  PAL_CRYPTO_CIPHER_DECRYPT_SETUP = 0x2A,
71  PAL_CRYPTO_CIPHER_GENERATE_IV = 0x2B,
72  PAL_CRYPTO_CIPHER_SET_IV = 0x2C,
73  PAL_CRYPTO_CIPHER_UPDATE = 0x2D,
74  PAL_CRYPTO_CIPHER_FINISH = 0x2E,
75  PAL_CRYPTO_CIPHER_ABORT = 0x2F,
76  PAL_CRYPTO_ASYMMTERIC_SIGN = 0x30,
77  PAL_CRYPTO_ASYMMTERIC_VERIFY = 0x31,
78  PAL_CRYPTO_KEY_AGREEMENT = 0x32,
79  PAL_CRYPTO_ALLOCATE_KEY = 0x33,
80  PAL_CRYPTO_FREE = 0xFE,
81 };
82 
83 int32_t pal_crypto_function(int type, va_list valist);
84 #endif /* _PAL_CRYPTO_H_ */
Copyright (c) 2018, Arm Limited or its affiliates.
int32_t pal_crypto_function(int type, va_list valist)
This API will call the requested crypto function
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.