Fix y_parity signature for eip1559 and eip2930
@@ -28,6 +28,13 @@ unsigned int io_seproxyhal_touch_tx_ok(const bagl_element_t *e) {
sizeof(signature),
&info);
explicit_bzero(&privateKey, sizeof(privateKey));
+ if (txContext.txType == EIP1559 || txContext.txType == EIP2930) {
+ if (info & CX_ECCINFO_PARITY_ODD) {
+ G_io_apdu_buffer[0] = 1;
+ } else {
+ G_io_apdu_buffer[0] = 0;
+ }
+ } else {
// Parity is present in the sequence tag in the legacy API
if (tmpContent.txContent.vLength == 0) {
// Legacy API
@@ -43,6 +50,7 @@ unsigned int io_seproxyhal_touch_tx_ok(const bagl_element_t *e) {
if (info & CX_ECCINFO_xGTn) {
G_io_apdu_buffer[0] += 2;
}
+ }
format_signature_out(signature);
tx = 65;
G_io_apdu_buffer[tx++] = 0x90;
