1 /* 2 Copyright (c) 2021 Fraunhofer AISEC. See the COPYRIGHT 3 file at the top-level directory of this distribution. 4 5 Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or 6 http://www.apache.org/licenses/LICENSE-2.0> or the MIT license 7 <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your 8 option. This file may not be copied, modified, or distributed 9 except according to those terms. 10 */ 11 #ifndef EDHOC_TESTS_H 12 #define EDHOC_TESTS_H 13 14 #include <stdint.h> 15 //#include "../../samples/common/test_vec_parser.h" 16 17 struct messages { 18 uint8_t *m1; 19 uint32_t m1_len; 20 uint8_t *m2; 21 uint32_t m2_len; 22 uint8_t *m3; 23 uint32_t m3_len; 24 uint8_t *m4; 25 uint32_t m4_len; 26 }; 27 28 //extern struct messages_bufs m_bufs; 29 extern struct messages m; 30 31 /** 32 * @brief Test EDHOC initiator according to RFC9529 Section 2. 33 * Authentication with Signatures, X.509 Identified by 'x5t' 34 */ 35 void test_edhoc_initiator_x509_x5t_rfc9529(); 36 /** 37 * @brief Test EDHOC initiator according to RFC9529 Section 2. 38 * Authentication with Signatures, X.509 Identified by 'x5t' 39 */ 40 void test_edhoc_responder_x509_x5t_rfc9529(); 41 42 /** 43 * @brief Tests the functions of the exporter interface 44 */ 45 void test_exporter(void); 46 47 /** 48 * @brief Executes an instance of a responder and a initiator in 49 * parallel and checks if the results are the same. This test is 50 * especially relevant for ECC suites, e.g. P256 since signatures 51 * created with such suites are non-deterministic and therefore it 52 * is not possible to run only one of the party and to compare the 53 * results with pre computed values. 54 * @param vec_num the test vector number 55 */ 56 void test_initiator_responder_interaction(int vec_num); 57 58 void t_initiator_responder_interaction1(); 59 void t_initiator_responder_interaction2(); 60 #endif