Merge pull request #6743 from minosgalanakis/bignum/implement_modular_negation
Bignum: Implement fixed width modular negation
This commit is contained in:
commit
48232ed2c1
4 changed files with 94 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue