Ask Your Question

ron_talbot's profile - activity

2024-01-17 17:35:56 +0200 received badge  Editor (source)
2024-01-17 17:35:56 +0200 edited answer Small Scale Variants of the AES (SR)

With mq.SR, I like that I can easily see the values after each AES round, including the round keys. Another aspect that

2024-01-17 17:18:46 +0200 answered a question Small Scale Variants of the AES (SR)

With mq.SR, I like that I can easily see the values after each AES round, including the round keys. Another aspect that

2024-01-17 12:11:34 +0200 asked a question Small Scale Variants of the AES (SR)

Small Scale Variants of the AES (SR) For full AES, we have: from sage.crypto import mq sr = mq.SR(10, 4, 4, 8, star=Tru

2023-10-27 22:04:29 +0200 marked best answer Pollard method for discrete logarithms (sage code)

I'm trying to run the following Sage code from Introduction to Cryptography with Open-Source Software:

sage: a,y,n = 7,12,71
sage: R.<X> = Zmod(n)[]; R.<Y> = Zmod(n)[]
sage: def psi(X):
....: x,r,s=X[0],X[1],X[2]
....: if x%3==0:
....:      return [(x^2)%n,(2*r)%(n-1),(2*s)%(n-1)]
....: if x%3==1:
....:      return [(a*x)%n,(r+1)%(n-1),s]
....: if x%3==2:
....:      return [(y*x)%n,r,(s+1)%(n-1)]

sage: for i in range(1,11):
....:         X = psi(X); Y = psi(psi(Y))
....:         print(i,X,Y,X[0]==Y[0])
....:

And I get the following error:

ArithmeticError: reduction modulo 3 not defined.

Any idea? Thank you.

2023-10-02 19:37:07 +0200 asked a question Pollard method for discrete logarithms (sage code)

Pollard method for discrete logarithms (sage code) I'm trying to run the following Sage code from Introduction to Crypto