From 480b6484ae681ee2792e798eeeced67859b2c345 Mon Sep 17 00:00:00 2001 From: Krzysztof Jackiewicz Date: Wed, 31 Aug 2016 13:11:43 +0200 Subject: [PATCH] Use proper input length in encryption examples Change-Id: I0a20faf41bf2b5e7670baf6100742f851b3420ff --- examples/encrypt.c | 2 +- examples/encrypt_aes_gcm_ccm.c | 4 ++-- examples/seal.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/encrypt.c b/examples/encrypt.c index 2d5c2c5..f152588 100644 --- a/examples/encrypt.c +++ b/examples/encrypt.c @@ -146,7 +146,7 @@ void encrypt_advanced(const yaca_encrypt_algorithm_e algo, goto exit; /* For the update */ - if (yaca_context_get_output_length(ctx, LOREM4096_SIZE, &output_len) != YACA_ERROR_NONE) + if (yaca_context_get_output_length(ctx, enc_len, &output_len) != YACA_ERROR_NONE) goto exit; /* For the finalize */ diff --git a/examples/encrypt_aes_gcm_ccm.c b/examples/encrypt_aes_gcm_ccm.c index c823d6a..64a689f 100644 --- a/examples/encrypt_aes_gcm_ccm.c +++ b/examples/encrypt_aes_gcm_ccm.c @@ -133,7 +133,7 @@ void encrypt_decrypt_aes_gcm(void) goto exit; /* For the update */ - if (yaca_context_get_output_length(ctx, LOREM4096_SIZE, &output_len) != YACA_ERROR_NONE) + if (yaca_context_get_output_length(ctx, enc_len, &output_len) != YACA_ERROR_NONE) goto exit; /* For the finalize */ @@ -286,7 +286,7 @@ void encrypt_decrypt_aes_ccm(void) goto exit; /* For the update */ - if (yaca_context_get_output_length(ctx, LOREM4096_SIZE, &output_len) != YACA_ERROR_NONE) + if (yaca_context_get_output_length(ctx, enc_len, &output_len) != YACA_ERROR_NONE) goto exit; /* For the finalize */ diff --git a/examples/seal.c b/examples/seal.c index 7a1aaa0..c0feacf 100644 --- a/examples/seal.c +++ b/examples/seal.c @@ -100,7 +100,7 @@ void encrypt_seal(const yaca_encrypt_algorithm_e algo, goto exit; /* For the update */ - if (yaca_context_get_output_length(ctx, LOREM4096_SIZE, &output_len) != YACA_ERROR_NONE) + if (yaca_context_get_output_length(ctx, enc_len, &output_len) != YACA_ERROR_NONE) goto exit; /* For the finalize */ @@ -236,7 +236,7 @@ void encrypt_seal_aes_gcm(void) goto exit; /* For the update */ - if (yaca_context_get_output_length(ctx, LOREM4096_SIZE, &output_len) != YACA_ERROR_NONE) + if (yaca_context_get_output_length(ctx, enc_len, &output_len) != YACA_ERROR_NONE) goto exit; /* For the finalize */ @@ -391,7 +391,7 @@ void encrypt_seal_aes_ccm(void) goto exit; /* For the update */ - if (yaca_context_get_output_length(ctx, LOREM4096_SIZE, &output_len) != YACA_ERROR_NONE) + if (yaca_context_get_output_length(ctx, enc_len, &output_len) != YACA_ERROR_NONE) goto exit; /* For the finalize */ -- 2.7.4