Commit f4a3f301 authored by Paul Bakker's avatar Paul Bakker
Browse files

- Updated for migration to size_t

parent 8101cd2f
......@@ -7,7 +7,7 @@ base64_encode:src_string:dst_string:dst_buf_size:result
{
unsigned char src_str[1000];
unsigned char dst_str[1000];
int len = {dst_buf_size};
size_t len = {dst_buf_size};
memset(src_str, 0x00, 1000);
memset(dst_str, 0x00, 1000);
......@@ -26,7 +26,7 @@ base64_decode:src_string:dst_string:result
{
unsigned char src_str[1000];
unsigned char dst_str[1000];
int len = 1000;
size_t len = 1000;
int res;
memset(src_str, 0x00, 1000);
......
......@@ -76,7 +76,7 @@ dec_empty_buf:
unsigned char encbuf[64];
unsigned char decbuf[64];
int outlen = 0;
size_t outlen = 0;
memset( key, 0, 32 );
memset( iv , 0, 16 );
......
......@@ -12,10 +12,10 @@ dhm_do_dhm:x_size:radix_P:input_P:radix_G:input_G
unsigned char pub_cli[1000];
unsigned char sec_srv[1000];
unsigned char sec_cli[1000];
int ske_len = 0;
int pub_cli_len = 0;
int sec_srv_len = 1000;
int sec_cli_len = 1000;
size_t ske_len = 0;
size_t pub_cli_len = 0;
size_t sec_srv_len = 1000;
size_t sec_cli_len = 1000;
int x_size;
rnd_pseudo_info rnd_info;
......
......@@ -16,7 +16,7 @@ mpi_read_write_string:radix_X:input_X:radix_A:input_A:output_size:result_read:re
{
mpi X;
char str[1000];
int len = {output_size};
size_t len = {output_size};
mpi_init(&X, NULL);
......@@ -38,8 +38,8 @@ mpi_read_binary:input_X:radix_A:input_A
mpi X;
unsigned char str[1000];
unsigned char buf[1000];
int len = 1000;
int input_len;
size_t len = 1000;
size_t input_len;
mpi_init(&X, NULL);
......@@ -57,7 +57,7 @@ mpi_write_binary:radix_X:input_X:input_A:output_size:result
mpi X;
unsigned char str[1000];
unsigned char buf[1000];
int buflen;
size_t buflen;
memset( buf, 0x00, 1000 );
memset( str, 0x00, 1000 );
......@@ -86,7 +86,7 @@ mpi_read_file:radix_X:input_file:input_A:result
mpi X;
unsigned char str[1000];
unsigned char buf[1000];
int buflen;
size_t buflen;
FILE *file;
memset( buf, 0x00, 1000 );
......
......@@ -17,7 +17,7 @@ pkcs1_rsaes_oaep_encrypt:mod:radix_N:input_N:radix_E:input_E:hash:message_hex_st
unsigned char output_str[1000];
unsigned char rnd_buf[1000];
rsa_context ctx;
int msg_len;
size_t msg_len;
rnd_buf_info info;
info.length = unhexify( rnd_buf, {seed} );
......@@ -55,8 +55,8 @@ pkcs1_rsaes_oaep_decrypt:mod:radix_P:input_P:radix_Q:input_Q:radix_N:input_N:rad
unsigned char output_str[1000];
rsa_context ctx;
mpi P1, Q1, H, G;
int output_len;
int msg_len;
size_t output_len;
size_t msg_len;
mpi_init( &P1, &Q1, &H, &G, NULL );
rsa_init( &ctx, RSA_PKCS_V21, {hash} );
......@@ -104,7 +104,7 @@ pkcs1_rsassa_pss_sign:mod:radix_P:input_P:radix_Q:input_Q:radix_N:input_N:radix_
unsigned char rnd_buf[1000];
rsa_context ctx;
mpi P1, Q1, H, G;
int msg_len;
size_t msg_len;
rnd_buf_info info;
info.length = unhexify( rnd_buf, {salt} );
......@@ -195,7 +195,7 @@ pkcs1_rsassa_pss_verify:mod:radix_N:input_N:radix_E:input_E:digest:hash:message_
unsigned char hash_result[1000];
unsigned char result_str[1000];
rsa_context ctx;
int msg_len;
size_t msg_len;
rsa_init( &ctx, RSA_PKCS_V21, {hash} );
memset( message_str, 0x00, 1000 );
......
......@@ -227,7 +227,7 @@ rsa_pkcs1_verify_raw:message_hex_string:hash_result_string:padding_mode:mod:radi
unsigned char hash_result[1000];
unsigned char result_str[1000];
rsa_context ctx;
int msg_len, hash_len;
size_t msg_len, hash_len;
rsa_init( &ctx, {padding_mode}, 0 );
memset( message_str, 0x00, 1000 );
......@@ -255,7 +255,7 @@ rsa_pkcs1_encrypt:message_hex_string:padding_mode:mod:radix_N:input_N:radix_E:in
unsigned char output[1000];
unsigned char output_str[1000];
rsa_context ctx;
int msg_len;
size_t msg_len;
rnd_pseudo_info rnd_info;
memset( &rnd_info, 0, sizeof( rnd_pseudo_info ) );
......@@ -290,7 +290,7 @@ rsa_pkcs1_encrypt_bad_rng:message_hex_string:padding_mode:mod:radix_N:input_N:ra
unsigned char output[1000];
unsigned char output_str[1000];
rsa_context ctx;
int msg_len;
size_t msg_len;
rsa_init( &ctx, {padding_mode}, 0 );
memset( message_str, 0x00, 1000 );
......@@ -323,7 +323,7 @@ rsa_pkcs1_decrypt:message_hex_string:padding_mode:mod:radix_P:input_P:radix_Q:in
unsigned char output_str[1000];
rsa_context ctx;
mpi P1, Q1, H, G;
int output_len;
size_t output_len;
mpi_init( &P1, &Q1, &H, &G, NULL );
rsa_init( &ctx, {padding_mode}, 0 );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment