Ask Your Question

Pro's profile - activity

2022-02-02 10:23:23 +0200 received badge  Famous Question (source)
2018-11-16 14:01:27 +0200 received badge  Famous Question (source)
2018-11-16 14:01:27 +0200 received badge  Notable Question (source)
2018-09-02 16:01:34 +0200 received badge  Popular Question (source)
2018-03-26 10:19:39 +0200 received badge  Notable Question (source)
2016-07-29 03:31:43 +0200 received badge  Famous Question (source)
2016-07-29 03:31:43 +0200 received badge  Popular Question (source)
2016-07-29 03:31:43 +0200 received badge  Notable Question (source)
2016-02-15 16:29:17 +0200 received badge  Popular Question (source)
2016-02-15 16:27:49 +0200 received badge  Popular Question (source)
2016-02-04 17:01:43 +0200 commented answer Create polynomial

Thanks. Great

2016-02-01 21:55:06 +0200 asked a question Create polynomial

Hi all. I have a set od indexes of varibles and a need to create polynomial which can be evaluated from them. Example:

set = (2), (4), (5), (7,8)
polynomial = x2 + x4 + x5 + x7*x8

And I want to be able to evaluate it like this:

vector = (1, 0, 1, 0, 1, 0, 1, 0) 
result = polynomial(*vector)
# result = 0 + 0 + 1 + 1 * 0 = 1

Thank you

2015-11-27 19:04:16 +0200 commented answer Fast evaluation of big polynomials

Better exaple added. Can U help me?

2015-11-27 19:02:32 +0200 commented question Fast evaluation of big polynomials

OK. That example is too complicated so I will try to simplified it.

R = BooleanPolynomialRing(256,'x')
polynomials = []
for _ in range(0,256):
  polynomial = R.random_element(degree=8,terms=+infinity)
  polynomials.append(polynomial)
output = 0
for i in range(0,256):
  input = random_vector(GF(2), 256)
  #--------------------This is problematic part------------------------------
  output ^= polynomials[i](*input)
  #-----------------------------------------------------------------------------------

Is there some other way or library?

2015-11-25 22:03:26 +0200 commented answer Fast evaluation of big polynomials

Example added under previous comment

2015-11-25 22:02:59 +0200 commented question Fast evaluation of big polynomials

OK. Here is exmple http://pastebin.com/5i4g5RRV I added some comments. There are couple of functions and main. Interesting part is in function BlackBox()

2015-11-23 00:12:48 +0200 commented answer Fast evaluation of big polynomials

Polynomial that I need have to have far more terms. Try P = R.random_element(degree=8, terms=+infinity)

2015-11-22 23:23:22 +0200 received badge  Editor (source)
2015-11-22 23:15:59 +0200 asked a question Fast evaluation of big polynomials

Hello. I am working on my Master thesis in cryptography where i need evaluate 256 really big boolean polynomials of 256 variables of degree 8. I use this kind of evaluation:

values = [0, 1, 1, 0, ... , 1]

polynomial = x1x45x12x47x125x47x214x255 + ... + x3x25x32x47x122x47x234x250

tmp = polynomial(*values)

The problem is that it lasts too long. Is there some faster way? Thank You

2015-11-12 21:33:42 +0200 commented answer Generate all binary strings of length n

Thank. Works perfectly

2015-11-11 22:48:42 +0200 asked a question Generate all binary strings of length n

I need to generate all binary strings of length 15 and then access individual bits. Is there some function for that? Thank You

2015-11-04 22:18:56 +0200 commented answer Save boolean polynomial ring to file and read it again

It works perfectly. Thank you very much.

2015-11-04 22:17:25 +0200 received badge  Scholar (source)
2015-11-03 23:44:30 +0200 received badge  Student (source)
2015-11-03 22:24:37 +0200 commented answer Save boolean polynomial ring to file and read it again

So I need one file for every polynomial right? Is there a way to save multiple polynomials to one file?

2015-11-03 21:14:56 +0200 asked a question Save boolean polynomial ring to file and read it again

I have BooleanPolynomialRing of 256 variables and I need many thick polynomials. Generate them is very time consuming so I want to save them to file and when needed read again. Is there some good way? Till now I have found out something like this (simplified)

variables=[]
for i in range(1,257):
    variables.append('x'+str(i))
R = BooleanPolynomialRing(names=variables)
R.inject_variables()
fw = open('/home/pro/Desktop/polynomials.txt', 'w')
polynomial = R.random_element(degree=2,terms=+infinity)
fw.write(str(polynomial) + "\n")
fr = open('/home/pro/Desktop/polynomials.txt', 'r')
polynomial = fr.readline()

How can I convert string back to polynomial?

Thanks f.close()