Remove unused big uint utilities from plugin sdk
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "shared_context.h"
|
||||
#include "stark_utils.h"
|
||||
#include "uint256.h"
|
||||
#include "common_utils.h"
|
||||
|
||||
extraInfo_t *getKnownToken(uint8_t *contractAddress);
|
||||
|
||||
@@ -290,3 +290,21 @@ bool tostring128_signed(const uint128_t *const number,
|
||||
}
|
||||
return tostring128(number, base, out, out_length); // positive value
|
||||
}
|
||||
|
||||
void convertUint64BEto128(const uint8_t *const data, uint32_t length, uint128_t *const target) {
|
||||
uint8_t tmp[INT128_LENGTH];
|
||||
int64_t value;
|
||||
|
||||
value = u64_from_BE(data, length);
|
||||
memset(tmp, ((value < 0) ? 0xff : 0), sizeof(tmp) - length);
|
||||
memmove(tmp + sizeof(tmp) - length, data, length);
|
||||
readu128BE(tmp, target);
|
||||
}
|
||||
|
||||
void convertUint128BE(const uint8_t *const data, uint32_t length, uint128_t *const target) {
|
||||
uint8_t tmp[INT128_LENGTH];
|
||||
|
||||
memset(tmp, 0, sizeof(tmp) - length);
|
||||
memmove(tmp + sizeof(tmp) - length, data, length);
|
||||
readu128BE(tmp, target);
|
||||
}
|
||||
|
||||
@@ -56,5 +56,7 @@ bool tostring128_signed(const uint128_t *const number,
|
||||
uint32_t base,
|
||||
char *const out,
|
||||
uint32_t out_length);
|
||||
void convertUint64BEto128(const uint8_t *const data, uint32_t length, uint128_t *const target);
|
||||
void convertUint128BE(const uint8_t *const data, uint32_t length, uint128_t *const target);
|
||||
|
||||
#endif // _UINT128_H_
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <string.h>
|
||||
#include "uint256.h"
|
||||
#include "uint_common.h"
|
||||
#include "ethUstream.h" // INT256_LENGTH
|
||||
#include "common_utils.h" // INT256_LENGTH
|
||||
|
||||
void readu256BE(const uint8_t *const buffer, uint256_t *const target) {
|
||||
readu128BE(buffer, &UPPER_P(target));
|
||||
@@ -289,3 +289,11 @@ bool tostring256_signed(const uint256_t *const number,
|
||||
}
|
||||
return tostring256(number, base, out, out_length); // positive value
|
||||
}
|
||||
|
||||
void convertUint256BE(const uint8_t *const data, uint32_t length, uint256_t *const target) {
|
||||
uint8_t tmp[INT256_LENGTH];
|
||||
|
||||
memset(tmp, 0, sizeof(tmp) - length);
|
||||
memmove(tmp + sizeof(tmp) - length, data, length);
|
||||
readu256BE(tmp, target);
|
||||
}
|
||||
|
||||
@@ -57,5 +57,6 @@ bool tostring256_signed(const uint256_t *const number,
|
||||
uint32_t base,
|
||||
char *const out,
|
||||
uint32_t out_length);
|
||||
void convertUint256BE(const uint8_t *const data, uint32_t length, uint256_t *const target);
|
||||
|
||||
#endif // _UINT256_H_
|
||||
|
||||
Reference in New Issue
Block a user