API Documentation

namespace Crypto

Typedefs

using Blake2s = HashContext<Blake2sEngine<hashsize>>
using Blake2s256 = Blake2s<32>
using Blake2s128 = Blake2s<16>
using HmacBlake2s = HmacContext<Blake2s<hashsize>>
using HmacBlake2s256 = HmacBlake2s<32>
using HmacBlake2s128 = HmacBlake2s<16>
using Secret = Blob

Identifies data which should be treated with care.

using ByteArray = std::array<uint8_t, size_>

Class template for fixed byte array.

Note

Until C++17 (and GCC > 5.5) inheriting from std::array<> breaks aggregate initialization.

using Md5 = HashContext<Md5Engine>
using HmacMd5 = HmacContext<Md5>
using Sha1 = HashContext<Sha1Engine>
using HmacSha1 = HmacContext<Sha1>
using Sha224 = HashContext<Sha224Engine>
using Sha256 = HashContext<Sha256Engine>
using Sha384 = HashContext<Sha384Engine>
using Sha512 = HashContext<Sha512Engine>
using HmacSha224 = HmacContext<Sha224>
using HmacSha256 = HmacContext<Sha256>
using HmacSha384 = HmacContext<Sha384>
using HmacSha512 = HmacContext<Sha512>

Functions

template<size_t size_>
String toString(const ByteArray<size_> &array, char separator = '\0')
CRYPTO_HASH_ENGINE_STD(Md5, md5, MD5_SIZE, MD5_STATESIZE, MD5_BLOCKSIZE)
CRYPTO_HASH_ENGINE_STD(Sha1, sha1, SHA1_SIZE, SHA1_STATESIZE, SHA1_BLOCKSIZE)
CRYPTO_HASH_ENGINE_STD(Sha224, sha224, SHA224_SIZE, SHA224_STATESIZE, SHA224_BLOCKSIZE)
CRYPTO_HASH_ENGINE_STD(Sha256, sha256, SHA256_SIZE, SHA256_STATESIZE, SHA256_BLOCKSIZE)
CRYPTO_HASH_ENGINE_STD(Sha384, sha384, SHA384_SIZE, SHA384_STATESIZE, SHA384_BLOCKSIZE)
CRYPTO_HASH_ENGINE_STD(Sha512, sha512, SHA512_SIZE, SHA512_STATESIZE, SHA512_BLOCKSIZE)
class Blob
#include <Blob.h>

Wraps a pointer to some data with size.

template<class Engine_>
class HashContext
#include <HashContext.h>

Class template for a Hash implementation ‘Context’.

tparam Engine

The HashEngine implementation

Subclassed by OtaUpgrade::ChecksumVerifier

template<class HashContext>
class HmacContext
#include <HmacContext.h>

HMAC class template.

Implements the HMAC algorithm using any defined hash context