anchor.diff:         collect (loop for p0 in (reverse (cdr p))
                     for q1 in (reverse qq)
                     collect (cons q1 p0))))))
  +
  +(defun polydiv (dividend divisor)
  +  "build an expression tree representing the structure of two-polynomial division"
  +  (labels ((stp (coef xyz pn)
  +             (cons coef
  +                   (loop for p in pn
  +                      for x in (reverse xyz)
  +                      collect (cons x (cons 'times p))))))
  +    (loop for a in dividend
  +       for x in (cons nil divisor)
  +       as px = nil then stps
  +       collecting x into xyz
  +       collecting (stp a (cdr xyz) px) into stps
  +       finally (return stps))))
     
   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   ;; CLOS definitions
  
positive.code:          as r = (g* gf px base)
           finally (return r))))
  
  (defun rightp (p1 p2)
    (if (null p2)
        p1
        (rightp (append p1 (list 0)) (cdr p2))))
  
  (defun polydiv (dividend divisor)
    (labels ((stp (coef xyz pn)
               (cons coef
                     (loop for p in pn
                        for x in (reverse xyz)
                        collect (cons x (cons 'times p))))))
      (loop for a in dividend
         for x in (cons nil divisor)
         as px = nil then stps
         collecting x into xyz
         collecting (stp a (cdr xyz) px) into stps
         finally (return stps))))
  
  (defmethod gdiv ((gf gf) dividend divisor)
    (let* ((numsym (1- (length divisor)))
  
negative.code: (defpackage :galois
    (:use :common-lisp)
    (:export :gf
             :gf16
             :gf64
             :gf256
             :gf1024
             :gf4096
             :n
             :p
             :g+
  