From: Simon Goldschmidt Date: Fri, 28 Dec 2018 22:04:02 +0100 Subject: [U-Boot] [PATCH] rsa: read out public_exponent value based on 32-bit alignment In-Reply-To: <9b508540-49a5-fc82-443f-588b65e7110d@denx.de> References: <1544257051-3526-1-git-send-email-joyce.ooi@intel.com> <7b9c9491-4af1-e8bc-ecfd-813d3cca0482@denx.de> <9b508540-49a5-fc82-443f-588b65e7110d@denx.de> Message-ID: <65ad27d0-6108-bf32-9eb9-faa98a0b8f70@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Am 28.12.2018 um 19:44 schrieb Marek Vasut: > On 12/28/18 2:32 PM, Ooi, Joyce wrote: >>> -----Original Message----- >>> From: Marek Vasut [mailto:marex at denx.de] >>> Sent: Friday, December 28, 2018 6:05 PM >>> To: Ooi, Joyce ; Michal Simek >>> ; Siva Durga Prasad Paladugu >>> >>> Cc: u-boot at lists.denx.de; See, Chin Liang ; Chee, >>> Tien Fong ; Tan, Ley Foon >>> >>> Subject: Re: [PATCH] rsa: read out public_exponent value based on 32-bit >>> alignment >>> >>> On 12/28/18 8:30 AM, Ooi, Joyce wrote: >>>> Hi Marek, >>> >>> Hi, >>> >>>> Any comments about this? >>> >>> Use get_unaligned() ? >> It seems that if USE_HOSTCC is enabled, get_unaligned_* can't be used. > > Can this be fixed ? I was working on a patch (or series?) to make USE_HOSTCC more generic (i.e. concentrate the HOSTCC specific things in some header files, hopefully) as I have stumbled accross this when adding compression/uncompression to mkimage, but I haven't found the time to complete this, yet. Nevertheless, I think this is where we should go, rather then add yet more #ifdef USE_HOSTCC to C files... Regards, Simon > >> In lib/rsa/rsa-mod-exp.c, >> #ifndef USE_HOSTCC >> .. >> #include >> #else >> #include "fdt_host.h" >> #include "mkimage.h" >> #include >> #endif >> >> So, to make it more generic (with or without USE_HOSTCC enabled), I read out >> the public_exponent as two 32-bit datas and then concatenating them into a >> 64-bit data. > > See above -- I'd much rather see the get_unaligned() fixed and used. >