shithub: riscv

ref: 12ccc63ec3d72d1ef5b591c7f50534ac3b1e890b
dir: /sys/src/libsec/port/egprivtopub.c/

View raw version
#include "os.h"
#include <mp.h>
#include <libsec.h>

EGpub*
egprivtopub(EGpriv *priv)
{
	EGpub *pub;

	pub = egpuballoc();
	if(pub == nil)
		return nil;
	pub->p = mpcopy(priv->pub.p);
	pub->alpha = mpcopy(priv->pub.alpha);
	pub->key = mpcopy(priv->pub.key);
	return pub;
}