mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-04 04:32:24 -05: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
							
								
									f4248f2e1b
								
							
						
					
					
						commit
						61398ec5dc
					
				@ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user