Commit Graph
199 Commits
Author SHA1 Message Date
Alexandre Paillier f0d6a2bba1 Now filters out all fields but the name in the EIP712Domain in the half-blind mode 2022-08-05 17:52:48 +02:00
Alexandre Paillier 239da44d0e Added a new temporary EIP-712 half-bind mode 2022-08-05 17:52:48 +02:00
Alexandre Paillier a0551e8226 Added a function to check if we are in the domain or the message struct 2022-08-05 17:52:48 +02:00
Alexandre Paillier 2fa6379470 Now only compiles full EIP-712 support for capable devices 2022-08-05 17:52:47 +02:00
Alexandre Paillier b9820774ba Replaced the debug printf in the EIP712 signature function by two more relevant ones 2022-08-05 17:52:47 +02:00
Alexandre Paillier 59dd149534 Added some NULL checks for global structure pointers 2022-08-05 17:52:46 +02:00
Alexandre Paillier c0eaf8d106 Proper cleanup after EIP712 message 2022-08-05 17:52:46 +02:00
Alexandre Paillier 0525f7cda8 Fixes bad multi-screen value behaviour 2022-08-05 17:52:46 +02:00
Alexandre Paillier 2badb7b5b2 Now displays the field values
Show ints as uints for now
2022-08-05 17:52:45 +02:00
Alexandre Paillier 9cd39e2c02 Now uses some of the old EIP712 code as common code between the two implementations + approve/reject button now works 2022-08-05 17:52:45 +02:00
Alexandre Paillier 9f29a7caa2 UI handling WIP 2022-08-05 17:52:44 +02:00
Alexandre Paillier b8424d1a21 Now handles domain & message struct not based on order but on struct name 2022-08-05 17:52:44 +02:00
Alexandre Paillier 5c00a5c27b Structs alignment in memory, fixes device freezes/crashes 2022-08-05 17:52:44 +02:00
Alexandre Paillier d43849d852 Sets the memory buffer to 5K 2022-08-05 17:52:43 +02:00
Alexandre Paillier 90dfa74538 Emulates old behaviour with new APDUs but computed all on-device 2022-08-05 17:52:43 +02:00
Alexandre Paillier 516682b206 Fix impl APDU wrongly returning 0x6a80 2022-08-05 17:52:42 +02:00
Alexandre Paillier b6e4f887cb Fixes printf formatting issues caused by the toolchain 2022-08-05 17:52:42 +02:00
Alexandre Paillier 4442ba5716 Now responds to EIP712 APDUs 2022-08-05 17:52:41 +02:00
Alexandre Paillier faae5a909c Fix PIC crashes 2022-08-05 17:52:41 +02:00
Alexandre Paillier 9f8b2da74c WIP integration in app 2022-08-05 17:52:41 +02:00
Alexandre Paillier e070c379da Removed old code main function & apdu handling function 2022-08-05 17:52:40 +02:00
Alexandre Paillier d333b3a433 Fixed compilation errors/warnings 2022-08-05 17:52:40 +02:00
Alexandre Paillier c689b68f76 Remove some now useless debug outputs 2022-08-05 17:52:39 +02:00
Alexandre Paillier ad030cdb6a Make the dependencies mandatory in the typehash function 2022-08-05 17:52:39 +02:00
Alexandre Paillier 6c14bfa476 Now wraps the printf calls in a macro. SDK-like 2022-08-05 17:52:39 +02:00
Alexandre Paillier 09697f718a Fix dynamic bytes type encoding 2022-08-05 17:52:38 +02:00
Alexandre Paillier 6d86a5de77 Global hash making 2022-08-05 17:52:38 +02:00
Alexandre Paillier a2a72edf83 Now initializes field hash struct in eip712 context 2022-08-05 17:52:37 +02:00
Alexandre Paillier 83dda443f4 Refactor type hash function to use less RAM 2022-08-05 17:52:37 +02:00
Alexandre Paillier 854791324a Doubled the available RAM size 2022-08-05 17:52:37 +02:00
Alexandre Paillier 01ba4fb41f Small refactoring to the format uint memory utils function 2022-08-05 17:52:36 +02:00
Alexandre Paillier 149e20cd11 Typehash refactoring 2022-08-05 17:52:36 +02:00
Alexandre Paillier a3f5eee116 WIP field hashing support 2022-08-05 17:52:35 +02:00
Alexandre Paillier 0e9cd91ecc Removed structure packing, prevents unaligned access 2022-08-05 17:52:35 +02:00
Alexandre Paillier 477046bd43 Removed unused byte type 2022-08-05 17:52:35 +02:00
Alexandre Paillier 45dfd5d6a6 Proper path implementation with array support 2022-08-05 17:52:34 +02:00
Alexandre Paillier 0e386a4204 Now initializes a path in memory 2022-08-05 17:52:34 +02:00
Alexandre Paillier 7e35b96ec0 WIP field hashing 2022-08-05 17:52:33 +02:00
Alexandre Paillier fd31def094 Update app context wrapping 2022-08-05 17:52:33 +02:00
Alexandre Paillier 9521b36de3 Now prefixes the type hash with a marker 2022-08-05 17:52:33 +02:00
Alexandre Paillier 223aa10a58 Better macro naming for hash length 2022-08-05 17:52:32 +02:00
Alexandre Paillier c53a4299a3 TypeHash function now uses the device's hashing functions 2022-08-05 17:52:32 +02:00
Alexandre Paillier 3d9089b395 New functions that emulate the device's hashing functions 2022-08-05 17:52:31 +02:00
Alexandre Paillier 1375571957 Unify mem utils function names 2022-08-05 17:52:31 +02:00
Alexandre Paillier 9ca9caf410 encodeType reformatting / code cleanup 2022-08-05 17:52:31 +02:00
Alexandre Paillier c30b3aceec Added memory allocation utility functions 2022-08-05 17:52:30 +02:00
Alexandre Paillier 547846f56d Small code cleaning in the init of solidity typenames 2022-08-05 17:52:30 +02:00
Alexandre Paillier 2584490afa Added array size macro 2022-08-05 17:52:29 +02:00
Alexandre Paillier 54fe26a301 Extracted the context initialization from the main source file 2022-08-05 17:52:29 +02:00
Alexandre Paillier b2fe2f26ba Implements the hashing part of typeHash 2022-08-05 17:52:29 +02:00