1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include "os.h" #include <mp.h> #include <libsec.h> RSApub* rsaprivtopub(RSApriv *priv) { RSApub *pub; pub = rsapuballoc(); if(pub == nil) return nil; pub->n = mpcopy(priv->pub.n); pub->ek = mpcopy(priv->pub.ek); return pub; }