Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
Loading...
Searching...
No Matches
uint256_t.hpp File Reference
#include <string>
#include <utility>
#include "uint128_t.hpp"
Include dependency graph for uint256_t.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  std::is_integral< uint256_t >
 
struct  std::is_arithmetic< uint256_t >
 
struct  std::is_unsigned< uint256_t >
 
class  uint256_t
 class for 256-bit unsigned integer More...
 

Macros

#define CIPHERS_UINT256_T_HPP_
 for std::pair library
 

Functions

template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator+ (const T p, const uint256_t &q)
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator- (const T p, const uint256_t &q)
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator* (const T p, const uint256_t &q)
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator/ (const T p, const uint256_t &q)
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator% (const T p, const uint256_t &q)
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator& (const T &p, const uint256_t &q)
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator| (const T p, const uint256_t &q)
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator^ (const T p, const uint256_t &q)
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
bool operator&& (const T p, const uint256_t &q)
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
bool operator|| (const T p, const uint256_t &q)
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
bool operator== (const T p, const uint256_t &q)
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
bool operator!= (const T p, const uint256_t &q)
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
bool operator< (const T p, const uint256_t &q)
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
bool operator<= (const T p, const uint256_t &q)
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
bool operator> (const T p, const uint256_t &q)
 
template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
bool operator>= (const T p, const uint256_t &q)
 

Detailed Description

Implementation of 256-bit unsigned integers.

Note
The implementation can be flagged as not completed. This header is used with enough operations to demonstrate the usage of ECDH (Elliptic Curve Diffie-Hellman) Key exchange.
Author
Ashish Daulatabad

Macro Definition Documentation

◆ CIPHERS_UINT256_T_HPP_

#define CIPHERS_UINT256_T_HPP_

for std::pair library

for std::string for uint128_t integer

Function Documentation

◆ operator!=()

template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
bool operator!= ( const T p,
const uint256_t & q )
inline
1046 {
1047 return uint256_t(p) != q;
1048}
class for 256-bit unsigned integer
Definition uint256_t.hpp:33

◆ operator%()

template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator% ( const T p,
const uint256_t & q )
inline
1001 {
1002 return uint256_t(p) % q;
1003}

◆ operator&()

template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator& ( const T & p,
const uint256_t & q )
inline
1008 {
1009 return uint256_t(p) & q;
1010}

◆ operator&&()

template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
bool operator&& ( const T p,
const uint256_t & q )
inline
1027 {
1028 return uint256_t(p) && q;
1029}

◆ operator*()

template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator* ( const T p,
const uint256_t & q )
inline
989 {
990 return uint256_t(p) * q;
991}

◆ operator+()

template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator+ ( const T p,
const uint256_t & q )
inline
977 {
978 return uint256_t(p) + q;
979}

◆ operator-()

template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator- ( const T p,
const uint256_t & q )
inline
983 {
984 return (uint256_t(p) - q);
985}

◆ operator/()

template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator/ ( const T p,
const uint256_t & q )
inline
995 {
996 return uint256_t(p) / q;
997}

◆ operator<()

template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
bool operator< ( const T p,
const uint256_t & q )
inline
1052 {
1053 return uint256_t(p) < q;
1054}

◆ operator<=()

template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
bool operator<= ( const T p,
const uint256_t & q )
inline
1058 {
1059 return uint256_t(p) <= q;
1060}

◆ operator==()

template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
bool operator== ( const T p,
const uint256_t & q )
inline
1040 {
1041 return uint256_t(p) == q;
1042}

◆ operator>()

template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
bool operator> ( const T p,
const uint256_t & q )
inline
1064 {
1065 return uint256_t(p) > q;
1066}

◆ operator>=()

template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
bool operator>= ( const T p,
const uint256_t & q )
inline
1070 {
1071 return uint256_t(p) >= q;
1072}

◆ operator^()

template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator^ ( const T p,
const uint256_t & q )
inline
1020 {
1021 return uint256_t(p) ^ q;
1022}

◆ operator|()

template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
uint256_t operator| ( const T p,
const uint256_t & q )
inline
1014 {
1015 return uint256_t(p) | q;
1016}

◆ operator||()

template<typename T , typename = typename std::enable_if< std::is_integral<T>::value, T>::type>
bool operator|| ( const T p,
const uint256_t & q )
inline
1033 {
1034 return uint256_t(p) || q;
1035}