SIZE -> LEN, for consistency

This commit is contained in:
Frank Denis 2015-05-27 21:19:17 +02:00
parent 8b8f89d437
commit a53c566375
9 changed files with 12 additions and 12 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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");

View File

@ -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;

View File

@ -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) {

View File

@ -6,7 +6,7 @@
#include <stddef.h>
#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);