A few comments and very minor fixes
diff --git a/js/securityLib/rsa.js b/js/securityLib/rsa.js
index 6150003..66baa27 100644
--- a/js/securityLib/rsa.js
+++ b/js/securityLib/rsa.js
@@ -60,7 +60,10 @@
return new BigInteger(ba);
}
-// "empty" RSA key constructor
+/**
+ * "empty" RSA key constructor
+ * @returns {RSAKey}
+ */
function RSAKey() {
this.n = null;
this.e = 0;
@@ -72,7 +75,12 @@
this.coeff = null;
}
-// Set the public key fields N and e from hex strings
+/**
+ * Set the public key fields N and e from hex strings
+ * @param N
+ * @param E
+ * @returns {RSASetPublic}
+ */
function RSASetPublic(N,E) {
if(N != null && E != null && N.length > 0 && E.length > 0) {
this.n = parseBigInt(N,16);
@@ -82,12 +90,18 @@
alert("Invalid RSA public key");
}
-// Perform raw public operation on "x": return x^e (mod n)
+/**
+ * Perform raw public operation on "x": return x^e (mod n)
+ * @param x
+ * @returns x^e (mod n)
+ */
function RSADoPublic(x) {
return x.modPowInt(this.e, this.n);
}
-// Return the PKCS#1 RSA encryption of "text" as an even-length hex string
+/**
+ * Return the PKCS#1 RSA encryption of "text" as an even-length hex string
+ */
function RSAEncrypt(text) {
var m = pkcs1pad2(text,(this.n.bitLength()+7)>>3);
if(m == null) return null;