code: func (rs *RSEncoder) ECC(data []byte, check []byte) {
  	if len(check) < rs.c {
  		panic("gf256: invalid check byte length")
  	}
  	if rs.c == 0 {
  		return
  	}
  
  	// The check bytes are the remainder after dividing
  	// data padded with c zeros by the generator polynomial.
  
  	// p = data padded with c zeros.
  	var p []byte
  	n := len(data) + rs.c
  	if len(rs.p) >= n {
  		p = rs.p
  	} else {
  		p = make([]byte, n)
  	}
  	copy(p, data)
  	for i := len(data); i < len(p); i++ {
  		p[i] = 0
  	}
  
  	// Divide p by gen, leaving the remainder in p[len(data):].
  	// p[0] is the most significant term in p, and
  	// gen[0] is the most significant term in the generator,
  	// which is always 1.
  	// To avoid repeated work, we store various values as
  	// lv, not v, where lv = log[v].
  	f := rs.f
  	lgen := rs.lgen[1:]
  	for i := 0; i < len(data); i++ {
  		c := p[i]
  		if c == 0 {
  			continue
  		}
  		q := p[i+1:]
  		exp := f.exp[f.log[c]:]
  		for j, lg := range lgen {
  			if lg != 255 { // lgen uses 255 for log 0
  				q[j] ^= exp[lg]
  			}
  		}
  	}
  	copy(check, p[len(data):])
  	rs.p = p
  }
docs: // ECC writes to check the error correcting code bytes
  // for data using the given Reed-Solomon parameters.