mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 22:45:48 +01:00
Move the cipher operation structure declaration for grouping
Cipher and Hash are grouped, since they are 'primitive' operations. Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
This commit is contained in:
parent
7c3213921a
commit
14d09f4223
@ -76,7 +76,8 @@ extern "C" {
|
||||
#include "mbedtls/cmac.h"
|
||||
#include "mbedtls/gcm.h"
|
||||
|
||||
/* Include the context definition for the compiled-in drivers */
|
||||
/* Include the context definition for the compiled-in drivers for the primitive
|
||||
* algorithms. */
|
||||
#include "psa/crypto_driver_contexts_primitives.h"
|
||||
|
||||
struct psa_hash_operation_s
|
||||
@ -98,6 +99,31 @@ static inline struct psa_hash_operation_s psa_hash_operation_init( void )
|
||||
return( v );
|
||||
}
|
||||
|
||||
struct psa_cipher_operation_s
|
||||
{
|
||||
/** Unique ID indicating which driver got assigned to do the
|
||||
* operation. Since driver contexts are driver-specific, swapping
|
||||
* drivers halfway through the operation is not supported.
|
||||
* ID values are auto-generated in psa_crypto_driver_wrappers.h
|
||||
* ID value zero means the context is not valid or not assigned to
|
||||
* any driver (i.e. none of the driver contexts are active). */
|
||||
unsigned int id;
|
||||
|
||||
unsigned int iv_required : 1;
|
||||
unsigned int iv_set : 1;
|
||||
|
||||
uint8_t default_iv_length;
|
||||
|
||||
psa_driver_cipher_context_t ctx;
|
||||
};
|
||||
|
||||
#define PSA_CIPHER_OPERATION_INIT {0, 0, 0, 0, {0}}
|
||||
static inline struct psa_cipher_operation_s psa_cipher_operation_init( void )
|
||||
{
|
||||
const struct psa_cipher_operation_s v = PSA_CIPHER_OPERATION_INIT;
|
||||
return( v );
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_MD_C)
|
||||
typedef struct
|
||||
{
|
||||
@ -138,31 +164,6 @@ static inline struct psa_mac_operation_s psa_mac_operation_init( void )
|
||||
return( v );
|
||||
}
|
||||
|
||||
struct psa_cipher_operation_s
|
||||
{
|
||||
/** Unique ID indicating which driver got assigned to do the
|
||||
* operation. Since driver contexts are driver-specific, swapping
|
||||
* drivers halfway through the operation is not supported.
|
||||
* ID values are auto-generated in psa_crypto_driver_wrappers.h
|
||||
* ID value zero means the context is not valid or not assigned to
|
||||
* any driver (i.e. none of the driver contexts are active). */
|
||||
unsigned int id;
|
||||
|
||||
unsigned int iv_required : 1;
|
||||
unsigned int iv_set : 1;
|
||||
|
||||
uint8_t default_iv_length;
|
||||
|
||||
psa_driver_cipher_context_t ctx;
|
||||
};
|
||||
|
||||
#define PSA_CIPHER_OPERATION_INIT {0, 0, 0, 0, {0}}
|
||||
static inline struct psa_cipher_operation_s psa_cipher_operation_init( void )
|
||||
{
|
||||
const struct psa_cipher_operation_s v = PSA_CIPHER_OPERATION_INIT;
|
||||
return( v );
|
||||
}
|
||||
|
||||
struct psa_aead_operation_s
|
||||
{
|
||||
psa_algorithm_t alg;
|
||||
|
Loading…
Reference in New Issue
Block a user