Polly 22.0.0git
rsamath.h File Reference
#include "imath.h"

Go to the source code of this file.

Typedefs

typedef void(* random_f) (unsigned char *, int)

Functions

mp_result rsa_i2osp (mp_int z, unsigned char *out, int len)
mp_result rsa_os2ip (mp_int z, unsigned char *in, int len)
mp_result rsa_rsaep (mp_int msg, mp_int exp, mp_int mod, mp_int cipher)
mp_result rsa_rsadp (mp_int cipher, mp_int exp, mp_int mod, mp_int msg)
mp_result rsa_rsasp (mp_int msg, mp_int exp, mp_int mod, mp_int signature)
mp_result rsa_rsavp (mp_int signature, mp_int exp, mp_int mod, mp_int msg)
int rsa_max_message_len (mp_int mod)
mp_result rsa_pkcs1v15_encode (unsigned char *buf, int msg_len, int buf_len, int tag, random_f filler)
mp_result rsa_pkcs1v15_decode (unsigned char *buf, int buf_len, int tag, int *msg_len)

Typedef Documentation

◆ random_f

typedef void(* random_f) (unsigned char *, int)

Definition at line 37 of file rsamath.h.

Function Documentation

◆ rsa_i2osp()

mp_result rsa_i2osp ( mp_int z,
unsigned char * out,
int len )

Definition at line 36 of file rsamath.c.

References mp_int_binary_len, mp_int_to_binary, MP_OK, and MP_RANGE.

◆ rsa_max_message_len()

int rsa_max_message_len ( mp_int mod)

Definition at line 76 of file rsamath.c.

References mp_int_count_bits.

◆ rsa_os2ip()

mp_result rsa_os2ip ( mp_int z,
unsigned char * in,
int len )

Definition at line 50 of file rsamath.c.

References mp_int_read_binary.

◆ rsa_pkcs1v15_decode()

mp_result rsa_pkcs1v15_decode ( unsigned char * buf,
int buf_len,
int tag,
int * msg_len )

Definition at line 114 of file rsamath.c.

References MP_OK, MP_UNDEF, and tag().

Referenced by main().

◆ rsa_pkcs1v15_encode()

mp_result rsa_pkcs1v15_encode ( unsigned char * buf,
int msg_len,
int buf_len,
int tag,
random_f filler )

Definition at line 87 of file rsamath.c.

References MP_OK, MP_RANGE, and tag().

Referenced by main().

◆ rsa_rsadp()

mp_result rsa_rsadp ( mp_int cipher,
mp_int exp,
mp_int mod,
mp_int msg )

Definition at line 60 of file rsamath.c.

References s_rsa_transform().

◆ rsa_rsaep()

mp_result rsa_rsaep ( mp_int msg,
mp_int exp,
mp_int mod,
mp_int cipher )

Definition at line 55 of file rsamath.c.

References s_rsa_transform().

◆ rsa_rsasp()

mp_result rsa_rsasp ( mp_int msg,
mp_int exp,
mp_int mod,
mp_int signature )

Definition at line 65 of file rsamath.c.

References s_rsa_transform().

◆ rsa_rsavp()

mp_result rsa_rsavp ( mp_int signature,
mp_int exp,
mp_int mod,
mp_int msg )

Definition at line 70 of file rsamath.c.

References s_rsa_transform().