pc_map issue with BN_P638

12 views
Skip to first unread message

NIKOLAOS GAVRIILIDIS

unread,
Jun 4, 2024, 12:03:40 PMJun 4
to relic-...@googlegroups.com
Hello,

I have been using Relic-toolkit for my experiments and I have stumbled upon an issue that i can’t overcome.

The experiments I am conducting are based on several ecc curves (BN_158, BN256, B12_381 etc.)
Initially i had issues with both BN_638 and B12_638 as when I used pc_map it seemed that the pairing result was full of “0” and an “1” somewhere in the middle.

The issue for B12_P638 was solved by changing cmake flag -DFP_QNRES from off to on.

Also K12_P638 seems to work fine.

I have tried too many other combinations of cmake in order to make BN_P638 work properly but none seems to have any positive outcome!

An example of a cmake that i use (for 638) is :
cmake .. -DALLOC=AUTO -DARCH=A64 -DWSIZE=64 -DMD_METHD=SH256 -DCHECK=off -DFP_PRIME=638 -DFP_PMERS=off -DFP_QNRES=off -DFP_METHD="BASIC;COMBA;COMBA;MONTY;MONTY;JMPDS;SLIDE" -DFPX_METHD="BASIC;BASIC;BASIC" -DPP_METHD="BASIC;OATEP” 

I would deeply appreciate some kind of guidance/help on this matter as I am out of ideas as if to what else i can do.

Thank you!

Kind Regards,
Nikolaos G.

Diego F. Aranha

unread,
Jun 4, 2024, 2:07:49 PMJun 4
to relic-...@googlegroups.com
Dear Nikolaos,

Curve B12_P638 is superior to BN_P638 in all aspects, so why would you need the BN curve?
With other curves defined over 638-bit fields having superior performance and/or clear security levels, BN_P638 is not easy to configure anymore and it should effectively be deprecated.

In any case, I can create a branch for you where BN_P638 is picked by default. Would that help?

Best,
--
Diego F. Aranha
Associate Professor at Computer Science Aarhus University, Denmark

Åbogade 34, Building 5335 (Office 291 at Nygaard)
8200 Aarhus N, Denmark





--

---
You received this message because you are subscribed to the Google Groups "relic-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to relic-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/relic-discuss/CAN4VE6WiStMMJecM%3DZ4M7u8Fxyw_YkuzPa3HUsSS_fj3u%2B0%3DNw%40mail.gmail.com.

NIKOLAOS GAVRIILIDIS

unread,
Jun 4, 2024, 4:06:15 PMJun 4
to relic-discuss
Dear Diego,

I am currently replicating experiments conducted in this (https://inria.hal.science/hal-02269719/document) paper but in newer platform for my research.
I have managed to get results in all security levels (with BN and B12 curves) except the 160sec level of BN_P638.
It would be deeply appreciated if you could guide me either in cmake configuration or help me by creating the branch you mentioned. 

1] What do you mean clear security levels? Aren't both BN_P638 and B12_P638 sec lvl 160?
2] Are there further information about each curve provided? If so, a link would be perfect!

Thank you very much!

Kind Regards,
Nikolaos G.



Diego F. Aranha

unread,
Jun 4, 2024, 4:20:24 PMJun 4
to relic-...@googlegroups.com
Hi Nikolaos,

Yes, both curves are at the ~160-bit security level, which is not very traditional in comparison to symmetric algorithms.
I created the branch bn638 in the main repository and it should be trivial to get it working from there.

NIKOLAOS GAVRIILIDIS

unread,
Jun 4, 2024, 8:08:07 PMJun 4
to relic-...@googlegroups.com
Hello Diego,

I finally managed to recreate the changes you did in the library into the version I have installed!
Super excited as I got correct results!
Many thanks for your help and fast response!

Best Regards,
Nikolaos G.

P.S. Could you please provide me some exapmles/documentation on how to use internal methods to measure memory and execution time, as i am currently using external tools.

You received this message because you are subscribed to a topic in the Google Groups "relic-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/relic-discuss/BsuZytWtjgo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to relic-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/relic-discuss/CAK2GZbEjVtm75eTB9geJ%2BrRBm51o3xdpw5yTxJypY0hWN191WQ%40mail.gmail.com.

Diego F. Aranha

unread,
Jun 5, 2024, 3:34:36 AMJun 5
to relic-...@googlegroups.com
Hi Nikolaos,

We do not have internal methods for measuring memory, and the benchmarks can be found in the bench folder (but probably do not run unchanged in your target platform).

NIKOLAOS GAVRIILIDIS

unread,
Jun 5, 2024, 1:55:38 PMJun 5
to relic-...@googlegroups.com
Hello Diego,

Thank you again for your help!

Kind Regards,
Nikolaos G.

Reply all
Reply to author
Forward
0 new messages