Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wax
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
wax
Commits
5e9a7459
Commit
5e9a7459
authored
1 month ago
by
Bartek Wrona
Browse files
Options
Downloads
Patches
Plain Diff
Wax C++ core extended by ability to convert raw private key into WIF format
parent
d3a2a945
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/foundation.cpp
+10
-0
10 additions, 0 deletions
core/foundation.cpp
core/foundation.hpp
+4
-1
4 additions, 1 deletion
core/foundation.hpp
with
14 additions
and
1 deletion
core/foundation.cpp
+
10
−
0
View file @
5e9a7459
...
...
@@ -269,6 +269,16 @@ private_key_data foundation::cpp_generate_private_key(const std::string& account
);
}
std
::
string
foundation
::
cpp_convert_raw_private_key_to_wif
(
const
std
::
string
&
hexData
)
{
FC_ASSERT
(
hexData
.
size
()
==
64
&&
"Expected hex string pointing 32 byte buffer"
);
fc
::
sha256
sharedSecret
(
hexData
);
return
fc
::
ecc
::
private_key
::
regenerate
(
sharedSecret
).
key_to_wif
();
}
brain_key_data
foundation
::
cpp_suggest_brain_key
()
{
return
cpp
::
safe_exception_wrapper
(
...
...
This diff is collapsed.
Click to expand it.
core/foundation.hpp
+
4
−
1
View file @
5e9a7459
...
...
@@ -15,8 +15,11 @@ public:
result
cpp_calculate_public_key
(
const
std
::
string
&
wif
);
result
cpp_generate_private_key
();
private_key_data
cpp_generate_private_key
(
const
std
::
string
&
account
,
const
std
::
string
&
role
,
const
std
::
string
&
password
);
/** Allows to convert 32 bytes data buffer expressed as hex string (pointing private key secret) into private key encoded as WIF format.
*/
std
::
string
cpp_convert_raw_private_key_to_wif
(
const
std
::
string
&
hexData
);
brain_key_data
cpp_suggest_brain_key
();
/** Returns map of hive::protocol constants in form:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment