Re: avr-crypto-lib
Paweł Si <[email protected]> Tue, 1 Jun 2021 14:06:08 +0200
| Newsgroups | gmane.comp.hardware.avr.gcc |
|---|---|
| Message-ID | <CAPgZLFaU1bmNobpK6LMs29po3FOqrmfFjYLhFPVe-FT6yCz-XQ@mail.gmail.com> |
--0000000000007b4ece05c3b32bab Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable wt., 1 cze 2021 o 08:37 BERTRAND Jo=C3=ABl <[email protected]> napisa=C5=82(a): > RSA doesn't run as expected. With expopent=3D3 and length=3D512, program > doesn't crash but after four hours (@ 16 MHz on simavr), gdb shows that > program stays in RSA subroutines and doesn't return to main routine. > Something is probably broken somewhere. > try to replace in the example above: /* add your fix here */ with: bigint_adjust(&data); bigint_adjust(&public->exponent); bigint_adjust(&public->modulus); The computation takes 4 seconds on my laptop. Note that the "I" value changes (from I=3D0.. to): BIGINT: 0x40f5.. L=3D14.. I=3D6.. I've tried to find a "HOWTO use avr-crypto-lib" documentation, but I couldn't find any, which is a little worrying (maybe I didn't try hard enough). If there is no documentation reading the source code and test code is an option. > > I have found a uECC library but I don't understand how use this library > to encrypt data (I think I have understand how I can sign data). > > Best regards, > > JB > --0000000000007b4ece05c3b32bab Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">= <div dir=3D"ltr" class=3D"gmail_attr">wt., 1 cze 2021 o 08:37=C2=A0BERTRAND= Jo=C3=ABl <<a href=3D"mailto:[email protected]">joel.bertrand@s= ystella.fr</a>> napisa=C5=82(a):<br></div><blockquote class=3D"gmail_quo= te" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204= );padding-left:1ex">RSA doesn't run as expected. With expopent=3D3 and = length=3D512, program<br> doesn't crash but after four hours (@ 16 MHz on simavr), gdb shows that= <br> program stays in RSA subroutines and doesn't return to main routine.<br= > Something is probably broken somewhere.<br></blockquote><div><br></div><div= >try to replace in the example above:<br>=C2=A0 /* add your fix here */<br>= </div><div>with:<br>=C2=A0 bigint_adjust(&data);<br>=C2=A0 bigint_adjus= t(&public->exponent);<br>=C2=A0 bigint_adjust(&public->modulu= s);<br></div><div><br>The computation takes 4 seconds on my laptop.<br>Note= that the "I"=C2=A0value changes (from I=3D0.. to):<br>=C2=A0 =C2= =A0BIGINT: 0x40f5..<br>=C2=A0 =C2=A0L=3D14..<br>=C2=A0 =C2=A0I=3D6..<br><br= >I've tried to find a "HOWTO use avr-crypto-lib" documentatio= n,<br>but I couldn't find any,=C2=A0which is a little worrying (maybe I= didn't try hard enough).<br>If there is no documentation reading the s= ource code and test code is an option.<br><br></div><div>=C2=A0<br></div><b= lockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-le= ft:1px solid rgb(204,204,204);padding-left:1ex"> <br> I have found a uECC library but I don't understand how use this library= <br> to encrypt data (I think I have understand how I can sign data).<br> <br> Best regards,<br> <br> JB<br> </blockquote></div></div> --0000000000007b4ece05c3b32bab--