ringct: encode 8 byte amount, saving 24 bytes per output
Found by knaccc
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user