var BigInteger=require("../libs/jsbn.js"),schemes=require("../schemes/schemes.js");module.exports=function(e,n){var r=schemes.pkcs1.makeScheme(e,n);return{encrypt:function(n,t){var c,a;return t?(c=new BigInteger(r.encPad(n,{type:1})),a=e.$doPrivate(c)):(c=new BigInteger(e.encryptionScheme.encPad(n)),a=e.$doPublic(c)),a.toBuffer(e.encryptedDataLength)},decrypt:function(n,t){var c,a=new BigInteger(n);return t?(c=e.$doPublic(a),r.encUnPad(c.toBuffer(e.encryptedDataLength),{type:1})):(c=e.$doPrivate(a),e.encryptionScheme.encUnPad(c.toBuffer(e.encryptedDataLength)))}}};