diff options
author | Thomas Winget <tewinget@gmail.com> | 2014-06-04 18:59:47 -0400 |
---|---|---|
committer | Thomas Winget <tewinget@gmail.com> | 2014-06-12 19:05:51 -0400 |
commit | 4f382b383005d09f6056371d0fecdc8b6ce37a08 (patch) | |
tree | af6a07f7b59bb432891ec0bf47772e3517a17c1d /src/crypto/crypto.cpp | |
parent | added vim swap files to .gitignore (diff) | |
download | monero-4f382b383005d09f6056371d0fecdc8b6ce37a08.tar.xz |
most functions prototyped/modified for wallet recovery
Diffstat (limited to 'src/crypto/crypto.cpp')
-rw-r--r-- | src/crypto/crypto.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/crypto/crypto.cpp b/src/crypto/crypto.cpp index f5f525700..31fc31d5b 100644 --- a/src/crypto/crypto.cpp +++ b/src/crypto/crypto.cpp @@ -50,6 +50,7 @@ namespace crypto { return &reinterpret_cast<const unsigned char &>(scalar); } + /* generate a random 32-byte (256-bit) integer and copy it to res */ static inline void random_scalar(ec_scalar &res) { unsigned char tmp[64]; generate_random_bytes(64, tmp); @@ -62,6 +63,11 @@ namespace crypto { sc_reduce32(&res); } + /* + * generate public and secret keys from a random 256-bit integer + * TODO: allow specifiying random value (for wallet recovery) + * + */ void crypto_ops::generate_keys(public_key &pub, secret_key &sec) { lock_guard<mutex> lock(random_lock); ge_p3 point; |