From 51c7253e4aff3433b60163852f983f0ccacaceec Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Wed, 11 Jan 2017 14:58:42 -0800 Subject: [PATCH] Crypto API cleanup. --- include/Makefile.am | 1 - include/openthread.h | 1 + include/openthread/Makefile.am | 1 + .../{openthread-crypto.h => openthread/crypto.h} | 0 src/core/Makefile.am | 2 +- .../openthread-crypto.cpp => api/crypto_api.cpp} | 14 +++++++------- 6 files changed, 10 insertions(+), 9 deletions(-) rename include/{openthread-crypto.h => openthread/crypto.h} (100%) rename src/core/{crypto/openthread-crypto.cpp => api/crypto_api.cpp} (92%) diff --git a/include/Makefile.am b/include/Makefile.am index 03873a8b7..118bbbe6d 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -64,7 +64,6 @@ PRETTY_SUBDIRS = \ include_HEADERS = \ openthread/link_raw.h \ openthread.h \ - openthread-crypto.h \ openthread-diag.h \ openthread-icmp6.h \ openthread-ip6.h \ diff --git a/include/openthread.h b/include/openthread.h index e392dff36..d1e578520 100644 --- a/include/openthread.h +++ b/include/openthread.h @@ -37,6 +37,7 @@ #include +#include "openthread/crypto.h" #include "openthread/message.h" #include "openthread/tasklet.h" diff --git a/include/openthread/Makefile.am b/include/openthread/Makefile.am index 53ac70f64..41ddd7df6 100644 --- a/include/openthread/Makefile.am +++ b/include/openthread/Makefile.am @@ -30,6 +30,7 @@ include $(abs_top_nlbuild_autotools_dir)/automake/pre.am openthread_headers = \ coap.h \ + crypto.h \ message.h \ tasklet.h \ udp.h \ diff --git a/include/openthread-crypto.h b/include/openthread/crypto.h similarity index 100% rename from include/openthread-crypto.h rename to include/openthread/crypto.h diff --git a/src/core/Makefile.am b/src/core/Makefile.am index 9b2bc39e9..b043ac07e 100644 --- a/src/core/Makefile.am +++ b/src/core/Makefile.am @@ -40,6 +40,7 @@ CPPFLAGS_COMMON = \ SOURCES_COMMON = \ openthread.cpp \ + api/crypto_api.cpp \ api/message_api.cpp \ api/tasklet_api.cpp \ api/udp_api.cpp \ @@ -57,7 +58,6 @@ SOURCES_COMMON = \ crypto/aes_ccm.cpp \ crypto/aes_ecb.cpp \ crypto/hmac_sha256.cpp \ - crypto/openthread-crypto.cpp \ crypto/mbedtls.cpp \ crypto/sha256.cpp \ mac/mac.cpp \ diff --git a/src/core/crypto/openthread-crypto.cpp b/src/core/api/crypto_api.cpp similarity index 92% rename from src/core/crypto/openthread-crypto.cpp rename to src/core/api/crypto_api.cpp index f359e5afb..f5b96ac80 100644 --- a/src/core/crypto/openthread-crypto.cpp +++ b/src/core/api/crypto_api.cpp @@ -28,15 +28,15 @@ /** * @file - * This file implements the C APIs for openthread crypto library. + * This file implements the OpenThread Crypto API. */ -#include -#include -#include -#include -#include -#include +#include "openthread/crypto.h" + +#include "common/debug.hpp" +#include "common/code_utils.hpp" +#include "crypto/hmac_sha256.hpp" +#include "crypto/aes_ccm.hpp" using namespace Thread::Crypto;