$SPAD/src/input ffieldbug.input

Paul Onions, Ralf Hemmecke

December 3, 2016

Abstract

Contents

2

— * —

)set break resume
)spool ffieldbug.output
)set message test on
)set message auto off
)clear all
--S 1 of 29
gf2 := PrimeField 2
--R
--R
--R   (1)  PrimeField(2)
--R                                                                 Type: Domain
--E 1
--S 2 of 29
gf16 := FiniteFieldExtensionByPolynomial(gf2,x**4+x+1)
--R
--R
--R   (2)  FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1)
--R                                                                 Type: Domain
--E 2
--S 3 of 29
a:=primitiveElement()$gf16
--R
--R
--R   (3)  %A
--R                Type: FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1)
--E 3
--S 4 of 29
p:POLY gf16:=a*x**3
--R
--R
--R            3
--R   (4)  %A x
--R    Type: Polynomial(FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1))
--E 4
--S 5 of 29
q:POLY gf16:=a*x**2+1
--R
--R
--R            2
--R   (5)  %A x  + 1
--R    Type: Polynomial(FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1))
--E 5

--S 6 of 29
p rem q
--R
--R
--RDaly Bug
--R   >> Error detected within library code:
--R   coerce: element doesn't belong to smaller field
--R
--R   Continuing to read the file...
--R
--E 6
)clear all
--S 7 of 29
gf2 := PrimeField 2
--R
--R
--R   (1)  PrimeField(2)
--R                                                                 Type: Domain
--E 7
--S 8 of 29
gf16:=FiniteFieldExtension(gf2,4)
--R
--R
--R   (2)  FiniteFieldExtension(PrimeField(2),4)
--R                                                                 Type: Domain
--E 8
--S 9 of 29
a:=primitiveElement()$gf16
--R
--R
--R   (3)  %A
--R                                  Type: FiniteFieldExtension(PrimeField(2),4)
--E 9
--S 10 of 29
p:POLY gf16:=a*x**3
--R
--R
--R            3
--R   (4)  %A x
--R                      Type: Polynomial(FiniteFieldExtension(PrimeField(2),4))
--E 10
--S 11 of 29
q:POLY gf16:=a*x**2+1

--R
--R
--R            2
--R   (5)  %A x  + 1
--R                      Type: Polynomial(FiniteFieldExtension(PrimeField(2),4))
--E 11
--S 12 of 29
p rem q
--R
--R
--RDaly Bug
--R   >> Error detected within library code:
--R   coerce: element doesn't belong to smaller field
--R
--R   Continuing to read the file...
--R
--E 12
)clear all
--S 13 of 29
gf2 := PrimeField 2
--R
--R
--R   (1)  PrimeField(2)
--R                                                                 Type: Domain
--E 13
--S 14 of 29
gf16:=FiniteField(2,4)
--R
--R
--R   (2)  FiniteField(2,4)
--R                                                                 Type: Domain
--E 14
--S 15 of 29
a:=primitiveElement()$gf16
--R
--R
--R   (3)  %A
--R                                                       Type: FiniteField(2,4)
--E 15
--S 16 of 29
p:POLY gf16:=a*x**3
--R
--R
--R            3

--R   (4)  %A x
--R                                           Type: Polynomial(FiniteField(2,4))
--E 16
--S 17 of 29
q:POLY gf16:=a*x**2+1
--R
--R
--R            2
--R   (5)  %A x  + 1
--R                                           Type: Polynomial(FiniteField(2,4))
--E 17
--S 18 of 29
p rem q
--R
--R
--R   (6)  x
--R                               Type: UnivariatePolynomial(x,FiniteField(2,4))
--E 18

———-

Ralf Hemmecke comments:

Yes, I'd say that this is abug. But maybe from the following transcript
you can see what is happening.
Why have I used SUP? Well, Polynomial is a domain that can hold
polynomials in any variable. In fact, it's not a univariate polynomial
domain. So if you say p rem q, it has to figure out what you could
have meant. Well, your polynomials are univariate, so (I guess - I
haven't actually looked at the source code) internally p and q will be
coerced to a univariate polynomial (i.e. to type SUP(gf16)). As you see
below, for some reason, I don't yet understand, this goes wrong. ...
I have no idea why coercion with FiniteField(2,4) works, but not with
FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1).

— * —

)clear all
--S 19 of 29
gf2:=PrimeField 2
--R
--R

--R   (1)  PrimeField(2)
--R                                                                 Type: Domain
--E 19
--S 20 of 29
gf16:=FiniteFieldExtensionByPolynomial(gf2,x**4+x+1)
--R
--R
--R   (2)  FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1)
--R                                                                 Type: Domain
--E 20
--S 21 of 29
P:=SUP gf16
--R
--R
--R   (3)
--R  SparseUnivariatePolynomial(FiniteFieldExtensionByPolynomial(PrimeField(2),?^4
--R  +?+1))
--R                                                                 Type: Domain
--E 21
--S 22 of 29
a:gf16:=primitiveElement()
--R
--R
--R   (4)  %A
--R                Type: FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1)
--E 22
--S 23 of 29
p:P:=a*x^3
--R
--R
--RDaly Bug
--R   >> Error detected within library code:
--R   coerce: element doesn't belong to smaller field
--R
--R   Continuing to read the file...
--R
--E 23
--S 24 of 29
m:P:=monomial(1,1)
--R
--R
--R   (5)  ?
--RType: SparseUnivariatePolynomial(FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1))
--E 24

--S 25 of 29
p:P:=a*m^3
--R
--R
--R            3
--R   (6)  %A ?
--RType: SparseUnivariatePolynomial(FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1))
--E 25
--S 26 of 29
q:P:=a*x^2+1
--R
--R
--RDaly Bug
--R   >> Error detected within library code:
--R   coerce: element doesn't belong to smaller field
--R
--R   Continuing to read the file...
--R
--E 26
--S 27 of 29
a:=primitiveElement()$gf16
--R
--R
--R   (7)  %A
--R                Type: FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1)
--E 27
--S 28 of 29
q:P:=a*m^2+1
--R
--R
--R            2
--R   (8)  %A ?  + 1
--RType: SparseUnivariatePolynomial(FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1))
--E 28
--S 29 of 29
p rem q
--R
--R
--R   (9)  ?
--RType: SparseUnivariatePolynomial(FiniteFieldExtensionByPolynomial(PrimeField(2),?^4+?+1))
--E 29
)spool
)lisp (bye)

———- 9

References^{[1] nothing}

10