OtaUpgrade::ChecksumVerifier Class Reference

Checksum verifier used by BasicStream if signature verification is disabled. More...

#include <ChecksumVerifier.h>

Inheritance diagram for OtaUpgrade::ChecksumVerifier:
[legend]
Collaboration diagram for OtaUpgrade::ChecksumVerifier:
[legend]

Public Types

typedef Hash VerificationData
 Checksum type. More...
 
using Engine = Engine_
 
using Hash = ByteArray< Engine::hashsize >
 

Public Member Functions

bool verify (const VerificationData &checksum)
 
template<typename... EngineArgs>
HashContextreset (EngineArgs &&... engineArgs)
 Reset the context for a new calculation. More...
 
template<typename... Ts>
Hash calculate (Ts &&... args)
 Calculate hash on some data. More...
 
Hash getHash ()
 Finalise and return the final hash value. More...
 
State getState ()
 Get intermediate hash state. More...
 
void setState (const State &state)
 Restore intermediate hash state. More...
 
Update hash over a given block of data
HashContextupdate (const Blob &blob)
 
HashContextupdate (const FSTR::ObjectBase &obj)
 
HashContextupdate (const void *data, size_t size)
 
template<size_t size_>
HashContextupdate (const ByteArray< size_ > &array)
 

Detailed Description

Checksum verifier used by BasicStream if signature verification is disabled.

Wrap Crypto::Md5 such that it provides an interface compatible to SignatureVerifier.

Member Typedef Documentation

◆ Engine

template<class Engine_ >
using Crypto::HashContext< Engine_ >::Engine = Engine_
inherited

◆ Hash

template<class Engine_ >
using Crypto::HashContext< Engine_ >::Hash = ByteArray<Engine::hashsize>
inherited

◆ VerificationData

Member Function Documentation

◆ calculate()

template<class Engine_ >
template<typename... Ts>
Hash Crypto::HashContext< Engine_ >::calculate ( Ts &&...  args)
inlineinherited

Calculate hash on some data.

Parameters
argsSee update() methods
Return values
Hash

◆ getHash()

template<class Engine_ >
Hash Crypto::HashContext< Engine_ >::getHash ( )
inlineinherited

Finalise and return the final hash value.

Return values
Hash

◆ getState()

template<class Engine_ >
State Crypto::HashContext< Engine_ >::getState ( )
inlineinherited

Get intermediate hash state.

Parameters
stateOUT: current state
Return values
uint64_tNumber of bytes processed so far
Note
This method is only required for core hashes, used by Bear SSL

◆ reset()

template<class Engine_ >
template<typename... EngineArgs>
HashContext& Crypto::HashContext< Engine_ >::reset ( EngineArgs &&...  engineArgs)
inlineinherited

Reset the context for a new calculation.

◆ setState()

template<class Engine_ >
void Crypto::HashContext< Engine_ >::setState ( const State state)
inlineinherited

Restore intermediate hash state.

Parameter values obtained via previous getState() call

Parameters
state
count
Note
This method is only required for core hashes, used by Bear SSL

◆ update() [1/4]

template<class Engine_ >
HashContext& Crypto::HashContext< Engine_ >::update ( const Blob blob)
inlineinherited

◆ update() [2/4]

template<class Engine_ >
HashContext& Crypto::HashContext< Engine_ >::update ( const FSTR::ObjectBase obj)
inlineinherited

◆ update() [3/4]

template<class Engine_ >
HashContext& Crypto::HashContext< Engine_ >::update ( const void *  data,
size_t  size 
)
inlineinherited

◆ update() [4/4]

template<class Engine_ >
template<size_t size_>
HashContext& Crypto::HashContext< Engine_ >::update ( const ByteArray< size_ > &  array)
inlineinherited

◆ verify()

bool OtaUpgrade::ChecksumVerifier::verify ( const VerificationData checksum)
inline

Verify the given checksum.

Returns
true if checksum matches content, false otherwise.

The documentation for this class was generated from the following file: