Number theoretic functions
Simple number theoretic functions
scm( m, n ) EulerPhi( n ) gcd( a, b ) Euclid( a, b ) Inv(a, n) modexp( a, b, n )
a,b,m,n |
Integer |
EulerPhi
Eulers totient function = number of divisors of n.
scm, gcd
Smallest common multiple, Greatest common divisor.
Euclid
Computes x, y from a, b such that the equation a*x + b*y = gcd(m,n) is satisfied.
Inv
Modular inverse in a finite ring, NA if not exists.
modexp
Exponentiation a^b mod n using repeated squaring via binary decomposition of exponent.
Christian W. Hoffmann <christian@echoffmann.ch>
modexp: http://mvngu.wordpress.com/2008/08/01/parigp-programming-for-basic-cryptography/
scm(35,133) # 665 gcd(35,133) # 7 Euclid(35,133) # -1 4 7, meaning 4*35 +(-1)*133 = 7 EulerPhi(60) # 16 modexp(3,10,7) # 3^10 mod 7: 4
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.