mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Merge 0cd1a2eff9 into merged_master (Bitcoin PR bitcoin/bitcoin#23595)
This commit is contained in:
commit
ce93bea48c
8 changed files with 28 additions and 13 deletions
|
|
@ -354,11 +354,11 @@ bool CExtKey::Derive(CExtKey &out, unsigned int _nChild) const {
|
|||
return key.Derive(out.key, out.chaincode, _nChild, chaincode);
|
||||
}
|
||||
|
||||
void CExtKey::SetSeed(Span<const uint8_t> seed)
|
||||
void CExtKey::SetSeed(Span<const std::byte> seed)
|
||||
{
|
||||
static const unsigned char hashkey[] = {'B','i','t','c','o','i','n',' ','s','e','e','d'};
|
||||
std::vector<unsigned char, secure_allocator<unsigned char>> vout(64);
|
||||
CHMAC_SHA512{hashkey, sizeof(hashkey)}.Write(seed.data(), seed.size()).Finalize(vout.data());
|
||||
CHMAC_SHA512{hashkey, sizeof(hashkey)}.Write(UCharCast(seed.data()), seed.size()).Finalize(vout.data());
|
||||
key.Set(vout.data(), vout.data() + 32, true);
|
||||
memcpy(chaincode.begin(), vout.data() + 32, 32);
|
||||
nDepth = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue