mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-05-09 07:32:54 +08:00
Feat: Elliptic Curve Diffie Hellman Key Exchange, Ciphers: Error handling
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user