aboutsummaryrefslogtreecommitdiffstats
path: root/src/zmodmul.c
blob: 6b0490908439e2a1a7072a0d8fb8904807f3cd3f (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
zmodmul(z_t a, z_t b, z_t c, z_t d)
{
	/* TODO Montgomery modular multiplication */
	if (a == d) {
		zset(libzahl_tmp_modmul, d);
		zmul(a, b, c);
		zmod(a, a, libzahl_tmp_modmul);
	} else {
		zmul(a, b, c);
		zmod(a, a, d);
	}
}