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

53 lines
1.1 KiB
C

/*
* SPDX-FileCopyrightText: 2025 TU Dresden
* SPDX-License-Identifier: LGPL-2.1-only
*/
/**
* @ingroup tests
* @{
*
* @brief Tests the PSA aead configurations
*
* @author Lukas Luger <lukas.luger@mailbox.tu-dresden.de>
*
* @}
*/
#include <stdio.h>
#include "psa/crypto.h"
#include "ztimer.h"
extern psa_status_t example_aead_aes_128_ccm(void);
int main(void)
{
bool failed = false;
psa_status_t status;
psa_crypto_init();
ztimer_acquire(ZTIMER_USEC);
ztimer_now_t start = ztimer_now(ZTIMER_USEC);
start = ztimer_now(ZTIMER_USEC);
status = example_aead_aes_128_ccm();
printf("Authenticated encryption with associated data AES 128 CCM took %d us\n",
(int)(ztimer_now(ZTIMER_USEC) - start));
if (status != PSA_SUCCESS) {
failed = true;
printf("Authenticated encryption with associated data AES 128 CCM failed: %s\n",
psa_status_to_humanly_readable(status));
}
ztimer_release(ZTIMER_USEC);
if (failed) {
puts("Tests failed...");
}
else {
puts("All Done");
}
return 0;
}