summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorsiddharth ravikumar <s@ricketyspace.net>2022-11-12 02:13:43 -0500
committersiddharth ravikumar <s@ricketyspace.net>2022-11-12 02:13:43 -0500
commitffbfd33359e1e5a5241bed64af60f01fd4c0de0f (patch)
treeaa039a2be7e25500c947bd24caef390df3381360 /lib
parentd3e2e49a6b090f26656907b145ac8acebfaa554b (diff)
lib: rsa: RSAPub: add N method
Returns `n`.
Diffstat (limited to 'lib')
-rw-r--r--lib/rsa.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/rsa.go b/lib/rsa.go
index 1a860eb..ae264b8 100644
--- a/lib/rsa.go
+++ b/lib/rsa.go
@@ -138,6 +138,10 @@ func (r *RSAPub) Encrypt(msg []byte) []byte {
return c.Bytes()
}
+func (r *RSAPub) N() *big.Int {
+ return r.n
+}
+
func (r *RSAPrivate) Decrypt(cipher []byte) []byte {
// Convert cipher to big int.
c := big.NewInt(0).SetBytes(cipher)