From: Tadeusz Struk Subject: Re: RSA decryption output length Date: Fri, 5 Feb 2016 09:45:57 -0800 Message-ID: <56B4DFD5.6010600@intel.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit To: Tudor-Dan Ambarus , "linux-crypto@vger.kernel.org" Return-path: Received: from mga11.intel.com ([192.55.52.93]:36138 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932138AbcBERuB (ORCPT ); Fri, 5 Feb 2016 12:50:01 -0500 In-Reply-To: Sender: linux-crypto-owner@vger.kernel.org List-ID: Hi Tudor-Dan, On 02/05/2016 07:25 AM, Tudor-Dan Ambarus wrote: > I see that in qat, if the RSA decryption output data has the first octets of value zero, you skip them, actualize the dst_len and memmove the decrypted data to the initial pointer (see [1]). Why do you do this? Why can't you keep the decryption output data of key length? This is because the SW RSA implementation works the same way. MPI lib also discards the leading zeros. The two implementations have to produce the same output for a given input. Thanks, -- TS