diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-06-04 09:37:38 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-08-28 21:28:04 +0100 |
commit | e816a092928d06cffe65c23f447c7ab378858343 (patch) | |
tree | 502e4ee373706c790fdfc67a8bc22be2b5803b36 | |
parent | ringct: simplify random key generation (diff) | |
download | monero-e816a092928d06cffe65c23f447c7ab378858343.tar.xz |
ringct: fix off by 1 in mixin usage
-rw-r--r-- | src/ringct/rctSigs.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ringct/rctSigs.cpp b/src/ringct/rctSigs.cpp index e78bec586..351b615d9 100644 --- a/src/ringct/rctSigs.cpp +++ b/src/ringct/rctSigs.cpp @@ -439,14 +439,14 @@ namespace rct { //These functions get keys from blockchain //replace these when connecting blockchain //getKeyFromBlockchain grabs a key from the blockchain at "reference_index" to mix with - //populateFromBlockchain creates a keymatrix with "mixin" columns and one of the columns is inPk + //populateFromBlockchain creates a keymatrix with "mixin" + 1 columns and one of the columns is inPk // the return value are the key matrix, and the index where inPk was put (random). tuple<ctkeyM, xmr_amount> populateFromBlockchain(ctkeyV inPk, int mixin) { int rows = inPk.size(); - ctkeyM rv(mixin, inPk); + ctkeyM rv(mixin + 1, inPk); int index = randXmrAmount(mixin); int i = 0, j = 0; - for (i = 0; i < mixin; i++) { + for (i = 0; i <= mixin; i++) { if (i != index) { for (j = 0; j < rows; j++) { getKeyFromBlockchain(rv[i][j], (size_t)randXmrAmount); |