mirror of
				https://github.com/Mbed-TLS/mbedtls.git
				synced 2025-10-30 10:45:34 +03:00 
			
		
		
		
	Add input round-trip testcase
Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
		| @@ -40,6 +40,9 @@ input_copy_free:200 | |||||||
| PSA crypto input copy free, NULL buffer | PSA crypto input copy free, NULL buffer | ||||||
| input_copy_free:0 | input_copy_free:0 | ||||||
|  |  | ||||||
|  | PSA crypto input copy round-trip | ||||||
|  | input_copy_round_trip | ||||||
|  |  | ||||||
| PSA crypto output copy alloc | PSA crypto output copy alloc | ||||||
| output_copy_alloc:200:PSA_SUCCESS | output_copy_alloc:200:PSA_SUCCESS | ||||||
|  |  | ||||||
|   | |||||||
| @@ -131,6 +131,27 @@ exit: | |||||||
| } | } | ||||||
| /* END_CASE */ | /* END_CASE */ | ||||||
|  |  | ||||||
|  | /* BEGIN_CASE */ | ||||||
|  | void input_copy_round_trip() | ||||||
|  | { | ||||||
|  |     psa_crypto_input_copy_t input_copy; | ||||||
|  |     uint8_t input[200]; | ||||||
|  |     psa_status_t status; | ||||||
|  |  | ||||||
|  |     fill_buffer_pattern(input, sizeof(input)); | ||||||
|  |  | ||||||
|  |     status = psa_crypto_input_copy_alloc(input, sizeof(input), &input_copy); | ||||||
|  |     TEST_EQUAL(status, PSA_SUCCESS); | ||||||
|  |     TEST_MEMORY_COMPARE(input_copy.buffer, input_copy.len, | ||||||
|  |                         input, sizeof(input)); | ||||||
|  |     TEST_ASSERT(input_copy.buffer != input); | ||||||
|  |  | ||||||
|  |     psa_crypto_input_copy_free(&input_copy); | ||||||
|  |     TEST_ASSERT(input_copy.buffer == NULL); | ||||||
|  |     TEST_EQUAL(input_copy.len, 0); | ||||||
|  | } | ||||||
|  | /* END_CASE */ | ||||||
|  |  | ||||||
| /* BEGIN_CASE */ | /* BEGIN_CASE */ | ||||||
| void output_copy_alloc(int output_len, psa_status_t exp_status) | void output_copy_alloc(int output_len, psa_status_t exp_status) | ||||||
| { | { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user