Changeset View
Changeset View
Standalone View
Standalone View
src/crypto/hmac_sha256.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_sha256.h" | #include <crypto/hmac_sha256.h> | ||||
#include <cstring> | #include <cstring> | ||||
CHMAC_SHA256::CHMAC_SHA256(const uint8_t *key, size_t keylen) { | CHMAC_SHA256::CHMAC_SHA256(const uint8_t *key, size_t keylen) { | ||||
uint8_t rkey[64]; | uint8_t rkey[64]; | ||||
if (keylen <= 64) { | if (keylen <= 64) { | ||||
memcpy(rkey, key, keylen); | memcpy(rkey, key, keylen); | ||||
memset(rkey + keylen, 0, 64 - keylen); | memset(rkey + keylen, 0, 64 - keylen); | ||||
Show All 19 Lines |