0

I use archlinux, and I install ntl from pacman by default.

I have a problem with catching InvMod error in my code, maybe someone have the same problem, and now the solution for this:

try {
          Q = Q + p;
        } catch (...) {
          std::cout<<"error?";
          return;
        }

where in + operator I have inverse of modulo, because everything is inside the finite field.

I get this message:

InvMod: inverse undefined
fish: 'and ./crypto' terminated by signal SIGABRT (Abort)

I want to catch this error, because I need to know when I cannot inverse some point. Anyone know how to do this in ntl :)?

pkruk
  • 809
  • 1
  • 7
  • 24

1 Answers1

2

According to the documentation, if you want it to throw an exception instead of just calling abort() - which it currently seems to be doing - you need to configure it with NTL_EXCEPTIONS=on.

Alan Stokes
  • 18,815
  • 3
  • 45
  • 64
  • Thanks, it's working, I compile the ntl localy, create FindNTL.cmake file, and is working at now thanks :) – pkruk Jan 03 '16 at 21:21