aboutsummaryrefslogtreecommitdiffstats
path: root/src/zmodsqr.c
blob: 4eb6e51a44b4c7a002b8e5afca5113fd5e5deb82 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* See LICENSE file for copyright and license details. */
#include "internals.h"


void
zmodsqr(z_t a, z_t b, z_t c)
{
	/* TODO What is the fastest way to do zmodsqr? */
	if (unlikely(a == c)) {
		zset(libzahl_tmp_modsqr, c);
		zsqr(a, b);
		zmod(a, a, libzahl_tmp_modsqr);
	} else {
		zsqr(a, b);
		zmod(a, a, c);
	}
}