1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-14 17:13:50 +01:00
RIOT/tests/sys/crypto/tests-crypto.h
Marian Buschsieweke f8029e8891
tests/sys: use SPDX copyright tags
Co-authored-by: crasbe <crasbe@gmail.com>
2025-11-22 08:48:27 +01:00

69 lines
1.3 KiB
C

/*
* SPDX-FileCopyrightText: 2014 Philipp Rosenkranz
* SPDX-FileCopyrightText: 2014 Nico von Geyso
* SPDX-License-Identifier: LGPL-2.1-only
*/
#pragma once
/**
* @addtogroup unittests
* @{
*
* @file
* @brief Unittests for the ``crypto`` module
*
* @author Philipp Rosenkranz <philipp.rosenkranz@fu-berlin.de>
*/
#include <stddef.h>
#include <stdint.h>
#include "embUnit.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Generates tests for helper functions
*
* @return embUnit tests
*/
Test *tests_crypto_helper_tests(void);
/**
* @brief Generates tests for crypto/chacha.h
*
* @return embUnit tests if successful, NULL if not.
*/
Test *tests_crypto_chacha_tests(void);
Test *tests_crypto_poly1305_tests(void);
Test *tests_crypto_chacha20poly1305_tests(void);
static inline int compare(const uint8_t *a, const uint8_t *b, uint8_t len)
{
int result = 1;
for (uint8_t i = 0; i < len; ++i) {
result &= a[i] == b[i];
}
return result;
}
Test* tests_crypto_aes_tests(void);
Test* tests_crypto_cipher_tests(void);
Test* tests_crypto_modes_ccm_tests(void);
Test* tests_crypto_modes_ocb_tests(void);
Test* tests_crypto_modes_ecb_tests(void);
Test* tests_crypto_modes_cbc_tests(void);
Test* tests_crypto_modes_ctr_tests(void);
#ifdef __cplusplus
}
#endif
/** @} */