Hi Tadeusz, On 7 September 2015 at 16:06, Tadeusz Struk <tadeusz.struk@xxxxxxxxx> wrote: > Hi Andrew, > On 09/05/2015 04:00 PM, Andrew Zaborowski wrote: >> +static int crypto_akcipher_init(struct crypto_tfm *tfm, u32 type, u32 mask) >> +{ >> + return 0; >> +} >> + > > This is not needed I think. To create the padding transform I needed to use crypto_spawn_tfm which then calls -> __crypto_alloc_tfm -> crypto_init_ops resulting in a call to crypto_akcipher_type.init(). > >> >> +static int pkcs1pad_decrypt_complete(struct akcipher_request *req, int err) >> +{ >> + struct akcipher_request *child_req = akcipher_request_ctx(req); >> + int pos; >> + uint8_t *dst = child_req->dst; >> + >> + BUG_ON(err == -EOVERFLOW); >> + >> + if (err) >> + goto done; >> + >> + if (dst[0] != 0x00) { >> + err = -EINVAL; >> + goto done; >> + } > > This won't work I'm afraid, because MPI strips all leading zeors. Good point, I have been testing against a version from before your change to mpi_read_buffer which strips the leading zeros. I'll retest and update the patch after your other akcipher work is submitted. Best regards -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html