Feat: Elliptic Curve Diffie Hellman Key Exchange, Ciphers: Error handling

This commit is contained in:
Ashish Bhanu Daulatabad 2021-04-10 21:58:53 +05:30
parent 3cfa917e5e
commit 82cfa17a58
2 changed files with 4 additions and 4 deletions

View File

@ -439,9 +439,9 @@ class uint128_t {
*/
std::pair<uint128_t, uint128_t> divide(const uint128_t &p) {
if (*this < p) { // if this is less than divisor
return {uint128_t(0ULL), *this};
return {uint128_t(0), *this};
} else if (*this == p) { // if this is equal to divisor
return {uint128_t(1ULL), uint128_t(0ULL)};
return {uint128_t(1), uint128_t(0)};
}
uint128_t tmp = p, tmp2 = *this;
uint16_t left = tmp._lez() - _lez();

View File

@ -433,9 +433,9 @@ class uint256_t {
*/
std::pair<uint256_t, uint256_t> divide(const uint256_t &p) {
if (*this < p) { // if this is less than divisor
return {uint256_t(0ULL), *this};
return {uint256_t(0), *this};
} else if (*this == p) { // if this is equal to divisor
return {uint256_t(1ULL), uint256_t(0ULL)};
return {uint256_t(1), uint256_t(0)};
}
uint256_t tmp = p, tmp2 = *this;
uint16_t left = tmp._lez() - _lez();