refactor: Remove unused and fragile string interface from arith_uint256

This commit is contained in:
MarcoFalke
2023-11-21 17:06:22 +01:00
parent d752349029
commit facf629ce8
5 changed files with 28 additions and 52 deletions

View File

@@ -8,14 +8,7 @@
#include <uint256.h>
#include <crypto/common.h>
template <unsigned int BITS>
base_uint<BITS>::base_uint(const std::string& str)
{
static_assert(BITS/32 > 0 && BITS%32 == 0, "Template parameter BITS must be a positive multiple of 32.");
SetHex(str);
}
#include <cassert>
template <unsigned int BITS>
base_uint<BITS>& base_uint<BITS>::operator<<=(unsigned int shift)
@@ -153,22 +146,6 @@ std::string base_uint<BITS>::GetHex() const
return b.GetHex();
}
template <unsigned int BITS>
void base_uint<BITS>::SetHex(const char* psz)
{
base_blob<BITS> b;
b.SetHex(psz);
for (int x = 0; x < this->WIDTH; ++x) {
this->pn[x] = ReadLE32(b.begin() + x*4);
}
}
template <unsigned int BITS>
void base_uint<BITS>::SetHex(const std::string& str)
{
SetHex(str.c_str());
}
template <unsigned int BITS>
std::string base_uint<BITS>::ToString() const
{