18 #ifndef _PAL_CRYPTO_H_ 19 #define _PAL_CRYPTO_H_ 24 #if PSA_IPC_IMPLEMENTED 25 #include "psa/client.h" 28 #if PSA_CRYPTO_IMPLEMENTED 29 #include "psa/crypto.h" 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,
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