1818#include <stdint.h>
1919#include <string.h>
2020
21- #include "uint128.h"
22- #include "uint256.h"
2321#include "tokens.h"
2422#include "common_utils.h"
2523
@@ -32,32 +30,6 @@ void array_hexstr(char *strbuf, const void *bin, unsigned int len) {
3230 * strbuf = 0 ; // EOS
3331}
3432
35- void convertUint64BEto128 (const uint8_t * const data , uint32_t length , uint128_t * const target ) {
36- uint8_t tmp [INT128_LENGTH ];
37- int64_t value ;
38-
39- value = u64_from_BE (data , length );
40- memset (tmp , ((value < 0 ) ? 0xff : 0 ), sizeof (tmp ) - length );
41- memmove (tmp + sizeof (tmp ) - length , data , length );
42- readu128BE (tmp , target );
43- }
44-
45- void convertUint128BE (const uint8_t * const data , uint32_t length , uint128_t * const target ) {
46- uint8_t tmp [INT128_LENGTH ];
47-
48- memset (tmp , 0 , sizeof (tmp ) - length );
49- memmove (tmp + sizeof (tmp ) - length , data , length );
50- readu128BE (tmp , target );
51- }
52-
53- void convertUint256BE (const uint8_t * const data , uint32_t length , uint256_t * const target ) {
54- uint8_t tmp [INT256_LENGTH ];
55-
56- memset (tmp , 0 , sizeof (tmp ) - length );
57- memmove (tmp + sizeof (tmp ) - length , data , length );
58- readu256BE (tmp , target );
59- }
60-
6133uint64_t u64_from_BE (const uint8_t * in , uint8_t size ) {
6234 uint8_t i = 0 ;
6335 uint64_t res = 0 ;
0 commit comments