Suppose
p is an odd prime,
ord(a) = p-1
GCD(x, p) = 1
N is an integer >= 2
Then
y = logmod(x, a, p, N)
Returns y such that a^y = x (mod p^N)
Example
Let x= vpi(154), a = vpi(7), p = vpi(17), N = vpi(37)
y = logmod(x, a, p, N)
returns
y = 2088349219044680767324467844670001776975183904
Citation pour cette source
Steven Gregory (2024). logmod (https://www.mathworks.com/matlabcentral/fileexchange/23803-logmod), MATLAB Central File Exchange. Récupéré le .
Compatibilité avec les versions de MATLAB
Plateformes compatibles
Windows macOS LinuxCatégories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
Version | Publié le | Notes de version | |
---|---|---|---|
1.4.0.0 | Brought the description up to date. This routine no longer needs the m-file modinv.m. |
||
1.3.0.0 | Modified to correct logic errors and to exploit the latest version of the vpi software. A Microsoft word file has been included that describes and proves the algorithm used. |
||
1.2.0.0 | Rewrote the description. |
||
1.0.0.0 |