Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

YukiWorkshop/cpp-sha256-hmac

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cpp-sha256-hmac

C++ library for SHA256 & SHA256-HMAC calculation.

Usage

#include "cpp-sha256-hmac.hpp"

using namespace YukiWorkshop::Crypto;
SHA256 s;
s.update("0123456789");

std::vector<uint8_t> r0 = s.finalize();

for (auto &it : r0) {
    printf("%02x", it);
}
SHA256 s2;
s2 << "abcdefghij";

std::vector<uint8_t> r1;
s2 >> r1;

for (auto &it : r1) {
    printf("%02x", it);
}
uint8_t k[] = "some secret key, don't use human readable password";
SHA256_HMAC sh(k, sizeof(k));
s.update("0123456789");
std::vector<uint8_t> r2 = sh.finalize();

for (auto &it : r2) {
    printf("%02x", it);
}

License

MIT

Acknowledgements

This library makes use of jb55/sha256.c and aperezdc/hmac-sha256.

Releases

No releases published

Packages

 
 
 

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.