* [U-Boot] [PATCH] rsa: read out public_exponent value based on 32-bit alignment
@ 2018-12-08 8:17 Ooi, Joyce
2018-12-28 7:30 ` Ooi, Joyce
0 siblings, 1 reply; 9+ messages in thread
From: Ooi, Joyce @ 2018-12-08 8:17 UTC (permalink / raw)
To: u-boot
Public_exponent is a 64-bit data, which is stored in the device tree
blob in a 32-bit alignment address. This causes a problem for ARM64 when
public_exponent is read out one shot as a 64-bit data from an unaligned
address. Hence, to solve this problem, public_exponent is read out as two
32-bit datas, and then concatenating them.
Signed-off-by: Ooi, Joyce <joyce.ooi@intel.com>
---
lib/rsa/rsa-mod-exp.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/rsa/rsa-mod-exp.c b/lib/rsa/rsa-mod-exp.c
index 9d78aa1..3eace38 100644
--- a/lib/rsa/rsa-mod-exp.c
+++ b/lib/rsa/rsa-mod-exp.c
@@ -252,6 +252,9 @@ int rsa_mod_exp_sw(const uint8_t *sig, uint32_t sig_len,
{
struct rsa_public_key key;
int ret;
+ uint64_t exponent =
+ (uint64_t)(*((uint32_t *)(prop->public_exponent + 4))) << 32 |
+ *((uint32_t *)(prop->public_exponent));
if (!prop) {
debug("%s: Skipping invalid prop", __func__);
@@ -263,8 +266,7 @@ int rsa_mod_exp_sw(const uint8_t *sig, uint32_t sig_len,
if (!prop->public_exponent)
key.exponent = RSA_DEFAULT_PUBEXP;
else
- key.exponent =
- fdt64_to_cpu(*((uint64_t *)(prop->public_exponent)));
+ key.exponent = fdt64_to_cpu(exponent);
if (!key.len || !prop->modulus || !prop->rr) {
debug("%s: Missing RSA key info", __func__);
--
1.7.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH] rsa: read out public_exponent value based on 32-bit alignment
2018-12-08 8:17 [U-Boot] [PATCH] rsa: read out public_exponent value based on 32-bit alignment Ooi, Joyce
@ 2018-12-28 7:30 ` Ooi, Joyce
2018-12-28 10:05 ` Marek Vasut
0 siblings, 1 reply; 9+ messages in thread
From: Ooi, Joyce @ 2018-12-28 7:30 UTC (permalink / raw)
To: u-boot
Hi Marek,
Any comments about this?
Thanks,
Joyce Ooi
> -----Original Message-----
> From: Ooi, Joyce
> Sent: Saturday, December 8, 2018 4:18 PM
> To: Marek Vasut <marex@denx.de>; Michal Simek <michal.simek@xilinx.com>;
> Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
> Cc: u-boot at lists.denx.de; Ooi, Joyce <joyce.ooi@intel.com>; See, Chin Liang
> <chin.liang.see@intel.com>; Chee, Tien Fong <tien.fong.chee@intel.com>; Tan,
> Ley Foon <ley.foon.tan@intel.com>
> Subject: [PATCH] rsa: read out public_exponent value based on 32-bit alignment
>
> Public_exponent is a 64-bit data, which is stored in the device tree blob in a 32-
> bit alignment address. This causes a problem for ARM64 when public_exponent
> is read out one shot as a 64-bit data from an unaligned address. Hence, to solve
> this problem, public_exponent is read out as two 32-bit datas, and then
> concatenating them.
>
> Signed-off-by: Ooi, Joyce <joyce.ooi@intel.com>
> ---
> lib/rsa/rsa-mod-exp.c | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/lib/rsa/rsa-mod-exp.c b/lib/rsa/rsa-mod-exp.c index
> 9d78aa1..3eace38 100644
> --- a/lib/rsa/rsa-mod-exp.c
> +++ b/lib/rsa/rsa-mod-exp.c
> @@ -252,6 +252,9 @@ int rsa_mod_exp_sw(const uint8_t *sig, uint32_t
> sig_len, {
> struct rsa_public_key key;
> int ret;
> + uint64_t exponent =
> + (uint64_t)(*((uint32_t *)(prop->public_exponent + 4))) << 32 |
> + *((uint32_t *)(prop->public_exponent));
>
> if (!prop) {
> debug("%s: Skipping invalid prop", __func__); @@ -263,8
> +266,7 @@ int rsa_mod_exp_sw(const uint8_t *sig, uint32_t sig_len,
> if (!prop->public_exponent)
> key.exponent = RSA_DEFAULT_PUBEXP;
> else
> - key.exponent =
> - fdt64_to_cpu(*((uint64_t *)(prop->public_exponent)));
> + key.exponent = fdt64_to_cpu(exponent);
>
> if (!key.len || !prop->modulus || !prop->rr) {
> debug("%s: Missing RSA key info", __func__);
> --
> 1.7.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH] rsa: read out public_exponent value based on 32-bit alignment
2018-12-28 7:30 ` Ooi, Joyce
@ 2018-12-28 10:05 ` Marek Vasut
2018-12-28 13:32 ` Ooi, Joyce
0 siblings, 1 reply; 9+ messages in thread
From: Marek Vasut @ 2018-12-28 10:05 UTC (permalink / raw)
To: u-boot
On 12/28/18 8:30 AM, Ooi, Joyce wrote:
> Hi Marek,
Hi,
> Any comments about this?
Use get_unaligned() ?
> Thanks,
> Joyce Ooi
>
>> -----Original Message-----
>> From: Ooi, Joyce
>> Sent: Saturday, December 8, 2018 4:18 PM
>> To: Marek Vasut <marex@denx.de>; Michal Simek <michal.simek@xilinx.com>;
>> Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
>> Cc: u-boot at lists.denx.de; Ooi, Joyce <joyce.ooi@intel.com>; See, Chin Liang
>> <chin.liang.see@intel.com>; Chee, Tien Fong <tien.fong.chee@intel.com>; Tan,
>> Ley Foon <ley.foon.tan@intel.com>
>> Subject: [PATCH] rsa: read out public_exponent value based on 32-bit alignment
>>
>> Public_exponent is a 64-bit data, which is stored in the device tree blob in a 32-
>> bit alignment address. This causes a problem for ARM64 when public_exponent
>> is read out one shot as a 64-bit data from an unaligned address. Hence, to solve
>> this problem, public_exponent is read out as two 32-bit datas, and then
>> concatenating them.
>>
>> Signed-off-by: Ooi, Joyce <joyce.ooi@intel.com>
>> ---
>> lib/rsa/rsa-mod-exp.c | 6 ++++--
>> 1 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/lib/rsa/rsa-mod-exp.c b/lib/rsa/rsa-mod-exp.c index
>> 9d78aa1..3eace38 100644
>> --- a/lib/rsa/rsa-mod-exp.c
>> +++ b/lib/rsa/rsa-mod-exp.c
>> @@ -252,6 +252,9 @@ int rsa_mod_exp_sw(const uint8_t *sig, uint32_t
>> sig_len, {
>> struct rsa_public_key key;
>> int ret;
>> + uint64_t exponent =
>> + (uint64_t)(*((uint32_t *)(prop->public_exponent + 4))) << 32 |
>> + *((uint32_t *)(prop->public_exponent));
>>
>> if (!prop) {
>> debug("%s: Skipping invalid prop", __func__); @@ -263,8
>> +266,7 @@ int rsa_mod_exp_sw(const uint8_t *sig, uint32_t sig_len,
>> if (!prop->public_exponent)
>> key.exponent = RSA_DEFAULT_PUBEXP;
>> else
>> - key.exponent =
>> - fdt64_to_cpu(*((uint64_t *)(prop->public_exponent)));
>> + key.exponent = fdt64_to_cpu(exponent);
>>
>> if (!key.len || !prop->modulus || !prop->rr) {
>> debug("%s: Missing RSA key info", __func__);
>> --
>> 1.7.1
>
--
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH] rsa: read out public_exponent value based on 32-bit alignment
2018-12-28 10:05 ` Marek Vasut
@ 2018-12-28 13:32 ` Ooi, Joyce
2018-12-28 18:44 ` Marek Vasut
0 siblings, 1 reply; 9+ messages in thread
From: Ooi, Joyce @ 2018-12-28 13:32 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: Marek Vasut [mailto:marex at denx.de]
> Sent: Friday, December 28, 2018 6:05 PM
> To: Ooi, Joyce <joyce.ooi@intel.com>; Michal Simek
> <michal.simek@xilinx.com>; Siva Durga Prasad Paladugu
> <siva.durga.paladugu@xilinx.com>
> Cc: u-boot at lists.denx.de; See, Chin Liang <chin.liang.see@intel.com>; Chee,
> Tien Fong <tien.fong.chee@intel.com>; Tan, Ley Foon
> <ley.foon.tan@intel.com>
> 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.
In lib/rsa/rsa-mod-exp.c,
#ifndef USE_HOSTCC
..
#include <asm/unaligned.h>
#else
#include "fdt_host.h"
#include "mkimage.h"
#include <fdt_support.h>
#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.
>
> > Thanks,
> > Joyce Ooi
> >
> >> -----Original Message-----
> >> From: Ooi, Joyce
> >> Sent: Saturday, December 8, 2018 4:18 PM
> >> To: Marek Vasut <marex@denx.de>; Michal Simek
> >> <michal.simek@xilinx.com>; Siva Durga Prasad Paladugu
> >> <siva.durga.paladugu@xilinx.com>
> >> Cc: u-boot at lists.denx.de; Ooi, Joyce <joyce.ooi@intel.com>; See, Chin
> >> Liang <chin.liang.see@intel.com>; Chee, Tien Fong
> >> <tien.fong.chee@intel.com>; Tan, Ley Foon <ley.foon.tan@intel.com>
> >> Subject: [PATCH] rsa: read out public_exponent value based on 32-bit
> >> alignment
> >>
> >> Public_exponent is a 64-bit data, which is stored in the device tree
> >> blob in a 32- bit alignment address. This causes a problem for ARM64
> >> when public_exponent is read out one shot as a 64-bit data from an
> >> unaligned address. Hence, to solve this problem, public_exponent is
> >> read out as two 32-bit datas, and then concatenating them.
> >>
> >> Signed-off-by: Ooi, Joyce <joyce.ooi@intel.com>
> >> ---
> >> lib/rsa/rsa-mod-exp.c | 6 ++++--
> >> 1 files changed, 4 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/lib/rsa/rsa-mod-exp.c b/lib/rsa/rsa-mod-exp.c index
> >> 9d78aa1..3eace38 100644
> >> --- a/lib/rsa/rsa-mod-exp.c
> >> +++ b/lib/rsa/rsa-mod-exp.c
> >> @@ -252,6 +252,9 @@ int rsa_mod_exp_sw(const uint8_t *sig, uint32_t
> >> sig_len, {
> >> struct rsa_public_key key;
> >> int ret;
> >> + uint64_t exponent =
> >> + (uint64_t)(*((uint32_t *)(prop->public_exponent + 4))) << 32 |
> >> + *((uint32_t *)(prop->public_exponent));
> >>
> >> if (!prop) {
> >> debug("%s: Skipping invalid prop", __func__); @@ -263,8
> >> +266,7 @@ int rsa_mod_exp_sw(const uint8_t *sig, uint32_t sig_len,
> >> if (!prop->public_exponent)
> >> key.exponent = RSA_DEFAULT_PUBEXP;
> >> else
> >> - key.exponent =
> >> - fdt64_to_cpu(*((uint64_t *)(prop->public_exponent)));
> >> + key.exponent = fdt64_to_cpu(exponent);
> >>
> >> if (!key.len || !prop->modulus || !prop->rr) {
> >> debug("%s: Missing RSA key info", __func__);
> >> --
> >> 1.7.1
> >
>
>
> --
> Best regards,
> Marek Vasut
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH] rsa: read out public_exponent value based on 32-bit alignment
2018-12-28 13:32 ` Ooi, Joyce
@ 2018-12-28 18:44 ` Marek Vasut
2018-12-28 21:04 ` Simon Goldschmidt
0 siblings, 1 reply; 9+ messages in thread
From: Marek Vasut @ 2018-12-28 18:44 UTC (permalink / raw)
To: u-boot
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 <joyce.ooi@intel.com>; Michal Simek
>> <michal.simek@xilinx.com>; Siva Durga Prasad Paladugu
>> <siva.durga.paladugu@xilinx.com>
>> Cc: u-boot at lists.denx.de; See, Chin Liang <chin.liang.see@intel.com>; Chee,
>> Tien Fong <tien.fong.chee@intel.com>; Tan, Ley Foon
>> <ley.foon.tan@intel.com>
>> 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 ?
> In lib/rsa/rsa-mod-exp.c,
> #ifndef USE_HOSTCC
> ..
> #include <asm/unaligned.h>
> #else
> #include "fdt_host.h"
> #include "mkimage.h"
> #include <fdt_support.h>
> #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.
--
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH] rsa: read out public_exponent value based on 32-bit alignment
2018-12-28 18:44 ` Marek Vasut
@ 2018-12-28 21:04 ` Simon Goldschmidt
2019-01-04 9:36 ` Ooi, Joyce
0 siblings, 1 reply; 9+ messages in thread
From: Simon Goldschmidt @ 2018-12-28 21:04 UTC (permalink / raw)
To: u-boot
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 <joyce.ooi@intel.com>; Michal Simek
>>> <michal.simek@xilinx.com>; Siva Durga Prasad Paladugu
>>> <siva.durga.paladugu@xilinx.com>
>>> Cc: u-boot at lists.denx.de; See, Chin Liang <chin.liang.see@intel.com>; Chee,
>>> Tien Fong <tien.fong.chee@intel.com>; Tan, Ley Foon
>>> <ley.foon.tan@intel.com>
>>> 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 <asm/unaligned.h>
>> #else
>> #include "fdt_host.h"
>> #include "mkimage.h"
>> #include <fdt_support.h>
>> #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.
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH] rsa: read out public_exponent value based on 32-bit alignment
2018-12-28 21:04 ` Simon Goldschmidt
@ 2019-01-04 9:36 ` Ooi, Joyce
2019-01-04 9:46 ` Simon Goldschmidt
0 siblings, 1 reply; 9+ messages in thread
From: Ooi, Joyce @ 2019-01-04 9:36 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: Simon Goldschmidt [mailto:simon.k.r.goldschmidt at gmail.com]
> Sent: Saturday, December 29, 2018 5:04 AM
> To: Marek Vasut <marex@denx.de>; Ooi, Joyce <joyce.ooi@intel.com>; Michal
> Simek <michal.simek@xilinx.com>; Siva Durga Prasad Paladugu
> <siva.durga.paladugu@xilinx.com>
> Cc: u-boot at lists.denx.de; Chee, Tien Fong <tien.fong.chee@intel.com>; See,
> Chin Liang <chin.liang.see@intel.com>
> Subject: Re: [U-Boot] [PATCH] rsa: read out public_exponent value based on 32-
> bit alignment
>
> 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 <joyce.ooi@intel.com>; Michal Simek
> >>> <michal.simek@xilinx.com>; Siva Durga Prasad Paladugu
> >>> <siva.durga.paladugu@xilinx.com>
> >>> Cc: u-boot at lists.denx.de; See, Chin Liang
> >>> <chin.liang.see@intel.com>; Chee, Tien Fong
> >>> <tien.fong.chee@intel.com>; Tan, Ley Foon <ley.foon.tan@intel.com>
> >>> 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
Can you please help to fix this, Simon? I'm not too familiar with USE_HOSTCC..
Thanks.
>
> >
> >> In lib/rsa/rsa-mod-exp.c,
> >> #ifndef USE_HOSTCC
> >> ..
> >> #include <asm/unaligned.h>
> >> #else
> >> #include "fdt_host.h"
> >> #include "mkimage.h"
> >> #include <fdt_support.h>
> >> #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.
> >
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH] rsa: read out public_exponent value based on 32-bit alignment
2019-01-04 9:36 ` Ooi, Joyce
@ 2019-01-04 9:46 ` Simon Goldschmidt
2019-01-24 6:09 ` Ooi, Joyce
0 siblings, 1 reply; 9+ messages in thread
From: Simon Goldschmidt @ 2019-01-04 9:46 UTC (permalink / raw)
To: u-boot
On Fri, Jan 4, 2019 at 10:36 AM Ooi, Joyce <joyce.ooi@intel.com> wrote:
>
> > -----Original Message-----
> > From: Simon Goldschmidt [mailto:simon.k.r.goldschmidt at gmail.com]
> > Sent: Saturday, December 29, 2018 5:04 AM
> > To: Marek Vasut <marex@denx.de>; Ooi, Joyce <joyce.ooi@intel.com>; Michal
> > Simek <michal.simek@xilinx.com>; Siva Durga Prasad Paladugu
> > <siva.durga.paladugu@xilinx.com>
> > Cc: u-boot at lists.denx.de; Chee, Tien Fong <tien.fong.chee@intel.com>; See,
> > Chin Liang <chin.liang.see@intel.com>
> > Subject: Re: [U-Boot] [PATCH] rsa: read out public_exponent value based on 32-
> > bit alignment
> >
> > 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 <joyce.ooi@intel.com>; Michal Simek
> > >>> <michal.simek@xilinx.com>; Siva Durga Prasad Paladugu
> > >>> <siva.durga.paladugu@xilinx.com>
> > >>> Cc: u-boot at lists.denx.de; See, Chin Liang
> > >>> <chin.liang.see@intel.com>; Chee, Tien Fong
> > >>> <tien.fong.chee@intel.com>; Tan, Ley Foon <ley.foon.tan@intel.com>
> > >>> 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
> Can you please help to fix this, Simon? I'm not too familiar with USE_HOSTCC..
I'm not there, yet, unfortunately. I don't have too much time for
U-Boot right now and my current work is getting of-platdata to run.
So it might be a few weeks until I can continue working on that.
Regards,
Simon
> Thanks.
>
> >
> > >
> > >> In lib/rsa/rsa-mod-exp.c,
> > >> #ifndef USE_HOSTCC
> > >> ..
> > >> #include <asm/unaligned.h>
> > >> #else
> > >> #include "fdt_host.h"
> > >> #include "mkimage.h"
> > >> #include <fdt_support.h>
> > >> #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.
> > >
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot] [PATCH] rsa: read out public_exponent value based on 32-bit alignment
2019-01-04 9:46 ` Simon Goldschmidt
@ 2019-01-24 6:09 ` Ooi, Joyce
0 siblings, 0 replies; 9+ messages in thread
From: Ooi, Joyce @ 2019-01-24 6:09 UTC (permalink / raw)
To: u-boot
> -----Original Message-----
> From: Simon Goldschmidt [mailto:simon.k.r.goldschmidt at gmail.com]
> Sent: Friday, January 4, 2019 5:46 PM
> To: Ooi, Joyce <joyce.ooi@intel.com>
> Cc: Marek Vasut <marex@denx.de>; Michal Simek <michal.simek@xilinx.com>;
> Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>; u-
> boot at lists.denx.de; Chee, Tien Fong <tien.fong.chee@intel.com>; See, Chin
> Liang <chin.liang.see@intel.com>
> Subject: Re: [U-Boot] [PATCH] rsa: read out public_exponent value based on 32-
> bit alignment
>
> On Fri, Jan 4, 2019 at 10:36 AM Ooi, Joyce <joyce.ooi@intel.com> wrote:
> >
> > > -----Original Message-----
> > > From: Simon Goldschmidt [mailto:simon.k.r.goldschmidt at gmail.com]
> > > Sent: Saturday, December 29, 2018 5:04 AM
> > > To: Marek Vasut <marex@denx.de>; Ooi, Joyce <joyce.ooi@intel.com>;
> > > Michal Simek <michal.simek@xilinx.com>; Siva Durga Prasad Paladugu
> > > <siva.durga.paladugu@xilinx.com>
> > > Cc: u-boot at lists.denx.de; Chee, Tien Fong
> > > <tien.fong.chee@intel.com>; See, Chin Liang
> > > <chin.liang.see@intel.com>
> > > Subject: Re: [U-Boot] [PATCH] rsa: read out public_exponent value
> > > based on 32- bit alignment
> > >
> > > 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 <joyce.ooi@intel.com>; Michal Simek
> > > >>> <michal.simek@xilinx.com>; Siva Durga Prasad Paladugu
> > > >>> <siva.durga.paladugu@xilinx.com>
> > > >>> Cc: u-boot at lists.denx.de; See, Chin Liang
> > > >>> <chin.liang.see@intel.com>; Chee, Tien Fong
> > > >>> <tien.fong.chee@intel.com>; Tan, Ley Foon
> > > >>> <ley.foon.tan@intel.com>
> > > >>> 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
> > Can you please help to fix this, Simon? I'm not too familiar with USE_HOSTCC..
>
> I'm not there, yet, unfortunately. I don't have too much time for U-Boot right
> now and my current work is getting of-platdata to run.
>
> So it might be a few weeks until I can continue working on that.
No worries. Do let me know when you've worked on it.
Thanks!
>
> Regards,
> Simon
>
> > Thanks.
> >
> > >
> > > >
> > > >> In lib/rsa/rsa-mod-exp.c,
> > > >> #ifndef USE_HOSTCC
> > > >> ..
> > > >> #include <asm/unaligned.h>
> > > >> #else
> > > >> #include "fdt_host.h"
> > > >> #include "mkimage.h"
> > > >> #include <fdt_support.h>
> > > >> #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.
> > > >
> >
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2019-01-24 6:09 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-08 8:17 [U-Boot] [PATCH] rsa: read out public_exponent value based on 32-bit alignment Ooi, Joyce
2018-12-28 7:30 ` Ooi, Joyce
2018-12-28 10:05 ` Marek Vasut
2018-12-28 13:32 ` Ooi, Joyce
2018-12-28 18:44 ` Marek Vasut
2018-12-28 21:04 ` Simon Goldschmidt
2019-01-04 9:36 ` Ooi, Joyce
2019-01-04 9:46 ` Simon Goldschmidt
2019-01-24 6:09 ` Ooi, Joyce
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.