diff options
author | luigi1111 <luigi1111w@gmail.com> | 2020-05-05 23:39:32 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2020-05-05 23:39:32 -0500 |
commit | b4023dcfc5e361be7af6254992699c7cfb090a78 (patch) | |
tree | b41b6e8e3f8b5d14526f10c7edccb6579a4a6737 /src/ringct | |
parent | Merge pull request #6409 (diff) | |
parent | use memwipe on secret k/alpha values (diff) | |
download | monero-b4023dcfc5e361be7af6254992699c7cfb090a78.tar.xz |
Merge pull request #6441
613071f use memwipe on secret k/alpha values (moneromooo-monero)
Diffstat (limited to 'src/ringct')
-rw-r--r-- | src/ringct/rctSigs.cpp | 5 | ||||
-rw-r--r-- | src/ringct/rctTypes.h | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/ringct/rctSigs.cpp b/src/ringct/rctSigs.cpp index a7b265d63..2e3e7007e 100644 --- a/src/ringct/rctSigs.cpp +++ b/src/ringct/rctSigs.cpp @@ -29,6 +29,7 @@ // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "misc_log_ex.h" +#include "misc_language.h" #include "common/perf_timer.h" #include "common/threadpool.h" #include "common/util.h" @@ -108,6 +109,7 @@ namespace rct { //Borromean (c.f. gmax/andytoshi's paper) boroSig genBorromean(const key64 x, const key64 P1, const key64 P2, const bits indices) { key64 L[2], alpha; + auto wiper = epee::misc_utils::create_scope_leave_handler([&](){memwipe(alpha, sizeof(alpha));}); key c; int naught = 0, prime = 0, ii = 0, jj=0; boroSig bb; @@ -190,6 +192,7 @@ namespace rct { vector<geDsmp> Ip(dsRows); rv.II = keyV(dsRows); keyV alpha(rows); + auto wiper = epee::misc_utils::create_scope_leave_handler([&](){memwipe(alpha.data(), alpha.size() * sizeof(alpha[0]));}); keyV aG(rows); rv.ss = keyM(cols, aG); keyV aHP(dsRows); @@ -548,7 +551,7 @@ namespace rct { subKeys(M[i][1], pubs[i].mask, Cout); } mgSig result = MLSAG_Gen(message, M, sk, kLRki, mscout, index, rows, hwdev); - memwipe(&sk[0], sizeof(key)); + memwipe(sk.data(), sk.size() * sizeof(key)); return result; } diff --git a/src/ringct/rctTypes.h b/src/ringct/rctTypes.h index bf4b7b4aa..9b7f26a02 100644 --- a/src/ringct/rctTypes.h +++ b/src/ringct/rctTypes.h @@ -48,6 +48,7 @@ extern "C" { #include "hex.h" #include "span.h" +#include "memwipe.h" #include "serialization/vector.h" #include "serialization/debug_archive.h" #include "serialization/binary_archive.h" @@ -106,6 +107,8 @@ namespace rct { key L; key R; key ki; + + ~multisig_kLRki() { memwipe(&k, sizeof(k)); } }; struct multisig_out { |