modular arithmetic course - challenge 6 - résidus quadratique
This commit is contained in:
parent
3099b363fa
commit
9c960bf2f1
2 changed files with 18 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ from intro import (
|
|||
from modular_arithmetic import (
|
||||
gcd,
|
||||
extended_gcd,
|
||||
quadratic_residue,
|
||||
)
|
||||
from public_key_cryptography import (
|
||||
modular_exponentiation,
|
||||
|
|
@ -22,6 +23,7 @@ from public_key_cryptography import (
|
|||
prime_factorization,
|
||||
reverse_single_prime_RSA_cipher,
|
||||
)
|
||||
import functools
|
||||
|
||||
if __name__ == "__main__":
|
||||
# fmt: off
|
||||
|
|
@ -58,4 +60,5 @@ if __name__ == "__main__":
|
|||
print(gcd(66528, 52920))
|
||||
print(extended_gcd(26513, 32321))
|
||||
print(f"11 % 6 = {11 % 6}; 8146798528947 % 17 = {8146798528947 % 17}")
|
||||
print(min([(quadratic_residue(29, x) or 30) for x in [14, 6, 11]])) # Bancal mais on est mod29 donc 30 est forcément pas le min.
|
||||
# fmt: on
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue