ROOT  6.06/09
Reference Guide
Functions | Variables
rsaaux.cxx File Reference
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/time.h>
#include "rsaaux.h"
#include "rsalib.h"
+ Include dependency graph for rsaaux.cxx:

Go to the source code of this file.

Functions

static int aux_rand ()
 rand() implementation using /udev/random or /dev/random, if available More...
 
int n_cmp (rsa_INT *i1, rsa_INT *i2, int l)
 
int a_cmp (rsa_NUMBER *c1, rsa_NUMBER *c2)
 
void a_assign (rsa_NUMBER *d, rsa_NUMBER *s)
 
void a_add (rsa_NUMBER *s1, rsa_NUMBER *s2, rsa_NUMBER *d)
 
int n_sub (rsa_INT *p1, rsa_INT *p2, rsa_INT *p3, int l, int lo)
 
void a_sub (rsa_NUMBER *s1, rsa_NUMBER *s2, rsa_NUMBER *d)
 
int n_mult (rsa_INT *n, rsa_INT m, rsa_INT *d, int l)
 
void a_imult (rsa_NUMBER *n, rsa_INT m, rsa_NUMBER *d)
 
void a_mult (rsa_NUMBER *m1, rsa_NUMBER *m2, rsa_NUMBER *d)
 
void n_div (rsa_NUMBER *d1, rsa_NUMBER *z2, rsa_NUMBER *q, rsa_NUMBER *r)
 
void a_div (rsa_NUMBER *d1, rsa_NUMBER *d2, rsa_NUMBER *q, rsa_NUMBER *r)
 
void a_div2 (rsa_NUMBER *n)
 
void m_init (rsa_NUMBER *n, rsa_NUMBER *o)
 
void m_add (rsa_NUMBER *s1, rsa_NUMBER *s2, rsa_NUMBER *d)
 
void m_mult (rsa_NUMBER *m1, rsa_NUMBER *m2, rsa_NUMBER *d)
 
void m_exp (rsa_NUMBER *x, rsa_NUMBER *n, rsa_NUMBER *z)
 
void a_ggt (rsa_NUMBER *a, rsa_NUMBER *b, rsa_NUMBER *f)
 
int n_bits (rsa_NUMBER *n, int b)
 
int n_bitlen (rsa_NUMBER *n)
 
static int jak_f (rsa_NUMBER *)
 
static int jak_g (rsa_NUMBER *, rsa_NUMBER *)
 
static int jakobi (rsa_NUMBER *, rsa_NUMBER *)
 
int p_prim (rsa_NUMBER *n, int m)
 
void inv (rsa_NUMBER *d, rsa_NUMBER *phi, rsa_NUMBER *e)
 
void gen_number (int len, rsa_NUMBER *n)
 
void init_rnd ()
 
void do_crypt (char *s, char *d, int len, rsa_NUMBER *e)
 

Variables

rsa_NUMBER a_one
 
rsa_NUMBER a_two
 
static rsa_NUMBER g_mod_z2 [rsa_MAXBIT]
 

Function Documentation

void a_add ( rsa_NUMBER s1,
rsa_NUMBER s2,
rsa_NUMBER d 
)

Definition at line 263 of file rsaaux.cxx.

Referenced by m_add(), num_init(), rsa_genprim(), and rsa_num_sget().

void a_assign ( rsa_NUMBER d,
rsa_NUMBER s 
)
int a_cmp ( rsa_NUMBER c1,
rsa_NUMBER c2 
)

Definition at line 233 of file rsaaux.cxx.

Referenced by a_ggt(), inv(), jakobi(), m_add(), m_init(), n_bitlen(), p_prim(), rsa_genrsa(), and rsa_num_sput().

void a_div ( rsa_NUMBER d1,
rsa_NUMBER d2,
rsa_NUMBER q,
rsa_NUMBER r 
)

Definition at line 540 of file rsaaux.cxx.

Referenced by a_div2(), a_ggt(), inv(), jakobi(), and rsa_num_sput().

void a_div2 ( rsa_NUMBER n)

Definition at line 560 of file rsaaux.cxx.

Referenced by jakobi(), m_exp(), and p_prim().

void a_ggt ( rsa_NUMBER a,
rsa_NUMBER b,
rsa_NUMBER f 
)

Definition at line 668 of file rsaaux.cxx.

Referenced by p_prim(), and rsa_genrsa().

void a_imult ( rsa_NUMBER n,
rsa_INT  m,
rsa_NUMBER d 
)

Definition at line 401 of file rsaaux.cxx.

Referenced by a_div(), and m_init().

void a_mult ( rsa_NUMBER m1,
rsa_NUMBER m2,
rsa_NUMBER d 
)

Definition at line 414 of file rsaaux.cxx.

Referenced by m_mult(), n_bitlen(), rsa_genprim(), rsa_genrsa(), and rsa_num_sget().

void a_sub ( rsa_NUMBER s1,
rsa_NUMBER s2,
rsa_NUMBER d 
)

Definition at line 369 of file rsaaux.cxx.

Referenced by inv(), m_add(), m_exp(), p_prim(), rsa_genrsa(), and rsa_num_sput().

static int aux_rand ( )
static

rand() implementation using /udev/random or /dev/random, if available

Definition at line 167 of file rsaaux.cxx.

Referenced by gen_number(), and p_prim().

void do_crypt ( char *  s,
char *  d,
int  len,
rsa_NUMBER e 
)

Definition at line 1092 of file rsaaux.cxx.

Referenced by rsa_decode(), and rsa_encode().

void gen_number ( int  len,
rsa_NUMBER n 
)

Definition at line 994 of file rsaaux.cxx.

Referenced by rsa_genprim(), and rsa_genrsa().

void init_rnd ( void  )

Definition at line 1016 of file rsaaux.cxx.

void inv ( rsa_NUMBER d,
rsa_NUMBER phi,
rsa_NUMBER e 
)

Definition at line 949 of file rsaaux.cxx.

static int jak_f ( rsa_NUMBER n)
static

Definition at line 797 of file rsaaux.cxx.

Referenced by jakobi().

static int jak_g ( rsa_NUMBER a,
rsa_NUMBER n 
)
static

Definition at line 811 of file rsaaux.cxx.

Referenced by jakobi().

static int jakobi ( rsa_NUMBER a,
rsa_NUMBER n 
)
static

Definition at line 827 of file rsaaux.cxx.

Referenced by p_prim().

void m_add ( rsa_NUMBER s1,
rsa_NUMBER s2,
rsa_NUMBER d 
)

Definition at line 631 of file rsaaux.cxx.

Referenced by inv().

void m_exp ( rsa_NUMBER x,
rsa_NUMBER n,
rsa_NUMBER z 
)

Definition at line 647 of file rsaaux.cxx.

Referenced by do_crypt(), and p_prim().

void m_init ( rsa_NUMBER n,
rsa_NUMBER o 
)

Definition at line 616 of file rsaaux.cxx.

Referenced by inv(), p_prim(), rsa_decode(), and rsa_encode().

void m_mult ( rsa_NUMBER m1,
rsa_NUMBER m2,
rsa_NUMBER d 
)

Definition at line 638 of file rsaaux.cxx.

Referenced by inv(), and m_exp().

int n_bitlen ( rsa_NUMBER n)

Definition at line 721 of file rsaaux.cxx.

Referenced by rsa_decode(), rsa_encode(), rsa_encode_size(), and rsa_genrsa().

int n_bits ( rsa_NUMBER n,
int  b 
)

Definition at line 692 of file rsaaux.cxx.

Referenced by jak_f(), and jak_g().

int n_cmp ( rsa_INT i1,
rsa_INT i2,
int  l 
)

Definition at line 218 of file rsaaux.cxx.

Referenced by a_cmp(), n_div(), and rsa_cmp().

void n_div ( rsa_NUMBER d1,
rsa_NUMBER z2,
rsa_NUMBER q,
rsa_NUMBER r 
)

Definition at line 464 of file rsaaux.cxx.

Referenced by a_div(), and m_mult().

int n_mult ( rsa_INT n,
rsa_INT  m,
rsa_INT d,
int  l 
)

Definition at line 379 of file rsaaux.cxx.

Referenced by a_imult().

int n_sub ( rsa_INT p1,
rsa_INT p2,
rsa_INT p3,
int  l,
int  lo 
)

Definition at line 323 of file rsaaux.cxx.

Referenced by a_sub(), and n_div().

int p_prim ( rsa_NUMBER n,
int  m 
)

Definition at line 884 of file rsaaux.cxx.

Referenced by rsa_genprim().

Variable Documentation

rsa_NUMBER a_one
Initial value:
= {
1,
{ (rsa_INT)1, },
}
unsigned short rsa_INT
Definition: rsadef.h:37

Definition at line 199 of file rsaaux.cxx.

Referenced by num_init(), rsa_genprim(), and rsa_genrsa().

rsa_NUMBER a_two
Initial value:
= {
1,
{ (rsa_INT)2, },
}
unsigned short rsa_INT
Definition: rsadef.h:37

Definition at line 204 of file rsaaux.cxx.

Referenced by rsa_genprim().

rsa_NUMBER g_mod_z2[rsa_MAXBIT]
static

Definition at line 611 of file rsaaux.cxx.