mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-01-06 06:28:56 +01:00
Reduce size of buffers in test suites
This commit is contained in:
parent
d6aea18749
commit
528524bf3c
3 changed files with 46 additions and 46 deletions
|
|
@ -10,14 +10,14 @@
|
|||
/* BEGIN_CASE */
|
||||
void mbedtls_chachapoly_enc( char *hex_key_string, char *hex_nonce_string, char *hex_aad_string, char *hex_input_string, char *hex_output_string, char *hex_mac_string )
|
||||
{
|
||||
unsigned char key_str[32];
|
||||
unsigned char nonce_str[12];
|
||||
unsigned char aad_str[10000];
|
||||
unsigned char input_str[10000];
|
||||
unsigned char output_str[10000];
|
||||
unsigned char mac_str[16];
|
||||
unsigned char output[10000];
|
||||
unsigned char mac[16];
|
||||
unsigned char key_str[32]; /* size set by the standard */
|
||||
unsigned char nonce_str[12]; /* size set by the standard */
|
||||
unsigned char aad_str[12]; /* max size of test data so far */
|
||||
unsigned char input_str[265]; /* max size of binary input/output so far */
|
||||
unsigned char output_str[265];
|
||||
unsigned char output[265];
|
||||
unsigned char mac_str[16]; /* size set by the standard */
|
||||
unsigned char mac[16]; /* size set by the standard */
|
||||
size_t input_len;
|
||||
size_t output_len;
|
||||
size_t aad_len;
|
||||
|
|
@ -26,12 +26,12 @@ void mbedtls_chachapoly_enc( char *hex_key_string, char *hex_nonce_string, char
|
|||
size_t mac_len;
|
||||
mbedtls_chachapoly_context ctx;
|
||||
|
||||
memset( key_str, 0x00, 32 );
|
||||
memset( nonce_str, 0x00, 12 );
|
||||
memset( aad_str, 0x00, 10000 );
|
||||
memset( input_str, 0x00, 10000 );
|
||||
memset( output_str, 0x00, 10000 );
|
||||
memset( mac_str, 0x00, 16 );
|
||||
memset( key_str, 0x00, sizeof( key_str ) );
|
||||
memset( nonce_str, 0x00, sizeof( nonce_str ) );
|
||||
memset( aad_str, 0x00, sizeof( aad_str ) );
|
||||
memset( input_str, 0x00, sizeof( input_str ) );
|
||||
memset( output_str, 0x00, sizeof( output_str ) );
|
||||
memset( mac_str, 0x00, sizeof( mac_str ) );
|
||||
|
||||
aad_len = unhexify( aad_str, hex_aad_string );
|
||||
input_len = unhexify( input_str, hex_input_string );
|
||||
|
|
@ -65,13 +65,13 @@ exit:
|
|||
/* BEGIN_CASE */
|
||||
void mbedtls_chachapoly_dec( char *hex_key_string, char *hex_nonce_string, char *hex_aad_string, char *hex_input_string, char *hex_output_string, char *hex_mac_string )
|
||||
{
|
||||
unsigned char key_str[32];
|
||||
unsigned char nonce_str[12];
|
||||
unsigned char aad_str[10000];
|
||||
unsigned char input_str[10000];
|
||||
unsigned char output_str[10000];
|
||||
unsigned char mac_str[16];
|
||||
unsigned char output[10000];
|
||||
unsigned char key_str[32]; /* size set by the standard */
|
||||
unsigned char nonce_str[12]; /* size set by the standard */
|
||||
unsigned char aad_str[12]; /* max size of test data so far */
|
||||
unsigned char input_str[265]; /* max size of binary input/output so far */
|
||||
unsigned char output_str[265];
|
||||
unsigned char output[265];
|
||||
unsigned char mac_str[16]; /* size set by the standard */
|
||||
size_t input_len;
|
||||
size_t output_len;
|
||||
size_t aad_len;
|
||||
|
|
@ -81,12 +81,12 @@ void mbedtls_chachapoly_dec( char *hex_key_string, char *hex_nonce_string, char
|
|||
int ret;
|
||||
mbedtls_chachapoly_context ctx;
|
||||
|
||||
memset( key_str, 0x00, 32 );
|
||||
memset( nonce_str, 0x00, 12 );
|
||||
memset( aad_str, 0x00, 10000 );
|
||||
memset( input_str, 0x00, 10000 );
|
||||
memset( output_str, 0x00, 10000 );
|
||||
memset( mac_str, 0x00, 16 );
|
||||
memset( key_str, 0x00, sizeof( key_str ) );
|
||||
memset( nonce_str, 0x00, sizeof( nonce_str ) );
|
||||
memset( aad_str, 0x00, sizeof( aad_str ) );
|
||||
memset( input_str, 0x00, sizeof( input_str ) );
|
||||
memset( output_str, 0x00, sizeof( output_str ) );
|
||||
memset( mac_str, 0x00, sizeof( mac_str ) );
|
||||
|
||||
aad_len = unhexify( aad_str, hex_aad_string );
|
||||
input_len = unhexify( input_str, hex_input_string );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue