MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / SetKey

Method SetKey

src/crypto/chacha20.cpp:24–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22#define REPEAT10(a) do { {a}; {a}; {a}; {a}; {a}; {a}; {a}; {a}; {a}; {a}; } while(0)
23
24void ChaCha20Aligned::SetKey(std::span<const std::byte> key) noexcept
25{
26 assert(key.size() == KEYLEN);
27 input[0] = ReadLE32(key.data() + 0);
28 input[1] = ReadLE32(key.data() + 4);
29 input[2] = ReadLE32(key.data() + 8);
30 input[3] = ReadLE32(key.data() + 12);
31 input[4] = ReadLE32(key.data() + 16);
32 input[5] = ReadLE32(key.data() + 20);
33 input[6] = ReadLE32(key.data() + 24);
34 input[7] = ReadLE32(key.data() + 28);
35 input[8] = 0;
36 input[9] = 0;
37 input[10] = 0;
38 input[11] = 0;
39}
40
41ChaCha20Aligned::~ChaCha20Aligned()
42{

Callers 1

CryptMethod · 0.45

Calls 4

ReadLE32Function · 0.85
memory_cleanseFunction · 0.85
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected