anchor.diff:             :gdiv
              :gtest
              :times
  -           :rs-generator))
  +           :rs-generator
  +           :rs-encode))
   
   (in-package :galois)
   
  
positive.code:      as g = (gmul gf pg (list 1 (g^ gf 2 i)))
       finally (return g)))
  
  
negative.code:        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)))
           (dividend (rightp dividend (cdr divisor)))
           (divisor (rightp (cdr divisor) dividend)))
      (labels ((reduce-expr (e)
                 (cond
                   ((not (consp e)) e)
                   ((equal 'times (cadr e))
                    (if (zerop (caddr e)) 0
                        (g* gf (car e) (reduce (lambda (x y) (g+ gf x y)) (loop for n in (cddr e) collect (reduce-expr n))))))
                   ((consp (cadr e))
                    (reduce (lambda (x y) (g+ gf x y)) (loop for n in e collect (reduce-expr n))))
                   (t (g+ gf (car e) (reduce-expr (cadr e)))))))
        (let ((res (mapcar #'reduce-expr (polydiv dividend divisor))))
          (values (subseq res 0 (- (length res) numsym))
                  (subseq res (- (length res) numsym)))))))
  
  (defmethod gtest ((gf gf) e)
      (labels ((reduce-expr (e)
  