![]() |
Kinetis Bootloader Host
2.0.0
Host Tools for Kinetis devices
|
Base class for AESCounter<S>. More...
#include <AESCounter.h>
Inheritance diagram for AESCounterBase:Public Member Functions | |
| void | _readFromStream (std::istream &stream, unsigned bytes, uint8_t *buffer) |
| Reads hex encoded data from stream. More... | |
| void | _writeToStream (std::ostream &stream, unsigned bytes, const uint8_t *buffer) const |
| Writes hex encoded data to stream. More... | |
| void | _readFromStream (std::istream &stream, unsigned bytes, uint8_t *buffer) |
| Reads hex encoded data from stream. | |
| void | _writeToStream (std::ostream &stream, unsigned bytes, const uint8_t *buffer) const |
| Writes hex encoded data to stream. | |
Base class for AESCounter<S>.
This class implements some bigger, non-template methods used in the AESCounter<S> templated subclass.
| void AESCounterBase::_readFromStream | ( | std::istream & | stream, |
| unsigned | bytes, | ||
| uint8_t * | buffer | ||
| ) |
Reads hex encoded data from stream.
The data from the stream is expected to be hex encoded. Each two characters from the stream encode a single result byte. All non-hexadecimal characters are ignored, including newlines. Every two hexadecimal characters form an encoded byte. This is true even if the two characters representing the upper and lower nibbles are separated by whitespace or other characters.
| stream | Input stream to read from. | |
| bytes | Number of encoded bytes to read. This is the number of result bytes, not the count of bytes to read from the stream. | |
| [out] | buffer | Pointer to the buffer where decoded data is written. |
| std::runtime_error | This exception will be thrown if less data than required is available from stream, or if some other error occurs while reading from stream. |
| void AESCounterBase::_writeToStream | ( | std::ostream & | stream, |
| unsigned | bytes, | ||
| const uint8_t * | buffer | ||
| ) | const |
Writes hex encoded data to stream.
Counter data is written to stream as a sequence of hex encoded octets, each two characters long. No spaces or newlines are inserted between the encoded octets or at the end of the sequence.
| std::runtime_error | Thrown if the stream reports an error while writing the key data. |