Otmane123 / relic-toolkit

Automatically exported from code.google.com/p/relic-toolkit
Other
0 stars 0 forks source link

Problem with elliptic curve p224 #11

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. First, when using Relic 0.3.0 I have a error with ep_param_set_any() and 
p224.
2. Relic 0.3.0 works with ec_param_set_any() --- note EC instead EP ---, but 
choose Koblitz 224 and I want NIST_P224.
3. If I disable EC_KBLTZ and EP_KBLTZ nothing works.
4. However, ep_param_set_any() works with p160.
5. Today I updated by the SVN, and this was corrected.
6. Ok, meantime now ec_upk() fails, see the error code:

ERROR in fp_srt() at /home/dinak/new-relic/src/fp/relic_fp_srt.c,53: invalid 
value passed as input.
    Call stack:
        #0 ./boneh_shparlinski.c.exe() [0x43e0d1]
        #1 ./boneh_shparlinski.c.exe() [0x41b399]
        #2 ./boneh_shparlinski.c.exe() [0x403322]
        #3 ./boneh_shparlinski.c.exe() [0x403840]
        #4 ./boneh_shparlinski.c.exe() [0x403a31]
    CAUGHT in ep_upk() at /home/dinak/new-relic/src/ep/relic_ep_pck.c,77.

What version of the product are you using? On what operating system?
Relic at SVN, Linux 64 bits.

Original issue reported on code.google.com by dio...@gmail.com on 27 Sep 2011 at 9:10

GoogleCodeExporter commented 8 years ago
Again, everthing works with p160.

Original comment by dio...@gmail.com on 27 Sep 2011 at 9:10

GoogleCodeExporter commented 8 years ago
Can you clarify on "nothing works"? It's a little evasive.

With the latest SVN version, only point compression fails due to the prime not 
being \equiv 3 (\bmod 4). RELIC up to now only implements square-root when p 
has this format. Support for other primes is on the way.

Original comment by dfaranha on 28 Sep 2011 at 1:01

GoogleCodeExporter commented 8 years ago

Original comment by dfaranha on 28 Sep 2011 at 1:02

GoogleCodeExporter commented 8 years ago

Original comment by dfaranha on 28 Sep 2011 at 1:19

GoogleCodeExporter commented 8 years ago
When I have said  "nothing works" is because I received with Relic 0.3.0 this:

-- Trying to recover Elliptic Curve Diffe-Hellman shared key:

ERROR in fp_prime_set() at /home/dinak/relic-0.3.0/src/fp/relic_fp_prime.c,188: 
invalid value passed as input.
    Call stack:
        #0 ./boneh_shparlinski.c.exe() [0x410f39]
        #1 ./boneh_shparlinski.c.exe() [0x411457]
        #2 ./boneh_shparlinski.c.exe() [0x40fe36]
        #3 ./boneh_shparlinski.c.exe() [0x41692f]
        #4 ./boneh_shparlinski.c.exe() [0x416cc0]
        #5 ./boneh_shparlinski.c.exe() [0x416c82]
        #6 ./boneh_shparlinski.c.exe() [0x4039a1]
    CAUGHT in fp_prime_set() at /home/dinak/relic-0.3.0/src/fp/relic_fp_prime.c,209.
    CAUGHT in fp_prime_set_spars() at /home/dinak/relic-0.3.0/src/fp/relic_fp_prime.c,268.
    CAUGHT in fp_param_set() at /home/dinak/relic-0.3.0/src/fp/relic_fp_param.c,290.
    CAUGHT in ep_param_set() at /home/dinak/relic-0.3.0/src/ep/relic_ep_param.c,401.

 Error! You had a bad luck. 

This appear that the p224 isn't defined, but I enable it with "ccmake".

Original comment by dio...@gmail.com on 28 Sep 2011 at 1:28

GoogleCodeExporter commented 8 years ago
P224 was supported in the library, but since no good choice for QNR in Fp was 
implemented to define Fp^2 when p = 1 mod 8, the library refused the 
configuration. This is already fixed in the repository, as you could notice.

Original comment by dfaranha on 28 Sep 2011 at 1:40

GoogleCodeExporter commented 8 years ago
Support for square root in F_p for p % 4 == 1 was added in the last SVN commit, 
which should fix this issue.

Original comment by conrado...@gmail.com on 3 Nov 2011 at 1:40