salut,
mon algorithme ne fonctionne pas correctement avec les grands nombres !
voici mon algorithme
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
int RSA puissance_modulo(int a, int b,int c)
{
    long x=1;
    long y=a;
    while(b > 0)
        {
        if((b % 2) == 1){
            x=(x*y)%c;
        }
        y = (y*y)%c;
        b = b / 2;
    }
    return (int) x%c;
}
En effet lorsque je met puissance_modulo(72,565,283189) ca doit afficher 80488 mais elle affiche 162983.
merci d'avance ^^