From 5169aaa01392d638115f8d321795794d63227af6 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 13 Feb 2020 15:21:17 +0700 Subject: [PATCH] renaming --- src/Adafruit_nRFCrypto.h | 4 ++-- ...nRFCrypto_Random.cpp => nRFCrypto_Random.cpp} | 16 ++++++++-------- ...uit_nRFCrypto_Random.h => nRFCrypto_Random.h} | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) rename src/{Adafruit_nRFCrypto_Random.cpp => nRFCrypto_Random.cpp} (85%) rename src/{Adafruit_nRFCrypto_Random.h => nRFCrypto_Random.h} (89%) diff --git a/src/Adafruit_nRFCrypto.h b/src/Adafruit_nRFCrypto.h index 2bf89a8..0e09bd5 100644 --- a/src/Adafruit_nRFCrypto.h +++ b/src/Adafruit_nRFCrypto.h @@ -28,7 +28,7 @@ #include "common_inc.h" #include "rtos.h" -#include "Adafruit_nRFCrypto_Random.h" +#include "nRFCrypto_Random.h" #include "Adafruit_nRFCrypto_Hash.h" #include "ecc/nRFCrypto_ECC.h" @@ -43,7 +43,7 @@ class Adafruit_nRFCrypto void enable(void); void disable(void); - Adafruit_nRFCrypto_Random Random; + nRFCrypto_Random Random; private: uint32_t _en_count; diff --git a/src/Adafruit_nRFCrypto_Random.cpp b/src/nRFCrypto_Random.cpp similarity index 85% rename from src/Adafruit_nRFCrypto_Random.cpp rename to src/nRFCrypto_Random.cpp index b69ca58..b182991 100644 --- a/src/Adafruit_nRFCrypto_Random.cpp +++ b/src/nRFCrypto_Random.cpp @@ -30,12 +30,12 @@ //------------- IMPLEMENTATION -------------// -Adafruit_nRFCrypto_Random::Adafruit_nRFCrypto_Random(void) +nRFCrypto_Random::nRFCrypto_Random(void) { _begun = false; } -bool Adafruit_nRFCrypto_Random::begin(void) +bool nRFCrypto_Random::begin(void) { // skip if already called begin before if (_begun) return true; @@ -56,7 +56,7 @@ bool Adafruit_nRFCrypto_Random::begin(void) return true; } -void Adafruit_nRFCrypto_Random::end(void) +void nRFCrypto_Random::end(void) { // skipped if not begin-ed if (!_begun) return; @@ -72,12 +72,12 @@ void Adafruit_nRFCrypto_Random::end(void) } -CRYS_RND_State_t* Adafruit_nRFCrypto_Random::getContext(void) +CRYS_RND_State_t* nRFCrypto_Random::getContext(void) { return &_state; } -bool Adafruit_nRFCrypto_Random::addAdditionalInput(uint8_t* input, uint16_t size) +bool nRFCrypto_Random::addAdditionalInput(uint8_t* input, uint16_t size) { nRFCrypto.enable(); @@ -89,7 +89,7 @@ bool Adafruit_nRFCrypto_Random::addAdditionalInput(uint8_t* input, uint16_t size return true; } -bool Adafruit_nRFCrypto_Random::reseed(void) +bool nRFCrypto_Random::reseed(void) { CRYS_RND_WorkBuff_t* workbuf = (CRYS_RND_WorkBuff_t*) rtos_malloc(sizeof(CRYS_RND_WorkBuff_t)); VERIFY(workbuf); @@ -106,7 +106,7 @@ bool Adafruit_nRFCrypto_Random::reseed(void) return true; } -bool Adafruit_nRFCrypto_Random::generate(uint8_t* buf, uint16_t bufsize) +bool nRFCrypto_Random::generate(uint8_t* buf, uint16_t bufsize) { nRFCrypto.enable(); @@ -118,7 +118,7 @@ bool Adafruit_nRFCrypto_Random::generate(uint8_t* buf, uint16_t bufsize) return true; } -bool Adafruit_nRFCrypto_Random::generateInRange(uint8_t* buf, uint32_t bitsize, uint8_t* max) +bool nRFCrypto_Random::generateInRange(uint8_t* buf, uint32_t bitsize, uint8_t* max) { nRFCrypto.enable(); diff --git a/src/Adafruit_nRFCrypto_Random.h b/src/nRFCrypto_Random.h similarity index 89% rename from src/Adafruit_nRFCrypto_Random.h rename to src/nRFCrypto_Random.h index 8a25660..3981436 100644 --- a/src/Adafruit_nRFCrypto_Random.h +++ b/src/nRFCrypto_Random.h @@ -22,15 +22,15 @@ * THE SOFTWARE. */ -#ifndef ADAFRUIT_NRFCRYPTO_RANDOM_H_ -#define ADAFRUIT_NRFCRYPTO_RANDOM_H_ +#ifndef NRFCRYPTO_RANDOM_H_ +#define NRFCRYPTO_RANDOM_H_ #include "nrf_cc310/include/crys_rnd.h" -class Adafruit_nRFCrypto_Random +class nRFCrypto_Random { public: - Adafruit_nRFCrypto_Random(void); + nRFCrypto_Random(void); bool begin(void); void end(void); @@ -49,4 +49,4 @@ class Adafruit_nRFCrypto_Random bool _begun; }; -#endif /* ADAFRUIT_NRFCRYPTO_RANDOM_H_ */ +#endif /* NRFCRYPTO_RANDOM_H_ */