49 #ifndef PSA_CRYPTO_STRUCT_H
50 #define PSA_CRYPTO_STRUCT_H
71 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
72 mbedtls_psa_client_handle_t handle;
84 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
85 #define PSA_HASH_OPERATION_INIT { 0 }
87 #define PSA_HASH_OPERATION_INIT { 0, { 0 } }
96 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
97 mbedtls_psa_client_handle_t handle;
116 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
117 #define PSA_CIPHER_OPERATION_INIT { 0 }
119 #define PSA_CIPHER_OPERATION_INIT { 0, 0, 0, 0, { 0 } }
132 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
133 mbedtls_psa_client_handle_t handle;
148 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
149 #define PSA_MAC_OPERATION_INIT { 0 }
151 #define PSA_MAC_OPERATION_INIT { 0, 0, 0, { 0 } }
160 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
161 mbedtls_psa_client_handle_t handle;
187 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
188 #define PSA_AEAD_OPERATION_INIT { 0 }
190 #define PSA_AEAD_OPERATION_INIT { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { 0 } }
203 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
204 mbedtls_psa_client_handle_t handle;
213 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
214 #define PSA_KEY_DERIVATION_OPERATION_INIT { 0 }
217 #define PSA_KEY_DERIVATION_OPERATION_INIT { 0, 0, 0, { 0 } }
240 #define PSA_KEY_PRODUCTION_PARAMETERS_INIT { 0 }
249 #define PSA_KEY_POLICY_INIT { 0, 0, 0 }
261 #define PSA_KEY_BITS_TOO_LARGE ((psa_key_bits_t) -1)
267 #define PSA_MAX_KEY_BITS 0xfff8
270 #if defined(MBEDTLS_PSA_CRYPTO_SE_C)
292 #if defined(MBEDTLS_PSA_CRYPTO_SE_C)
293 #define PSA_KEY_ATTRIBUTES_MAYBE_SLOT_NUMBER 0, 0,
295 #define PSA_KEY_ATTRIBUTES_MAYBE_SLOT_NUMBER
297 #define PSA_KEY_ATTRIBUTES_INIT { PSA_KEY_ATTRIBUTES_MAYBE_SLOT_NUMBER \
298 PSA_KEY_TYPE_NONE, 0, \
299 PSA_KEY_LIFETIME_VOLATILE, \
300 PSA_KEY_POLICY_INIT, \
301 MBEDTLS_SVC_KEY_ID_INIT }
330 #ifdef MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
332 mbedtls_key_owner_id_t owner)
334 attributes->MBEDTLS_PRIVATE(
id).MBEDTLS_PRIVATE(owner) = owner;
341 attributes->MBEDTLS_PRIVATE(lifetime) = lifetime;
343 #ifdef MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
344 attributes->MBEDTLS_PRIVATE(
id).MBEDTLS_PRIVATE(key_id) = 0;
372 attributes->MBEDTLS_PRIVATE(policy).MBEDTLS_PRIVATE(
usage) = usage_flags;
384 attributes->MBEDTLS_PRIVATE(policy).MBEDTLS_PRIVATE(alg) = alg;
390 return attributes->MBEDTLS_PRIVATE(policy).MBEDTLS_PRIVATE(alg);
425 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
426 mbedtls_psa_client_handle_t handle;
444 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
445 #define PSA_SIGN_HASH_INTERRUPTIBLE_OPERATION_INIT { 0 }
447 #define PSA_SIGN_HASH_INTERRUPTIBLE_OPERATION_INIT { 0, { 0 }, 0, 0 }
463 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
464 mbedtls_psa_client_handle_t handle;
482 #if defined(MBEDTLS_PSA_CRYPTO_CLIENT) && !defined(MBEDTLS_PSA_CRYPTO_C)
483 #define PSA_VERIFY_HASH_INTERRUPTIBLE_OPERATION_INIT { 0 }
485 #define PSA_VERIFY_HASH_INTERRUPTIBLE_OPERATION_INIT { 0, { 0 }, 0, 0 }
#define PSA_KEY_BITS_TOO_LARGE
static struct psa_sign_hash_interruptible_operation_s psa_sign_hash_interruptible_operation_init(void)
static void psa_set_key_usage_flags(psa_key_attributes_t *attributes, psa_key_usage_t usage_flags)
static struct psa_aead_operation_s psa_aead_operation_init(void)
static struct psa_verify_hash_interruptible_operation_s psa_verify_hash_interruptible_operation_init(void)
static size_t psa_get_key_bits(const psa_key_attributes_t *attributes)
#define PSA_KEY_POLICY_INIT
static void psa_set_key_type(psa_key_attributes_t *attributes, psa_key_type_t type)
static struct psa_key_attributes_s psa_key_attributes_init(void)
static struct psa_cipher_operation_s psa_cipher_operation_init(void)
static struct psa_key_derivation_s psa_key_derivation_operation_init(void)
static psa_key_lifetime_t psa_get_key_lifetime(const psa_key_attributes_t *attributes)
static psa_key_usage_t psa_get_key_usage_flags(const psa_key_attributes_t *attributes)
static void psa_extend_key_usage_flags(psa_key_usage_t *usage_flags)
static struct psa_mac_operation_s psa_mac_operation_init(void)
static void psa_set_key_lifetime(psa_key_attributes_t *attributes, psa_key_lifetime_t lifetime)
static psa_algorithm_t psa_get_key_algorithm(const psa_key_attributes_t *attributes)
static struct psa_hash_operation_s psa_hash_operation_init(void)
static void psa_set_key_id(psa_key_attributes_t *attributes, mbedtls_svc_key_id_t key)
static psa_key_type_t psa_get_key_type(const psa_key_attributes_t *attributes)
#define PSA_SIGN_HASH_INTERRUPTIBLE_OPERATION_INIT
static void psa_set_key_algorithm(psa_key_attributes_t *attributes, psa_algorithm_t alg)
#define PSA_VERIFY_HASH_INTERRUPTIBLE_OPERATION_INIT
static void psa_set_key_bits(psa_key_attributes_t *attributes, size_t bits)
static mbedtls_svc_key_id_t psa_get_key_id(const psa_key_attributes_t *attributes)
static struct psa_key_policy_s psa_key_policy_init(void)
static const struct attribute attributes[]
#define PSA_MAC_OPERATION_INIT
This macro returns a suitable initializer for a MAC operation object of type psa_mac_operation_t.
#define PSA_AEAD_OPERATION_INIT
This macro returns a suitable initializer for an AEAD operation object of type psa_aead_operation_t.
#define PSA_KEY_ATTRIBUTES_INIT
This macro returns a suitable initializer for a key attribute structure of type psa_key_attributes_t.
#define PSA_CIPHER_OPERATION_INIT
This macro returns a suitable initializer for a cipher operation object of type psa_cipher_operation_...
uint16_t psa_key_type_t
Encoding of a key type.
uint32_t psa_algorithm_t
Encoding of a cryptographic algorithm.
#define PSA_HASH_OPERATION_INIT
This macro returns a suitable initializer for a hash operation object of type psa_hash_operation_t.
#define PSA_KEY_DERIVATION_OPERATION_INIT
This macro returns a suitable initializer for a key derivation operation object of type psa_key_deriv...
#define PSA_KEY_LIFETIME_PERSISTENT
The default lifetime for persistent keys.
#define PSA_KEY_LIFETIME_GET_LOCATION(lifetime)
#define PSA_KEY_LIFETIME_IS_VOLATILE(lifetime)
Whether a key lifetime indicates that the key is volatile.
uint32_t psa_key_lifetime_t
Encoding of key lifetimes.
psa_key_id_t mbedtls_svc_key_id_t
Encoding of key identifiers as seen inside the PSA Crypto implementation.
#define PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(persistence, location)
Construct a lifetime from a persistence level and a location.
#define PSA_KEY_USAGE_SIGN_HASH
Whether the key may be used to sign a message.
#define PSA_KEY_USAGE_SIGN_MESSAGE
Whether the key may be used to sign a message.
uint32_t psa_key_usage_t
Encoding of permitted usage on a key.
#define PSA_KEY_USAGE_VERIFY_MESSAGE
Whether the key may be used to verify a message.
#define PSA_KEY_USAGE_VERIFY_HASH
Whether the key may be used to verify a message signature.
uint64_t psa_key_slot_number_t
An internal designation of a key slot between the core part of the PSA Crypto implementation and the ...
const struct ncbi::grid::netcache::search::fields::KEY key
Macro wrapper for struct's members.
Build-time PSA configuration info.
psa_key_type_t MBEDTLS_PRIVATE(key_type)
size_t MBEDTLS_PRIVATE(ad_remaining)
size_t MBEDTLS_PRIVATE(body_remaining)
psa_algorithm_t MBEDTLS_PRIVATE(alg)
unsigned int MBEDTLS_PRIVATE(nonce_set) unsigned int MBEDTLS_PRIVATE(lengths_set) unsigned int MBEDTLS_PRIVATE(ad_started) unsigned int MBEDTLS_PRIVATE(body_started) unsigned int MBEDTLS_PRIVATE(is_encrypt) psa_driver_aead_context_t MBEDTLS_PRIVATE(ctx)
unsigned int MBEDTLS_PRIVATE(id)
Unique ID indicating which driver got assigned to do the operation.
unsigned int MBEDTLS_PRIVATE(iv_required) unsigned int MBEDTLS_PRIVATE(iv_set) uint8_t MBEDTLS_PRIVATE(default_iv_length)
psa_driver_cipher_context_t MBEDTLS_PRIVATE(ctx)
unsigned int MBEDTLS_PRIVATE(id)
Unique ID indicating which driver got assigned to do the operation.
psa_driver_hash_context_t MBEDTLS_PRIVATE(ctx)
unsigned int MBEDTLS_PRIVATE(id)
Unique ID indicating which driver got assigned to do the operation.
psa_key_bits_t MBEDTLS_PRIVATE(bits)
mbedtls_svc_key_id_t MBEDTLS_PRIVATE(id)
psa_key_type_t MBEDTLS_PRIVATE(type)
psa_key_policy_t MBEDTLS_PRIVATE(policy)
psa_key_lifetime_t MBEDTLS_PRIVATE(lifetime)
psa_driver_key_derivation_context_t MBEDTLS_PRIVATE(ctx)
unsigned int MBEDTLS_PRIVATE(can_output_key) size_t MBEDTLS_PRIVATE(capacity)
psa_algorithm_t MBEDTLS_PRIVATE(alg)
psa_algorithm_t MBEDTLS_PRIVATE(alg)
psa_key_usage_t MBEDTLS_PRIVATE(usage)
psa_algorithm_t MBEDTLS_PRIVATE(alg2)
unsigned int MBEDTLS_PRIVATE(is_sign) psa_driver_mac_context_t MBEDTLS_PRIVATE(ctx)
uint8_t MBEDTLS_PRIVATE(mac_size)
unsigned int MBEDTLS_PRIVATE(id)
Unique ID indicating which driver got assigned to do the operation.
The context for PSA interruptible hash signing.
unsigned int MBEDTLS_PRIVATE(id)
Unique ID indicating which driver got assigned to do the operation.
psa_driver_sign_hash_interruptible_context_t MBEDTLS_PRIVATE(ctx)
unsigned int MBEDTLS_PRIVATE(error_occurred) uint32_t MBEDTLS_PRIVATE(num_ops)
The context for PSA interruptible hash verification.
unsigned int MBEDTLS_PRIVATE(id)
Unique ID indicating which driver got assigned to do the operation.
unsigned int MBEDTLS_PRIVATE(error_occurred) uint32_t MBEDTLS_PRIVATE(num_ops)
psa_driver_verify_hash_interruptible_context_t MBEDTLS_PRIVATE(ctx)