From 5d1e989581f77aee3464ff2c0ad01c0c7e1bb55f Mon Sep 17 00:00:00 2001 From: Michele Balistreri Date: Fri, 11 Aug 2023 15:18:14 +0200 Subject: [PATCH] actually encode integers --- app/ethereum/eip712.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/ethereum/eip712.c b/app/ethereum/eip712.c index 06313e7..cb31853 100644 --- a/app/ethereum/eip712.c +++ b/app/ethereum/eip712.c @@ -422,6 +422,10 @@ static app_err_t eip712_encode_field(uint8_t out[32], uint8_t* heap, size_t heap } memset(out, res < 0 ? 0xff : 0x00, 24); + for (int i = 31; i >= 24; i--) { + out[i] = res & 0xff; + res >>= 8; + } } }