256-bit unsigned big integer.
More...
Definition at line 35 of file arith_uint256.hpp.
#include <arith_uint256.hpp>
|
const ArithUint256 | operator+ (const ArithUint256 &a, const ArithUint256 &b) |
|
const ArithUint256 | operator- (const ArithUint256 &a, const ArithUint256 &b) |
|
const ArithUint256 | operator* (const ArithUint256 &a, const ArithUint256 &b) |
|
const ArithUint256 | operator/ (const ArithUint256 &a, const ArithUint256 &b) |
|
const ArithUint256 | operator| (const ArithUint256 &a, const ArithUint256 &b) |
|
const ArithUint256 | operator& (const ArithUint256 &a, const ArithUint256 &b) |
|
const ArithUint256 | operator^ (const ArithUint256 &a, const ArithUint256 &b) |
|
const ArithUint256 | operator>> (const ArithUint256 &a, int shift) |
|
const ArithUint256 | operator<< (const ArithUint256 &a, int shift) |
|
const ArithUint256 | operator* (const ArithUint256 &a, uint32_t b) |
|
bool | operator> (const ArithUint256 &a, const ArithUint256 &b) |
|
bool | operator< (const ArithUint256 &a, const ArithUint256 &b) |
|
bool | operator>= (const ArithUint256 &a, const ArithUint256 &b) |
|
bool | operator<= (const ArithUint256 &a, const ArithUint256 &b) |
|
bool | operator== (const ArithUint256 &a, uint64_t b) |
|
◆ ArithUint256() [1/3]
altintegration::ArithUint256::ArithUint256 |
( |
const std::vector< uint8_t > & |
v | ) |
|
|
inline |
◆ ArithUint256() [2/3]
template<size_t N>
altintegration::ArithUint256::ArithUint256 |
( |
const Blob< N > & |
b | ) |
|
|
inline |
Definition at line 43 of file arith_uint256.hpp.
43 {
45 assign(b);
46 }
constexpr const auto SHA256_HASH_SIZE
sha256 hash size
◆ ArithUint256() [3/3]
altintegration::ArithUint256::ArithUint256 |
( |
uint64_t |
b | ) |
|
|
inline |
Definition at line 48 of file arith_uint256.hpp.
48 {
49 data_[0] = (uint8_t)b;
50 data_[1] = (uint8_t)(b >> 8);
51 data_[2] = (uint8_t)(b >> 16);
52 data_[3] = (uint8_t)(b >> 24);
53 data_[4] = (uint8_t)(b >> 32);
54 data_[5] = (uint8_t)(b >> 40);
55 data_[6] = (uint8_t)(b >> 48);
56 data_[7] = (uint8_t)(b >> 56);
58 data_[i] = 0;
59 }
60 }
◆ fromHex()
static ArithUint256 altintegration::ArithUint256::fromHex |
( |
const std::string & |
hex | ) |
|
|
static |
◆ fromLEBytes()
template<size_t N>
static ArithUint256 altintegration::ArithUint256::fromLEBytes |
( |
const Blob< N > & |
b | ) |
|
|
inlinestatic |
◆ operator&=()
Definition at line 101 of file arith_uint256.hpp.
101 {
103 data_[i] &= b.data_[i];
104 }
105 return *this;
106 }
◆ operator++() [1/2]
◆ operator++() [2/2]
const ArithUint256 altintegration::ArithUint256::operator++ |
( |
int |
| ) |
|
|
inline |
Definition at line 182 of file arith_uint256.hpp.
182 {
183
184 const ArithUint256 ret = *this;
185 ++(*this);
186 return ret;
187 }
◆ operator+=() [1/2]
Definition at line 142 of file arith_uint256.hpp.
142 {
143 uint64_t carry = 0;
145 uint64_t n = carry + data_[i] + b.data_[i];
146 data_[i] = n & 0xff;
147 carry = n >> 8;
148 }
149 return *this;
150 }
◆ operator+=() [2/2]
ArithUint256 & altintegration::ArithUint256::operator+= |
( |
uint64_t |
b64 | ) |
|
|
inline |
Definition at line 157 of file arith_uint256.hpp.
157 {
158 ArithUint256 b;
159 b = b64;
160 *this += b;
161 return *this;
162 }
◆ operator-()
const ArithUint256 altintegration::ArithUint256::operator- |
( |
| ) |
const |
|
inline |
Definition at line 70 of file arith_uint256.hpp.
70 {
71 ArithUint256 ret;
73 ret.data_[i] = ~data_[i];
74 }
75 ++ret;
76 return ret;
77 }
◆ operator--() [1/2]
Definition at line 189 of file arith_uint256.hpp.
189 {
190
192 --data_[i] == (std::numeric_limits<uint8_t>::max)();
193 ++i) {
194 }
195 return *this;
196 }
◆ operator--() [2/2]
const ArithUint256 altintegration::ArithUint256::operator-- |
( |
int |
| ) |
|
|
inline |
Definition at line 198 of file arith_uint256.hpp.
198 {
199
200 const ArithUint256 ret = *this;
201 --(*this);
202 return ret;
203 }
◆ operator-=() [1/2]
◆ operator-=() [2/2]
ArithUint256 & altintegration::ArithUint256::operator-= |
( |
uint64_t |
b64 | ) |
|
|
inline |
Definition at line 164 of file arith_uint256.hpp.
164 {
165 ArithUint256 b;
166 b = b64;
167 *this += -b;
168 return *this;
169 }
◆ operator=()
ArithUint256 & altintegration::ArithUint256::operator= |
( |
uint64_t |
b | ) |
|
|
inline |
Definition at line 79 of file arith_uint256.hpp.
79 {
80 data_[0] = (uint8_t)b;
81 data_[1] = (uint8_t)(b >> 8);
82 data_[2] = (uint8_t)(b >> 16);
83 data_[3] = (uint8_t)(b >> 24);
84 data_[4] = (uint8_t)(b >> 32);
85 data_[5] = (uint8_t)(b >> 40);
86 data_[6] = (uint8_t)(b >> 48);
87 data_[7] = (uint8_t)(b >> 56);
89 data_[i] = 0;
90 }
91 return *this;
92 }
◆ operator^=() [1/2]
Definition at line 94 of file arith_uint256.hpp.
94 {
96 data_[i] ^= b.data_[i];
97 }
98 return *this;
99 }
◆ operator^=() [2/2]
ArithUint256 & altintegration::ArithUint256::operator^= |
( |
uint64_t |
b | ) |
|
|
inline |
Definition at line 115 of file arith_uint256.hpp.
115 {
116 data_[0] ^= (uint8_t)b;
117 data_[1] ^= (uint8_t)(b >> 8);
118 data_[2] ^= (uint8_t)(b >> 16);
119 data_[3] ^= (uint8_t)(b >> 24);
120 data_[4] ^= (uint8_t)(b >> 32);
121 data_[5] ^= (uint8_t)(b >> 40);
122 data_[6] ^= (uint8_t)(b >> 48);
123 data_[7] ^= (uint8_t)(b >> 56);
124 return *this;
125 }
◆ operator|=() [1/2]
Definition at line 108 of file arith_uint256.hpp.
108 {
110 data_[i] |= b.data_[i];
111 }
112 return *this;
113 }
◆ operator|=() [2/2]
ArithUint256 & altintegration::ArithUint256::operator|= |
( |
uint64_t |
b | ) |
|
|
inline |
Definition at line 127 of file arith_uint256.hpp.
127 {
128 data_[0] |= (uint8_t)b;
129 data_[1] |= (uint8_t)(b >> 8);
130 data_[2] |= (uint8_t)(b >> 16);
131 data_[3] |= (uint8_t)(b >> 24);
132 data_[4] |= (uint8_t)(b >> 32);
133 data_[5] |= (uint8_t)(b >> 40);
134 data_[6] |= (uint8_t)(b >> 48);
135 data_[7] |= (uint8_t)(b >> 56);
136 return *this;
137 }
◆ operator~()
const ArithUint256 altintegration::ArithUint256::operator~ |
( |
| ) |
const |
|
inline |
Definition at line 62 of file arith_uint256.hpp.
62 {
63 ArithUint256 ret;
65 ret.data_[i] = ~data_[i];
66 }
67 return ret;
68 }
◆ operator&
◆ operator* [1/2]
◆ operator* [2/2]
◆ operator+
◆ operator-
◆ operator/
◆ operator<
◆ operator<<
◆ operator<=
◆ operator==
◆ operator>
◆ operator>=
◆ operator>>
◆ operator^
◆ operator|
The documentation for this class was generated from the following file: