From 265a865ed80f233b252464a2ff05780a92751c75 Mon Sep 17 00:00:00 2001 From: Ashish Bhanu Daulatabad Date: Tue, 13 Apr 2021 13:11:29 +0530 Subject: [PATCH] Comments --- ciphers/elliptic_curve_key_exchange.cpp | 4 ++-- ciphers/uint128_t.hpp | 2 +- ciphers/uint256_t.hpp | 9 +++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ciphers/elliptic_curve_key_exchange.cpp b/ciphers/elliptic_curve_key_exchange.cpp index 58b89e5a4..f3b6ab3a2 100644 --- a/ciphers/elliptic_curve_key_exchange.cpp +++ b/ciphers/elliptic_curve_key_exchange.cpp @@ -22,9 +22,9 @@ * @author [Ashish Daulatabad](https://github.com/AshishYUO) */ #include /// for assert -#include /// for IO operation +#include /// for IO operations -#include "uint256_t.hpp" /// for 256-bit integer; +#include "uint256_t.hpp" /// for 256-bit integer /** * @namespace ciphers diff --git a/ciphers/uint128_t.hpp b/ciphers/uint128_t.hpp index 3592eca92..e6a0240bb 100644 --- a/ciphers/uint128_t.hpp +++ b/ciphers/uint128_t.hpp @@ -32,7 +32,7 @@ struct std::is_unsigned : std::true_type {}; * @details Adds two long integer, only used for printing numbers * @param first First integer string * @param second Second integer string - * @returns string denoting the addition of both the strings. + * @returns string denoting the addition of both the strings */ std::string add(const std::string &first, const std::string &second) { std::string third; diff --git a/ciphers/uint256_t.hpp b/ciphers/uint256_t.hpp index 8ab98867d..82b18ae87 100644 --- a/ciphers/uint256_t.hpp +++ b/ciphers/uint256_t.hpp @@ -28,10 +28,10 @@ struct std::is_unsigned : std::true_type {}; /** * @class uint256_t - * @brief class for 256-bit unsigned integer. + * @brief class for 256-bit unsigned integer */ class uint256_t { - uint128_t f{}, s{}; /// First and second half of 256 bit number. + uint128_t f{}, s{}; /// First and second half of 256 bit number /** * @brief Get integer from given string. @@ -65,6 +65,11 @@ class uint256_t { // Constructors uint256_t() = default; + /** + * @brief Parameterized constructor + * @tparam T template for integer types + * @param low Integer denoting lower 128-bits + */ template ::value, T>::type> explicit uint256_t(T low) : s(low), f(0) {}