Skip to content

Commit 650771c

Browse files
author
Mika Leppänen
committed
Added unit test to NIST AES KW library
1 parent 6a82e7d commit 650771c

File tree

7 files changed

+533
-0
lines changed

7 files changed

+533
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
include ../../makefile_defines.txt
2+
3+
COMPONENT_NAME = nist_aes_kw_unit
4+
5+
#This must be changed manually
6+
SRC_FILES = \
7+
../../../../../source/Service_Libs/nist_aes_kw/nist_aes_kw.c \
8+
9+
TEST_SRC_FILES = \
10+
main.cpp \
11+
nistaeskwtest.cpp \
12+
test_nist_aes_kw.c \
13+
../../stub/mbed_trace_stub.c \
14+
../../stub/mbedtls_stub.c
15+
16+
include ../../MakefileWorker.mk
17+
18+
CPPUTESTFLAGS += -DFEA_TRACE_SUPPORT -DEXTRA_CONSISTENCY_CHECKS
19+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) 2018, Arm Limited and affiliates.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#include "CppUTest/CommandLineTestRunner.h"
19+
#include "CppUTest/TestPlugin.h"
20+
#include "CppUTest/TestRegistry.h"
21+
#include "CppUTestExt/MockSupportPlugin.h"
22+
int main(int ac, char **av)
23+
{
24+
return CommandLineTestRunner::RunAllTests(ac, av);
25+
}
26+
27+
IMPORT_TEST_GROUP(NIST_AES_KW);
28+
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright (c) 2018, Arm Limited and affiliates.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
#include "CppUTest/TestHarness.h"
18+
19+
#include "test_nist_aes_kw.h"
20+
21+
TEST_GROUP(NIST_AES_KW)
22+
{
23+
void setup() {
24+
}
25+
26+
void teardown() {
27+
}
28+
};
29+
30+
TEST(NIST_AES_KW, test_nist_aes_key_wrap_1)
31+
{
32+
CHECK(test_nist_aes_key_wrap_1());
33+
}
34+
35+
TEST(NIST_AES_KW, test_nist_aes_key_wrap_2)
36+
{
37+
CHECK(test_nist_aes_key_wrap_2());
38+
}
39+
40+
TEST(NIST_AES_KW, test_nist_aes_key_wrap_3)
41+
{
42+
CHECK(test_nist_aes_key_wrap_3());
43+
}
44+
45+
TEST(NIST_AES_KW, test_nist_aes_key_wrap_4)
46+
{
47+
CHECK(test_nist_aes_key_wrap_4());
48+
}
49+
50+
TEST(NIST_AES_KW, test_nist_aes_key_wrap_5)
51+
{
52+
CHECK(test_nist_aes_key_wrap_5());
53+
}
54+

0 commit comments

Comments
 (0)