affine, substitution, shift, testing framework