Ticket #3440 (closed defect: fixed)

Opened 6 months ago

Last modified 3 months ago

[with patch,positive review] Our PolyBoRi's GB calculation in AES mode is broken

Reported by: malb Assigned to: malb
Priority: major Milestone: sage-3.1.2
Component: commutative algebra Keywords: polybori
Cc: PolyBoRi, burcin

Description

Burcin says this broke when the iterators changed:

sage: sr = mq.SR(2,1,1,4,gf2=True)
sage: F,s = sr.polynomial_system()
sage: R = F.ring()
sage: B = BooleanPolynomialRing(R.ngens(),R.variable_names())
sage: I = Ideal([B(f) for f in F])
sage: type(I)
<class 'sage.rings.polynomial.pbori.BooleanPolynomialIdeal'>
sage: I.groebner_basis(aes=True)
---------------------------------------------------------------------------
<type 'exceptions.TypeError'>             Traceback (most recent call last)
...
/usr/local/sage-3.0/local/lib/python2.5/site-packages/polybori/PyPolyBoRi.py in <lambda>(x)
     21 OrderCode.__dict__ = order_dict
     22
---> 23 Variable = lambda x: get_cring().gen(x)
     24
     25 def Ring(n, order='lp'):

/home/malb/pbori.pyx in sage.rings.polynomial.pbori.BooleanPolynomialRing.gen (sage/rings/polynomial/pbori.cpp:3333)()

<type 'exceptions.TypeError'>: an integer is required

Attachments

trac_3440_gen.patch (1.6 kB) - added by malb on 08/18/2008 05:10:57 AM.
this fixes the first issue

Change History

06/16/2008 11:03:58 PM changed by PolyBoRi

in PolyBoRi? 0.5 will change iterators again ;-). I hope more SAGE-friendly

for variable in m.variables() for term in p.terms()

08/18/2008 05:10:57 AM changed by malb

  • attachment trac_3440_gen.patch added.

this fixes the first issue

08/18/2008 05:13:00 AM changed by malb

The attache patch fixes the issue above, however now:

sage: sr = mq.SR(2,1,1,4,gf2=True)
sage: F,s = sr.polynomial_system()
sage: R = F.ring()
sage: B = BooleanPolynomialRing(R.ngens(),R.variable_names())
sage: I = Ideal([B(f) for f in F])
sage: type(I)
<class 'sage.rings.polynomial.pbori.BooleanPolynomialIdeal'>
sage: I.groebner_basis(aes=True)
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
...
/usr/local/sage-3.0.6/local/lib/python2.5/site-packages/polybori/aes.py in preprocess(I, prot)
     55     global cache
     56     if get_order_code()==OrderCode.lp:
---> 57       import cache as cache_module
     58       cache=cache_module.cache
     59       del cache_module
ImportError: No module named cache

Ideas, thoughts, work-arounds?

08/18/2008 05:19:24 AM changed by PolyBoRi

personally, at the moment, I don't feel, that it is good to expose this option to users. I did that for aes systems initially. But it is not about: Use that option and everything will work well...

Nevertheless: workaround replace 57/58 by

cache={}

which will make it slower. I think, we don't distribute cache.py (which contains some GB of the 8BIT SBOX).

08/18/2008 07:03:14 AM changed by malb

I vote for applying my patch then and closing this ticket. We don't actively expose aes=True to the user, i.e. it is not documented etc. It just happens to work since we pass the parameters thru to PolyBoRi?.

08/18/2008 07:07:41 AM changed by malb

  • summary changed from Our PolyBoRi's GB calculation in AES mode is broken to [with patch,needs review] Our PolyBoRi's GB calculation in AES mode is broken.

08/27/2008 09:08:32 AM changed by burcin

  • summary changed from [with patch,needs review] Our PolyBoRi's GB calculation in AES mode is broken to [with patch,positive review] Our PolyBoRi's GB calculation in AES mode is broken.

Trivial patch, looks good to me.

Sorry for the very late review.

08/27/2008 02:28:24 PM changed by mabshoff

  • status changed from new to closed.
  • resolution set to fixed.

Merged in Sage 3.1.2.alpha2