Use proper input length in encryption examples 03/86303/1 accepted/tizen/common/20160901.143419 accepted/tizen/ivi/20160901.065526 accepted/tizen/mobile/20160901.065440 accepted/tizen/tv/20160901.065447 accepted/tizen/wearable/20160901.065507 submit/tizen/20160901.024233
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Wed, 31 Aug 2016 11:11:43 +0000 (13:11 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Wed, 31 Aug 2016 11:11:43 +0000 (13:11 +0200)
Change-Id: I0a20faf41bf2b5e7670baf6100742f851b3420ff

examples/encrypt.c
examples/encrypt_aes_gcm_ccm.c
examples/seal.c

index 2d5c2c5..f152588 100644 (file)
@@ -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 */
index c823d6a..64a689f 100644 (file)
@@ -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 */
index 7a1aaa0..c0feacf 100644 (file)
@@ -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 */