Version 18.1

Updates to OEMCrypto API, OPK, ODK, and unit tests.

See the file CHANGELOG.md for details.
This commit is contained in:
Fred Gylys-Colwell
2023-03-08 22:05:11 -08:00
committed by John "Juce" Bruce
parent 5232c51e33
commit 562f64f292
499 changed files with 29039 additions and 15184 deletions

View File

@@ -15,53 +15,46 @@
namespace wvutil {
// ASCII hex to Binary conversion.
CORE_UTIL_EXPORT std::vector<uint8_t> a2b_hex(const std::string& b);
CORE_UTIL_EXPORT std::vector<uint8_t> a2b_hex(const std::string& label,
const std::string& b);
CORE_UTIL_EXPORT std::string a2bs_hex(const std::string& b);
std::vector<uint8_t> a2b_hex(const std::string& b);
std::vector<uint8_t> a2b_hex(const std::string& label,
const std::string& b);
std::string a2bs_hex(const std::string& b);
// Binary to ASCII hex conversion. The default versions limit output to 2k to
// protect us from log spam. The unlimited version has no length limit.
CORE_UTIL_EXPORT std::string b2a_hex(const std::vector<uint8_t>& b);
CORE_UTIL_EXPORT std::string unlimited_b2a_hex(const std::vector<uint8_t>& b);
CORE_UTIL_EXPORT std::string b2a_hex(const std::string& b);
CORE_UTIL_EXPORT std::string unlimited_b2a_hex(const std::string& b);
CORE_UTIL_EXPORT std::string HexEncode(const uint8_t* bytes, size_t size);
CORE_UTIL_EXPORT std::string UnlimitedHexEncode(const uint8_t* bytes,
size_t size);
std::string b2a_hex(const std::vector<uint8_t>& b);
std::string unlimited_b2a_hex(const std::vector<uint8_t>& b);
std::string b2a_hex(const std::string& b);
std::string unlimited_b2a_hex(const std::string& b);
std::string HexEncode(const uint8_t* bytes, size_t size);
std::string UnlimitedHexEncode(const uint8_t* bytes, size_t size);
// Base64 encoding/decoding.
// Converts binary data into the ASCII Base64 character set and vice
// versa using the encoding rules defined in RFC4648 section 4.
CORE_UTIL_EXPORT std::string Base64Encode(
const std::vector<uint8_t>& bin_input);
CORE_UTIL_EXPORT std::string Base64Encode(const std::string& bin_input);
CORE_UTIL_EXPORT std::vector<uint8_t> Base64Decode(
const std::string& bin_input);
std::string Base64Encode(const std::vector<uint8_t>& bin_input);
std::string Base64Encode(const std::string& bin_input);
std::vector<uint8_t> Base64Decode(const std::string& bin_input);
// URL-Safe Base64 encoding/decoding.
// Converts binary data into the URL/Filename safe ASCII Base64
// character set and vice versa using the encoding rules defined in
// RFC4648 section 5.
CORE_UTIL_EXPORT std::string Base64SafeEncode(
const std::vector<uint8_t>& bin_input);
CORE_UTIL_EXPORT std::string Base64SafeEncode(const std::string& bin_input);
CORE_UTIL_EXPORT std::vector<uint8_t> Base64SafeDecode(
const std::string& bin_input);
std::string Base64SafeEncode(const std::vector<uint8_t>& bin_input);
std::string Base64SafeEncode(const std::string& bin_input);
std::vector<uint8_t> Base64SafeDecode(const std::string& bin_input);
// URL-Safe Base64 encoding without padding.
// Similar to Base64SafeEncode(), without any padding character '='
// at the end.
CORE_UTIL_EXPORT std::string Base64SafeEncodeNoPad(
const std::vector<uint8_t>& bin_input);
CORE_UTIL_EXPORT std::string Base64SafeEncodeNoPad(
const std::string& bin_input);
std::string Base64SafeEncodeNoPad(const std::vector<uint8_t>& bin_input);
std::string Base64SafeEncodeNoPad(const std::string& bin_input);
// Host to Network/Network to Host conversion.
CORE_UTIL_EXPORT int64_t htonll64(int64_t x);
CORE_UTIL_EXPORT inline int64_t ntohll64(int64_t x) { return htonll64(x); }
int64_t htonll64(int64_t x);
inline int64_t ntohll64(int64_t x) { return htonll64(x); }
// Encode unsigned integer into a big endian formatted string.
CORE_UTIL_EXPORT std::string EncodeUint32(uint32_t u);
std::string EncodeUint32(uint32_t u);
} // namespace wvutil