Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Benjamin Allred
crown-core
Commits
78c228c6
Commit
78c228c6
authored
10 years ago
by
Cory Fields
Browse files
Options
Download
Email Patches
Plain Diff
boost: moveonly: move BIP32Hash to hash.h
parent
900078ae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/hash.cpp
+13
-0
src/hash.cpp
src/hash.h
+1
-0
src/hash.h
src/key.cpp
+0
-12
src/key.cpp
with
14 additions
and
12 deletions
+14
-12
src/hash.cpp
View file @
78c228c6
...
...
@@ -63,3 +63,16 @@ unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector<unsigned char
return
h1
;
}
void
BIP32Hash
(
const
unsigned
char
chainCode
[
32
],
unsigned
int
nChild
,
unsigned
char
header
,
const
unsigned
char
data
[
32
],
unsigned
char
output
[
64
])
{
unsigned
char
num
[
4
];
num
[
0
]
=
(
nChild
>>
24
)
&
0xFF
;
num
[
1
]
=
(
nChild
>>
16
)
&
0xFF
;
num
[
2
]
=
(
nChild
>>
8
)
&
0xFF
;
num
[
3
]
=
(
nChild
>>
0
)
&
0xFF
;
CHMAC_SHA512
(
chainCode
,
32
).
Write
(
&
header
,
1
)
.
Write
(
data
,
32
)
.
Write
(
num
,
4
)
.
Finalize
(
output
);
}
This diff is collapsed.
Click to expand it.
src/hash.h
View file @
78c228c6
...
...
@@ -159,4 +159,5 @@ uint256 SerializeHash(const T& obj, int nType=SER_GETHASH, int nVersion=PROTOCOL
unsigned
int
MurmurHash3
(
unsigned
int
nHashSeed
,
const
std
::
vector
<
unsigned
char
>&
vDataToHash
);
void
BIP32Hash
(
const
unsigned
char
chainCode
[
32
],
unsigned
int
nChild
,
unsigned
char
header
,
const
unsigned
char
data
[
32
],
unsigned
char
output
[
64
]);
#endif // BITCOIN_HASH_H
This diff is collapsed.
Click to expand it.
src/key.cpp
View file @
78c228c6
...
...
@@ -237,18 +237,6 @@ bool CPubKey::Decompress() {
return
true
;
}
void
static
BIP32Hash
(
const
unsigned
char
chainCode
[
32
],
unsigned
int
nChild
,
unsigned
char
header
,
const
unsigned
char
data
[
32
],
unsigned
char
output
[
64
])
{
unsigned
char
num
[
4
];
num
[
0
]
=
(
nChild
>>
24
)
&
0xFF
;
num
[
1
]
=
(
nChild
>>
16
)
&
0xFF
;
num
[
2
]
=
(
nChild
>>
8
)
&
0xFF
;
num
[
3
]
=
(
nChild
>>
0
)
&
0xFF
;
CHMAC_SHA512
(
chainCode
,
32
).
Write
(
&
header
,
1
)
.
Write
(
data
,
32
)
.
Write
(
num
,
4
)
.
Finalize
(
output
);
}
bool
CKey
::
Derive
(
CKey
&
keyChild
,
unsigned
char
ccChild
[
32
],
unsigned
int
nChild
,
const
unsigned
char
cc
[
32
])
const
{
assert
(
IsValid
());
assert
(
IsCompressed
());
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help