Sigrid Solveig Haflínudóttirremove unused code04522871 year agoHistory
34 lines · 620 B · C
RawDownload
#include "os.h"#include <mp.h> /* operands need to have m->top+1 digits of space and satisfy 0 ≤ a ≤ m-1 */static mpint*modarg(mpint *a, mpint *m){	if(a->size <= m->top || a->sign < 0 || mpmagcmp(a, m) >= 0){		a = mpcopy(a);		mpmod(a, m, a);		mpbits(a, Dbits*(m->top+1));		a->top = m->top;	} else if(a->top < m->top){		memset(&a->p[a->top], 0, (m->top - a->top)*Dbytes);	}	return a;} voidmpmodmul(mpint *b1, mpint *b2, mpint *m, mpint *prod){	mpint *a, *b; 	a = modarg(b1, m);	b = modarg(b2, m); 	mpmul(a, b, prod);	mpmod(prod, m, prod); 	if(a != b1)		mpfree(a);	if(b != b2)		mpfree(b);}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t