From a53c566375f5184ec4f20935be5210d8c48e9d1b Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 27 May 2015 21:19:17 +0200 Subject: [PATCH] SIZE -> LEN, for consistency --- demos/auth.c | 2 +- demos/box.c | 4 ++-- demos/box_detached.c | 4 ++-- demos/generichash.c | 2 +- demos/generichash_stream.c | 2 +- demos/shorthash.c | 2 +- demos/sign.c | 4 ++-- demos/utils.c | 2 +- demos/utils.h | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/demos/auth.c b/demos/auth.c index 905b8287..d11ffde7 100644 --- a/demos/auth.c +++ b/demos/auth.c @@ -38,7 +38,7 @@ auth(void) { unsigned char key[crypto_auth_KEYBYTES]; unsigned char mac[crypto_auth_BYTES]; - unsigned char message[MAX_INPUT_SIZE]; + unsigned char message[MAX_INPUT_LEN]; size_t message_len; int ret; diff --git a/demos/box.c b/demos/box.c index 066ac4e4..421d4a31 100644 --- a/demos/box.c +++ b/demos/box.c @@ -57,8 +57,8 @@ box(void) unsigned char alice_sk[crypto_box_SECRETKEYBYTES]; /* Alice's secret key */ unsigned char nonce[crypto_box_NONCEBYTES]; - unsigned char message[MAX_INPUT_SIZE]; - unsigned char ciphertext[crypto_box_MACBYTES + MAX_INPUT_SIZE]; + unsigned char message[MAX_INPUT_LEN]; + unsigned char ciphertext[crypto_box_MACBYTES + MAX_INPUT_LEN]; size_t message_len; size_t ciphertext_len; int ret; diff --git a/demos/box_detached.c b/demos/box_detached.c index 2d8cd3ef..f93b7af7 100644 --- a/demos/box_detached.c +++ b/demos/box_detached.c @@ -57,9 +57,9 @@ box_detached(void) unsigned char alice_sk[crypto_box_SECRETKEYBYTES]; /* Alice's secret key */ unsigned char nonce[crypto_box_NONCEBYTES]; - unsigned char message[MAX_INPUT_SIZE]; + unsigned char message[MAX_INPUT_LEN]; unsigned char mac[crypto_box_MACBYTES]; - unsigned char ciphertext[MAX_INPUT_SIZE]; + unsigned char ciphertext[MAX_INPUT_LEN]; size_t message_len; int ret; diff --git a/demos/generichash.c b/demos/generichash.c index 51f5978f..2167514b 100644 --- a/demos/generichash.c +++ b/demos/generichash.c @@ -54,7 +54,7 @@ generichash(void) { unsigned char key[crypto_generichash_KEYBYTES_MAX]; unsigned char hash[crypto_generichash_BYTES]; - unsigned char message[MAX_INPUT_SIZE]; + unsigned char message[MAX_INPUT_LEN]; size_t message_len; size_t key_len; diff --git a/demos/generichash_stream.c b/demos/generichash_stream.c index 1db3fc39..4550ac10 100644 --- a/demos/generichash_stream.c +++ b/demos/generichash_stream.c @@ -20,7 +20,7 @@ generichash_stream(void) { unsigned char key[crypto_generichash_KEYBYTES_MAX]; unsigned char hash[crypto_generichash_BYTES]; - unsigned char message_part[MAX_INPUT_SIZE]; + unsigned char message_part[MAX_INPUT_LEN]; crypto_generichash_state state; size_t message_part_len; diff --git a/demos/shorthash.c b/demos/shorthash.c index cc31d711..0cd6cdd0 100644 --- a/demos/shorthash.c +++ b/demos/shorthash.c @@ -37,7 +37,7 @@ shorthash(void) { unsigned char key[crypto_shorthash_KEYBYTES]; unsigned char hash[crypto_shorthash_BYTES]; - unsigned char message[MAX_INPUT_SIZE]; + unsigned char message[MAX_INPUT_LEN]; size_t message_len; puts("Example: crypto_shorthash\n"); diff --git a/demos/sign.c b/demos/sign.c index e9c8f007..78a9279f 100644 --- a/demos/sign.c +++ b/demos/sign.c @@ -24,8 +24,8 @@ sign(void) { unsigned char pk[crypto_sign_PUBLICKEYBYTES]; /* Bob's public key */ unsigned char sk[crypto_sign_SECRETKEYBYTES]; /* Bob's secret key */ - unsigned char message[MAX_INPUT_SIZE]; - unsigned char message_signed[crypto_sign_BYTES + MAX_INPUT_SIZE]; + unsigned char message[MAX_INPUT_LEN]; + unsigned char message_signed[crypto_sign_BYTES + MAX_INPUT_LEN]; unsigned long long message_len; unsigned long long message_signed_len; int ret; diff --git a/demos/utils.c b/demos/utils.c index 0542aef8..f3d8bb90 100644 --- a/demos/utils.c +++ b/demos/utils.c @@ -44,7 +44,7 @@ size_t prompt_input(const char *prompt, char *input, const size_t max_input_len, int variable_length) { - char input_tmp[MAX_INPUT_SIZE + 1U]; + char input_tmp[MAX_INPUT_LEN + 1U]; size_t actual_input_len; if (variable_length != 0) { diff --git a/demos/utils.h b/demos/utils.h index b88347fd..4e6d1b79 100644 --- a/demos/utils.h +++ b/demos/utils.h @@ -6,7 +6,7 @@ #include -#define MAX_INPUT_SIZE 4096 /* max size of all input buffers in the demo */ +#define MAX_INPUT_LEN 4096 /* max size of all input buffers in the demo */ void print_hex(const void *bin, const size_t bin_len);