8 // Wrapper of uint256 with guarantee that first
15 ADD_SERIALIZE_METHODS;
17 template <typename Stream, typename Operation>
18 inline void SerializationOp(Stream& s, Operation ser_action) {
21 if ((*contents.begin()) & 0xF0) {
22 throw std::ios_base::failure("spending key has invalid leading bits");
26 const unsigned char* begin() const
28 return contents.begin();
31 const unsigned char* end() const
33 return contents.end();
36 uint252() : contents() {};
37 explicit uint252(const uint256& in) : contents(in) {
38 if (*contents.begin() & 0xF0) {
39 throw std::domain_error("leading bits are set in argument given to uint252 constructor");
43 uint256 inner() const {
47 friend inline bool operator==(const uint252& a, const uint252& b) { return a.contents == b.contents; }