MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetBlindingKey

Method GetBlindingKey

src/wallet/wallet.cpp:4062–4085  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4060}
4061
4062CKey CWallet::GetBlindingKey(const CScript* script) const {
4063 CKey key;
4064
4065 if (script != NULL) {
4066 std::map<CScriptID, uint256>::const_iterator it = mapSpecificBlindingKeys.find(CScriptID(*script));
4067 if (it != mapSpecificBlindingKeys.end()) {
4068 key.Set(it->second.begin(), it->second.end(), true);
4069 if (key.IsValid()) {
4070 return key;
4071 }
4072 }
4073 }
4074
4075 if (script != NULL && !blinding_derivation_key.IsNull()) {
4076 unsigned char vch[32];
4077 CHMAC_SHA256(blinding_derivation_key.begin(), blinding_derivation_key.size()).Write(&((*script)[0]), script->size()).Finalize(vch);
4078 key.Set(&vch[0], &vch[32], true);
4079 if (key.IsValid()) {
4080 return key;
4081 }
4082 }
4083
4084 return CKey();
4085}
4086
4087CPubKey CWallet::GetBlindingPubKey(const CScript& script) const
4088{

Callers 4

spend.cppFile · 0.80
dumpblindingkeyFunction · 0.80
dumpissuanceblindingkeyFunction · 0.80
FillBlindsFunction · 0.80

Calls 12

CScriptIDClass · 0.85
CHMAC_SHA256Class · 0.85
findMethod · 0.80
CKeyClass · 0.50
endMethod · 0.45
SetMethod · 0.45
beginMethod · 0.45
IsValidMethod · 0.45
IsNullMethod · 0.45
FinalizeMethod · 0.45
WriteMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected