ringct: encode 8 byte amount, saving 24 bytes per output

Found by knaccc
This commit is contained in:
moneromooo-monero
2019-01-06 19:49:52 +00:00
parent 77f8f45459
commit 6ba3a11637
14 changed files with 93 additions and 34 deletions
+4 -4
View File
@@ -1142,13 +1142,13 @@ namespace hw {
return true;
}
bool device_ledger::ecdhEncode(rct::ecdhTuple & unmasked, const rct::key & AKout) {
bool device_ledger::ecdhEncode(rct::ecdhTuple & unmasked, const rct::key & AKout, bool short_amount) {
AUTO_LOCK_CMD();
#ifdef DEBUG_HWDEVICE
const rct::key AKout_x = hw::ledger::decrypt(AKout);
rct::ecdhTuple unmasked_x = unmasked;
this->controle_device->ecdhEncode(unmasked_x, AKout_x);
this->controle_device->ecdhEncode(unmasked_x, AKout_x, short_amount);
#endif
int offset = set_command_header_noopt(INS_BLIND);
@@ -1179,13 +1179,13 @@ namespace hw {
return true;
}
bool device_ledger::ecdhDecode(rct::ecdhTuple & masked, const rct::key & AKout) {
bool device_ledger::ecdhDecode(rct::ecdhTuple & masked, const rct::key & AKout, bool short_amount) {
AUTO_LOCK_CMD();
#ifdef DEBUG_HWDEVICE
const rct::key AKout_x = hw::ledger::decrypt(AKout);
rct::ecdhTuple masked_x = masked;
this->controle_device->ecdhDecode(masked_x, AKout_x);
this->controle_device->ecdhDecode(masked_x, AKout_x, short_amount);
#endif
int offset = set_command_header_noopt(INS_UNBLIND);