Merge pull request #6743 from minosgalanakis/bignum/implement_modular_negation

Bignum: Implement fixed width modular negation
This commit is contained in:
Manuel Pégourié-Gonnard 2022-12-13 09:54:38 +01:00 committed by GitHub
commit 48232ed2c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 94 additions and 0 deletions

View file

@ -137,7 +137,18 @@ class BignumModRawConvertFromMont(bignum_common.ModOperationCommon,
result = self.from_montgomery(self.int_a)
return [self.format_result(result)]
class BignumModRawModNegate(bignum_common.ModOperationCommon,
BignumModRawTarget):
""" Test cases for mpi_mod_raw_neg(). """
test_function = "mpi_mod_raw_neg"
test_name = "Modular negation: "
symbol = "-"
input_style = "arch_split"
arity = 1
def result(self) -> List[str]:
result = (self.int_n - self.int_a) % self.int_n
return [self.format_result(result)]
# END MERGE SLOT 7
# BEGIN MERGE SLOT 8