I'm trying to implement a basic procedure to generate an RSA key. The procedure accepts a range of numbers a and b. It has to check that the intervall between a and b is "five digits".
So I came up with a solution:
with (numtheory);
gen_rsa := proc(a, b)
local p, q, len_p, len_q, larger;
# the two prime-numbers
p:=safeprime(round(RandomTools[Generate](integer(range=a .. b))-1/2));
q:=safeprime(round(RandomTools[Generate](integer(rande=a .. b))-1/2));
if( evalb(log10(p) > log10(q)+5 )
[...]
Thing is: Maple seems to understand p and q as variables of the type function. I want to use the log10 to find out how many digits the prime-number has in order to calculate a safe RSA key. So evalb
fails, because it cannot determine the two logarithms??