func (e *Encryption) transform(in, out []byte) error {
	inLength := len(in)

	for i := 0; i < inLength; i += e.keyLen {
		l := min(e.keyLen, inLength-i)
		err := e.Transcrypt(e.index, in[i:i+l], out[i:i+l])
		if err != nil {
			return err
		}
		e.index++
	}
	// pad the rest if out is longer
	pad(out[inLength:])
	return nil
}
// split up input into keylength segments and encrypt sequentially
split up input into keylength segments and encrypt sequentially
// split up input into keylength segments and encrypt sequentially
func (e *Encryption) transform(in, out []byte) error {
	inLength := len(in)
	for i := 0; i < inLength; i += e.keyLen {
		l := min(e.keyLen, inLength-i)
		err := e.Transcrypt(e.index, in[i:i+l], out[i:i+l])
		if err != nil {
			return err
		}
		e.index++
	}
	pad(out[inLength:])
	return nil
}
func ( e * Encryption ) transform ( in , out [ ] byte ) error { inLength := len ( in ) for i := 0 ; i < inLength ; i += e . keyLen { l := min ( e . keyLen , inLength - i ) err := e . Transcrypt ( e . index , in [ i : i + l ] , out [ i : i + l ] ) if err != nil { return err } e . index ++ } pad ( out [ inLength : ] ) return nil }
split up input into keylength segments and encrypt sequentially
split up input into keylength segments and encrypt sequentially
// pad the rest if out is longer