Documentation ¶
Index ¶
- Constants
- func Comp(a *BIG, b *BIG) int
- func New_private_key(n int) *rsa_private_key
- func New_public_key(m int) *rsa_public_key
- func RSA_DECRYPT(PRIV *rsa_private_key, G []byte, F []byte)
- func RSA_ENCRYPT(PUB *rsa_public_key, F []byte, G []byte)
- func RSA_KEY_PAIR(rng *core.RAND, e int, PRIV *rsa_private_key, PUB *rsa_public_key)
- func RSA_KEY_PAIR_FROM_OPENSSL(e int, P []byte, Q []byte, DP []byte, DQ []byte, C []byte, ...)
- func RSA_PRIVATE_KEY_FROM_OPENSSL(P []byte, Q []byte, DP []byte, DQ []byte, C []byte, PRIV *rsa_private_key)
- func RSA_PRIVATE_KEY_KILL(PRIV *rsa_private_key)
- type BIG
- func FromBytes(b []byte) *BIG
- func Modadd(a1, b1, m *BIG) *BIG
- func Modmul(a1, b1, m *BIG) *BIG
- func Modneg(a1, m *BIG) *BIG
- func Modsqr(a1, m *BIG) *BIG
- func NewBIG() *BIG
- func NewBIGcopy(x *BIG) *BIG
- func NewBIGdcopy(x *DBIG) *BIG
- func NewBIGint(x int) *BIG
- func NewBIGints(x [NLEN]Chunk) *BIG
- func Random(rng *core.RAND) *BIG
- func Randomnum(q *BIG, rng *core.RAND) *BIG
- func Randtrunc(q *BIG, trunc int, rng *core.RAND) *BIG
- type Chunk
- type DBIG
- type FF
Constants ¶
View Source
const BASEBITS uint = 56
View Source
const BIGBITS int = int(MODBYTES * 8)
View Source
const CHUNK int = 64 /* Set word size */
View Source
const DNLEN int = 2 * NLEN
View Source
const FFLEN int = 8
Modulus as number of BIGs
View Source
const FF_BITS int = (BIGBITS * FFLEN) /* Finite Field Size in bits - must be 256.2^n */
Modulus length in bits
View Source
const HBITS uint = (BASEBITS / 2)
View Source
const HFLEN int = (FFLEN / 2) /* Useful for half-size RSA private key operations */
View Source
const MODBYTES uint = 48
BIG length in bytes and number base
View Source
const NEXCESS int = (1 << (uint(CHUNK) - BASEBITS - 1))
View Source
const NLEN int = int((1 + ((8*MODBYTES - 1) / BASEBITS)))
BIG lengths and Masks
View Source
const P_MBITS uint = MODBYTES * 8
View Source
const P_TBITS uint = (P_MBITS % BASEBITS)
View Source
const RFS int = int(MODBYTES) * FFLEN
View Source
const RSA_HASH_TYPE int = core.SHA256
Variables ¶
This section is empty.
Functions ¶
func New_private_key ¶
func New_private_key(n int) *rsa_private_key
func New_public_key ¶
func New_public_key(m int) *rsa_public_key
func RSA_DECRYPT ¶
RSA decryption with the private key
func RSA_ENCRYPT ¶
RSA encryption with the public key
func RSA_KEY_PAIR ¶
func RSA_PRIVATE_KEY_FROM_OPENSSL ¶
func RSA_PRIVATE_KEY_FROM_OPENSSL(P []byte, Q []byte, DP []byte, DQ []byte, C []byte, PRIV *rsa_private_key)
Input private key from OpenSSL format e.g as in openssl rsa -in privkey.pem -noout -text Note order swap - For MIRACL c=1/p mod q, for OpenSSL c=1/q mod p
func RSA_PRIVATE_KEY_KILL ¶
func RSA_PRIVATE_KEY_KILL(PRIV *rsa_private_key)
destroy the Private Key structure
Types ¶
type BIG ¶
type BIG struct {
// contains filtered or unexported fields
}
func NewBIGcopy ¶
func NewBIGdcopy ¶
func NewBIGints ¶
type DBIG ¶
type DBIG struct {
// contains filtered or unexported fields
}
func NewDBIGcopy ¶
func NewDBIGscopy ¶
Click to show internal directories.
Click to hide internal directories.