![]() |
Kinetis Bootloader Host
2.0.0
Host Tools for Kinetis devices
|
Base class for AESKey<S>. More...
#include <AESKey.h>
Inheritance diagram for AESKeyBase: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) |
| Writes hex encoded data to stream. More... | |
| void | _readFromStream (std::istream &stream, unsigned bytes, uint8_t *buffer) const |
| 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... | |
Base class for AESKey<S>.
This class implements some bigger, non-template methods used in the AESKey<S> templated subclass.
| void AESKeyBase::_readFromStream | ( | std::istream & | stream, |
| unsigned | bytes, | ||
| uint8_t * | buffer | ||
| ) | const |
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 AESKeyBase::_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 AESKeyBase::_writeToStream | ( | std::ostream & | stream, |
| unsigned | bytes, | ||
| const uint8_t * | buffer | ||
| ) | const |
Writes hex encoded data to stream.
Key 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. |
| void AESKeyBase::_writeToStream | ( | std::ostream & | stream, |
| unsigned | bytes, | ||
| const uint8_t * | buffer | ||
| ) |
Writes hex encoded data to stream.
Key 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. |