added cache for sbox_layer