CoCalc Public FilesBSGS.sagewsOpen with one click!
Author: Liljana Babinkostova
Views : 82
Compute Environment: Ubuntu 20.04 (Default)
def BSGB(g,b,p): N=p-1 m=floor(sqrt(N))+1 B[1]=g for j in xrange(1,m): B[j]=mod(g^j,p) p2=BSL[m] G[1]=p2 for j in xrange(1,m-1): G[j]= mod(b*(p2^(-j)),p) for i in xrange(1,m-1): for j in xrange(1,m-1): if B[i]==G[j]: L=mod(i+j*m,N) return DL