Changeset View
Changeset View
Standalone View
Standalone View
src/crypto/hmac_sha512.cpp
// Copyright (c) 2014 The Bitcoin Core developers | // Copyright (c) 2014 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include "crypto/hmac_sha512.h" | #include <crypto/hmac_sha512.h> | ||||
#include <cstring> | #include <cstring> | ||||
CHMAC_SHA512::CHMAC_SHA512(const uint8_t *key, size_t keylen) { | CHMAC_SHA512::CHMAC_SHA512(const uint8_t *key, size_t keylen) { | ||||
uint8_t rkey[128]; | uint8_t rkey[128]; | ||||
if (keylen <= 128) { | if (keylen <= 128) { | ||||
memcpy(rkey, key, keylen); | memcpy(rkey, key, keylen); | ||||
memset(rkey + keylen, 0, 128 - keylen); | memset(rkey + keylen, 0, 128 - keylen); | ||||
Show All 19 Lines |