modular arithmetic course - challenge 6 - résidus quadratique

This commit is contained in:
boyreau 2026-11-14 14:46:20 +01:00
commit a3db668081
2 changed files with 18 additions and 0 deletions

View file

@ -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