// sqrt_mod_p().
// General includes.
-#include "cl_sysdep.h"
+#include "base/cl_sysdep.h"
// Specification.
#include "cln/numtheory.h"
// Implementation.
-#include "cl_I.h"
-#include "cln/abort.h"
+#include "integer/cl_I.h"
+#include "cln/exception.h"
#undef floor
#include <cmath>
const sqrt_mod_p_t sqrt_mod_p (const cl_modint_ring& R, const cl_MI& a)
{
- if (!(a.ring() == R)) cl_abort();
+ if (!(a.ring() == R)) throw runtime_exception();
var cl_I& p = R->modulus;
var cl_I aa = R->retract(a);
switch (jacobi(aa,p)) {