PRCYCoin  2.0.0.7rc1
P2P Digital Currency
uint512.h
Go to the documentation of this file.
1 // Copyright (c) 2017-2018 The PIVX developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef PRCY_UINT512_H
6 #define PRCY_UINT512_H
7 
8 #include "arith_uint256.h"
9 #include "blob_uint256.h"
10 
12 class blob_uint512 : public base_blob<512>
13 {
14 public:
17  explicit blob_uint512(const std::vector<unsigned char>& vch) : base_blob<512>(vch) {}
18 
20  {
21  std::vector<unsigned char> vch;
22  const unsigned char* p = this->begin();
23  for (unsigned int i = 0; i < 32; i++) {
24  vch.push_back(*p++);
25  }
26  return blob_uint256(vch);
27  }
28 };
29 
30 
31 /* uint256 from const char *.
32  * This is a separate function because the constructor uint256(const char*) can result
33  * in dangerously catching UINT256_ZERO.
34  */
35 inline blob_uint512 blob_uint512S(const char* str)
36 {
37  blob_uint512 rv;
38  rv.SetHex(str);
39  return rv;
40 }
41 
42 #endif // PRCY_UINT512_H
arith_uint256.h
b
void const uint64_t * b
Definition: field_5x52_asm_impl.h:10
blob_uint256.h
base_blob
Template base class for fixed-sized opaque blobs.
Definition: blob_uint256.h:20
blob_uint512::blob_uint512
blob_uint512(const base_blob< 512 > &b)
Definition: uint512.h:16
blob_uint512::trim256
blob_uint256 trim256() const
Definition: uint512.h:19
blob_uint512S
blob_uint512 blob_uint512S(const char *str)
Definition: uint512.h:35
blob_uint512
512-bit unsigned big integer.
Definition: uint512.h:12
blob_uint512::blob_uint512
blob_uint512()
Definition: uint512.h:15
blob_uint256
256-bit opaque blob.
Definition: blob_uint256.h:115
blob_uint512::blob_uint512
blob_uint512(const std::vector< unsigned char > &vch)
Definition: uint512.h:17
base_blob::SetHex
void SetHex(const char *psz)
Definition: blob_uint256.cpp:30
base_blob< 512 >::begin
unsigned char * begin()
Definition: blob_uint256.h:56