Move rlp utils to dedicated file

This commit is contained in:
Francois Beutin
2024-01-15 18:50:25 +01:00
parent 04d0fde47a
commit 1155bd2df0
5 changed files with 151 additions and 99 deletions

View File

@@ -25,21 +25,6 @@
#define KECCAK256_HASH_BYTESIZE 32
/**
* @brief Decode an RLP encoded field - see
* https://github.com/ethereum/wiki/wiki/RLP
* @param [in] buffer buffer containing the RLP encoded field to decode
* @param [out] fieldLength length of the RLP encoded field
* @param [out] offset offset to the beginning of the RLP encoded field from the
* buffer
* @param [out] list true if the field encodes a list, false if it encodes a
* string
* @return true if the RLP header is consistent
*/
bool rlpDecodeLength(uint8_t *buffer, uint32_t *fieldLength, uint32_t *offset, bool *list);
bool rlpCanDecode(uint8_t *buffer, uint32_t bufferLength, bool *valid);
bool getEthAddressFromKey(cx_ecfp_public_key_t *publicKey, uint8_t *out, cx_sha3_t *sha3Context);
bool getEthAddressStringFromKey(cx_ecfp_public_key_t *publicKey,