Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

list of random non-zero elements

I was wondering if there was a short way to generate lists of random non-zero elements of GF(q) ? What I have so far is:

 L=[];  
  for i in range(10):  
     a=GF(25).random_element();  
     while a==0:  
         a=GF(25).random_element();  
     L.append(a);

list of random non-zero elements

I was wondering if there was a short way to generate lists of random non-zero elements of GF(q) ? What I have so far is:

  L=[];  
  for i in range(10):  
     a=GF(25).random_element();  
     while a==0:  
         a=GF(25).random_element();  
     L.append(a);