mirror of
https://github.com/eosswedenorg/antelope-keygen
synced 2026-06-17 03:50:03 +02:00
crypto/hash: define sha256d()
Better to have it here. Gives the implementation a chance to do any optimization over calling sha256() two times.
This commit is contained in:
parent
84f01dd707
commit
ce5dda06fe
2 changed files with 8 additions and 0 deletions
|
|
@ -31,6 +31,9 @@ namespace eoskeygen {
|
|||
|
||||
sha256_t* sha256(const unsigned char *data, std::size_t len, sha256_t* out);
|
||||
|
||||
// sha256 double.
|
||||
sha256_t* sha256d(const unsigned char *data, std::size_t len, sha256_t* out);
|
||||
|
||||
ripemd160_t* ripemd160(const unsigned char *data, std::size_t len, ripemd160_t* out);
|
||||
|
||||
} // namespace eoskeygen
|
||||
|
|
|
|||
|
|
@ -31,6 +31,11 @@ sha256_t* sha256(const unsigned char *data, std::size_t len, sha256_t* out) {
|
|||
return (sha256_t *) SHA256(data, len, out->data);
|
||||
}
|
||||
|
||||
sha256_t* sha256d(const unsigned char *data, std::size_t len, sha256_t* out) {
|
||||
SHA256(data, len, out->data);
|
||||
return (sha256_t *) SHA256(data, 32, out->data);
|
||||
}
|
||||
|
||||
ripemd160_t* ripemd160(const unsigned char *data, std::size_t len, ripemd160_t* out) {
|
||||
return (ripemd160_t *) RIPEMD160(data, len, out->data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue