crypto: Reimplement preprocess.