aboutsummaryrefslogtreecommitdiffstats
path: root/test/crypto/source/test/cry_test_root.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/crypto/source/test/cry_test_root.h')
-rw-r--r--test/crypto/source/test/cry_test_root.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/test/crypto/source/test/cry_test_root.h b/test/crypto/source/test/cry_test_root.h
new file mode 100644
index 000000000..2bb5ab029
--- /dev/null
+++ b/test/crypto/source/test/cry_test_root.h
@@ -0,0 +1,78 @@
+/*
+ ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+/**
+ * @file cry_test_root.h
+ * @brief Test Suite root structures header.
+ */
+
+#ifndef CRY_TEST_ROOT_H
+#define CRY_TEST_ROOT_H
+
+#include "ch_test.h"
+
+#include "cry_test_sequence_001.h"
+#include "cry_test_sequence_002.h"
+#include "cry_test_sequence_003.h"
+#include "cry_test_sequence_004.h"
+
+#if !defined(__DOXYGEN__)
+
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
+
+extern const testsuite_t cry_test_suite;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+/*===========================================================================*/
+/* Shared definitions. */
+/*===========================================================================*/
+
+extern void cryptoTest_setStream(BaseSequentialStream * s);
+extern void cryptoTest_printArray32(bool isLE,const uint32_t *a,size_t len);
+#ifdef LOG_CRYPTO_DATA
+#define SHOW_ENCRYPDATA(w) cryptoTest_printArray32(true,msg_encrypted,w)
+#define SHOW_DECRYPDATA(w) cryptoTest_printArray32(true,msg_decrypted,w)
+#else
+#define SHOW_ENCRYPDATA(w)
+#define SHOW_DECRYPDATA(w)
+#endif
+
+#define TEST_DATA_BYTE_LEN 640
+#define TEST_DATA_WORD_LEN (TEST_DATA_BYTE_LEN / 4)
+
+
+#define TEST_MSG_DATA_BYTE_LEN 640
+#define TEST_MSG_DATA_WORD_LEN (TEST_MSG_DATA_BYTE_LEN / 4)
+
+extern const char test_plain_data[TEST_DATA_BYTE_LEN];
+extern uint32_t msg_clear[TEST_MSG_DATA_WORD_LEN];
+extern uint32_t msg_encrypted[TEST_MSG_DATA_WORD_LEN];
+extern uint32_t msg_decrypted[TEST_MSG_DATA_WORD_LEN];
+extern const uint32_t test_keys[8];
+extern const uint32_t test_vectors[4];
+
+
+#endif /* !defined(__DOXYGEN__) */
+
+#endif /* CRY_TEST_ROOT_H */