diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-11-08 14:27:35 +0100 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-04-27 19:53:37 +0200 |
commit | facd1fb911abfc595a3484ee53397eff515d4c40 (patch) | |
tree | cc0ed08bb4e505f6570236ab86ef4ef4e268c3c9 /src/key.cpp | |
parent | fae1006019188700e0c497a63fc1550fe00ca8bb (diff) |
refactor: Use Span of std::byte in CExtKey::SetSeed
Diffstat (limited to 'src/key.cpp')
-rw-r--r-- | src/key.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/key.cpp b/src/key.cpp index d1d521f97d..9b0971a2dd 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -340,11 +340,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; |