MCPcopy Create free account
hub / github.com/brainboxdotcc/DPP / get_binary

Method get_binary

src/dpp/bignum.cpp:93–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93std::vector<uint64_t> bignumber::get_binary() const {
94 std::size_t size = BN_num_bytes(ssl_bn->bn);
95 auto size_64_bit = static_cast<std::size_t>(ceil(static_cast<double>(size) / sizeof(uint64_t)));
96 std::vector<uint64_t> returned;
97 returned.resize(size_64_bit);
98 BN_bn2binpad(ssl_bn->bn, reinterpret_cast<unsigned char*>(returned.data()), returned.size() * sizeof(uint64_t));
99 std::reverse(returned.begin(), returned.end());
100 for (auto& chunk : returned) {
101 chunk = flip_bytes(chunk);
102 }
103 return returned;
104}
105
106}

Callers 1

mainFunction · 0.45

Calls 6

flip_bytesFunction · 0.85
resizeMethod · 0.80
dataMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 1

mainFunction · 0.36