diff --git a/libraries/Crypto/ChaChaPoly.cpp b/libraries/Crypto/ChaChaPoly.cpp index 3259cc81..c6cb3019 100644 --- a/libraries/Crypto/ChaChaPoly.cpp +++ b/libraries/Crypto/ChaChaPoly.cpp @@ -99,6 +99,7 @@ bool ChaChaPoly::setIV(const uint8_t *iv, size_t len) state.dataSize = 0; state.dataStarted = false; state.ivSize = len; + return true; } void ChaChaPoly::encrypt(uint8_t *output, const uint8_t *input, size_t len) diff --git a/libraries/Crypto/Ed25519.cpp b/libraries/Crypto/Ed25519.cpp index 004d225a..39c7e91a 100644 --- a/libraries/Crypto/Ed25519.cpp +++ b/libraries/Crypto/Ed25519.cpp @@ -256,7 +256,6 @@ void Ed25519::generatePrivateKey(uint8_t privateKey[32]) void Ed25519::derivePublicKey(uint8_t publicKey[32], const uint8_t privateKey[32]) { SHA512 hash; - uint8_t *buf = (uint8_t *)(hash.state.w); limb_t a[NUM_LIMBS_256BIT]; Point ptA; diff --git a/libraries/Crypto/GCM.cpp b/libraries/Crypto/GCM.cpp index 537a25db..9550d801 100644 --- a/libraries/Crypto/GCM.cpp +++ b/libraries/Crypto/GCM.cpp @@ -122,6 +122,7 @@ bool GCMCommon::setIV(const uint8_t *iv, size_t len) // This value will be XOR'ed with the final authentication hash // value in computeTag(). blockCipher->encryptBlock(state.nonce, state.counter); + return true; } /** diff --git a/libraries/Crypto/Hash.cpp b/libraries/Crypto/Hash.cpp index f49b9b6f..ef132572 100644 --- a/libraries/Crypto/Hash.cpp +++ b/libraries/Crypto/Hash.cpp @@ -171,8 +171,8 @@ void Hash::formatHMACKey(void *block, const void *key, size_t len, uint8_t pad) finalize(block, len); reset(); } - memset(block + len, pad, size - len); uint8_t *b = (uint8_t *)block; + memset(b + len, pad, size - len); while (len > 0) { *b++ ^= pad; --len;