code: 9ferno

ref: c9f54b0264a59179404644ce9f88fc748ad0a9a9
dir: /libsec/port/rsaencrypt.c/

View raw version
#include "os.h"
#include "../include/mp.h"
#include "libsec.h"

mpint*
rsaencrypt(RSApub *rsa, mpint *in, mpint *out)
{
	if(out == nil)
		out = mpnew(0);
	mpexp(in, rsa->ek, rsa->n, out);
	return out;
}