libzahl

big integer library
git clone git://git.suckless.org/libzahl
Log | Files | Refs | README | LICENSE

zmodsqr.c (320B)


      1 /* See LICENSE file for copyright and license details. */
      2 #include "internals.h"
      3 
      4 
      5 void
      6 zmodsqr(z_t a, z_t b, z_t c)
      7 {
      8 	/* TODO What is the fastest way to do zmodsqr? */
      9 	if (unlikely(a == c)) {
     10 		zset(libzahl_tmp_modsqr, c);
     11 		zsqr(a, b);
     12 		zmod(a, a, libzahl_tmp_modsqr);
     13 	} else {
     14 		zsqr(a, b);
     15 		zmod(a, a, c);
     16 	}
     17 }