From ffbfd33359e1e5a5241bed64af60f01fd4c0de0f Mon Sep 17 00:00:00 2001 From: siddharth ravikumar Date: Sat, 12 Nov 2022 02:13:43 -0500 Subject: lib: rsa: RSAPub: add N method Returns `n`. --- lib/rsa.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') 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) -- cgit v1.2.3