From e7c21739a384b729e0d72b6ded77b10f8ccd29aa Mon Sep 17 00:00:00 2001 From: joshua Date: Mon, 7 Nov 2022 23:04:25 +0000 Subject: [PATCH] Move variables above code ok jsing@ --- regress/lib/libcrypto/bf/bf_test.c | 36 +++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/regress/lib/libcrypto/bf/bf_test.c b/regress/lib/libcrypto/bf/bf_test.c index c31bd865baa..153444e9d7f 100644 --- a/regress/lib/libcrypto/bf/bf_test.c +++ b/regress/lib/libcrypto/bf/bf_test.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bf_test.c,v 1.1 2022/11/06 14:56:08 joshua Exp $ */ +/* $OpenBSD: bf_test.c,v 1.2 2022/11/07 23:04:25 joshua Exp $ */ /* * Copyright (c) 2022 Joshua Sing * @@ -981,14 +981,14 @@ static const struct bf_test bf_tests[] = { static int bf_ecb_test(size_t test_number, const struct bf_test *bt) { + BF_KEY key; + uint8_t out[8]; + if (bt->padding) { /* XXX - Handle padding */ return 1; } - BF_KEY key; - uint8_t out[8]; - /* Encryption */ memset(out, 0, sizeof(out)); BF_set_key(&key, bt->key_len, bt->key); @@ -1017,15 +1017,15 @@ bf_ecb_test(size_t test_number, const struct bf_test *bt) static int bf_cbc_test(size_t test_number, const struct bf_test *bt) { + BF_KEY key; + uint8_t out[512]; + uint8_t iv[64]; + if (bt->padding) { /* XXX - Handle padding */ return 1; } - BF_KEY key; - uint8_t out[512]; - uint8_t iv[64]; - /* Encryption */ memset(out, 0, sizeof(out)); memcpy(iv, bt->iv, bt->iv_len); @@ -1056,16 +1056,16 @@ bf_cbc_test(size_t test_number, const struct bf_test *bt) static int bf_cfb64_test(size_t test_number, const struct bf_test *bt) { - if (bt->padding) { - /* XXX - Handle padding */ - return 1; - } - BF_KEY key; uint8_t out[512]; uint8_t iv[64]; int remainder = 0; + if (bt->padding) { + /* XXX - Handle padding */ + return 1; + } + /* Encryption */ memset(out, 0, sizeof(out)); memcpy(iv, bt->iv, bt->iv_len); @@ -1097,16 +1097,16 @@ bf_cfb64_test(size_t test_number, const struct bf_test *bt) static int bf_ofb64_test(size_t test_number, const struct bf_test *bt) { - if (bt->padding) { - /* XXX - Handle padding */ - return 1; - } - BF_KEY key; uint8_t out[512]; uint8_t iv[64]; int remainder = 0; + if (bt->padding) { + /* XXX - Handle padding */ + return 1; + } + /* Encryption */ memset(out, 0, sizeof(out)); memcpy(iv, bt->iv, bt->iv_len); -- 2.20.1