Hlavní stránka | Seznam prostorů jmen | Seznam tříd | Adresáře | Seznam souborů | Seznam členů tříd | Symboly v souborech

Dokumentace šablony třídy cLgNr_le< LENGTH >

#include <struct.h>

Seznam všech členů.

Veřejné metody

int length ()
void clear ()
 cLgNr_le ()
 cLgNr_le (cLgNr_le< LENGTH > &a)
 cLgNr_le (unsigned int buf[LENGTH/UINT_LENGTH])
 cLgNr_le (uint_32 a)
int first_set ()
void set (int i)
unsigned int & operator[] (int i)
bool operator() (int i)
void operator= (cLgNr_le< LENGTH/2 > &a)
void operator<<= (int i)
void operator>>= (int i)
void shr ()
void operator+= (cLgNr_le< LENGTH > &b)
void operator-= (cLgNr_le< LENGTH > &b)
void minus_one ()
cLgNr_le< 2 *LENGTH > operator * (cLgNr_le< LENGTH > &b)
bool operator> (cLgNr_le< LENGTH > &b)
bool operator>= (cLgNr_le< LENGTH > &b)
cLgNr_le< LENGTH > operator/ (cLgNr_le< LENGTH > &b)
cLgNr_le< LENGTH/2 > operator% (cLgNr_le< LENGTH/2 > &b_)
cLgNr_le< LENGTH > operator% (cLgNr_le< LENGTH > b)
void sqrmod (cLgNr_le &moduler)
cLgNr_le< LENGTH/2 > operator% (int b_)
void random (int poz)
bool is_nul ()
bool is_one ()


Detailní popis

template<int LENGTH>
class cLgNr_le< LENGTH >

klíčová struktura, odehrává se v ní celá aritmetika obecne dlouhe cislo delky length LENGTH udava delku v bitech


Dokumentace konstruktoru a destruktoru

template<int LENGTH>
cLgNr_le< LENGTH >::cLgNr_le  )  [inline]
 

template<int LENGTH>
cLgNr_le< LENGTH >::cLgNr_le cLgNr_le< LENGTH > &  a  )  [inline]
 

copy konstruktor

template<int LENGTH>
cLgNr_le< LENGTH >::cLgNr_le unsigned int  buf[LENGTH/UINT_LENGTH]  )  [inline]
 

konstruktor z bufferu je vhodný, pokud bzchom chtěli kódovat opakovaně větší bloky dat, třeba kódovat celý soubor asymetricky

template<int LENGTH>
cLgNr_le< LENGTH >::cLgNr_le uint_32  a  )  [inline]
 

konstruktor z uint_32


Dokumentace k metodám

template<int LENGTH>
void cLgNr_le< LENGTH >::clear  )  [inline]
 

nastaví všehny bity čísla na nulu

template<int LENGTH>
int cLgNr_le< LENGTH >::first_set  )  [inline]
 

vraci pozici prvniho bitu s hodnotou 1 (nahozen)

template<int LENGTH>
bool cLgNr_le< LENGTH >::is_nul  )  [inline]
 

vrací true, pokud je číslo nulové, jinak false

template<int LENGTH>
bool cLgNr_le< LENGTH >::is_one  )  [inline]
 

template<int LENGTH>
int cLgNr_le< LENGTH >::length  )  [inline]
 

vrací délku čísla

template<int LENGTH>
void cLgNr_le< LENGTH >::minus_one  )  [inline]
 

pro urceni prvociselnosti je treba pocitat z cisla generovaneho tak, aby melo posledni bit nahozeny cislo o jednu mensi ma tedy rozdílný pouze poslední bit, to je blbost delat odcitanim. pokud z nějakého důvodu není posleední bit nahozen volá operátor -=()

template<int LENGTH>
cLgNr_le<2*LENGTH> cLgNr_le< LENGTH >::operator * cLgNr_le< LENGTH > &  b  )  [inline]
 

template<int LENGTH>
cLgNr_le<LENGTH /2> cLgNr_le< LENGTH >::operator% int  b_  )  [inline]
 

pozor, vraci čílo poloviční délky!!!

template<int LENGTH>
cLgNr_le<LENGTH> cLgNr_le< LENGTH >::operator% cLgNr_le< LENGTH >  b  )  [inline]
 

vrací číslo stejné délky

template<int LENGTH>
cLgNr_le<LENGTH /2> cLgNr_le< LENGTH >::operator% cLgNr_le< LENGTH/2 > &  b_  )  [inline]
 

pozor, vraci cislo polovicnidelky!!!

template<int LENGTH>
bool cLgNr_le< LENGTH >::operator() int  i  )  [inline]
 

pro cteni hodnoty i-teho bitu

template<int LENGTH>
void cLgNr_le< LENGTH >::operator+= cLgNr_le< LENGTH > &  b  )  [inline]
 

template<int LENGTH>
void cLgNr_le< LENGTH >::operator-= cLgNr_le< LENGTH > &  b  )  [inline]
 

template<int LENGTH>
cLgNr_le<LENGTH> cLgNr_le< LENGTH >::operator/ cLgNr_le< LENGTH > &  b  )  [inline]
 

template<int LENGTH>
void cLgNr_le< LENGTH >::operator<<= int  i  )  [inline]
 

template<int LENGTH>
void cLgNr_le< LENGTH >::operator= cLgNr_le< LENGTH/2 > &  a  )  [inline]
 

template<int LENGTH>
bool cLgNr_le< LENGTH >::operator> cLgNr_le< LENGTH > &  b  )  [inline]
 

template<int LENGTH>
bool cLgNr_le< LENGTH >::operator>= cLgNr_le< LENGTH > &  b  )  [inline]
 

template<int LENGTH>
void cLgNr_le< LENGTH >::operator>>= int  i  )  [inline]
 

template<int LENGTH>
unsigned int& cLgNr_le< LENGTH >::operator[] int  i  )  [inline]
 

vraci referenci na i-ty uint_32 ( ne bit!!)

template<int LENGTH>
void cLgNr_le< LENGTH >::random int  poz  )  [inline]
 

do čísla nahrne pseudonahodne hodnoty. první nahozený bit bude na pozici poz predchazejci bity budou nulové. poslední bit bude nahozen, aby číslo nebylo dělitelné dvěma

template<int LENGTH>
void cLgNr_le< LENGTH >::set int  i  )  [inline]
 

nahodi i-ty bit cLgNr_le

template<int LENGTH>
void cLgNr_le< LENGTH >::shr  )  [inline]
 

specielni pripad bitoveho posunu o jednu pozici. je častý, proto samostana funkce, která jde implementovat efektivněji;

template<int LENGTH>
void cLgNr_le< LENGTH >::sqrmod cLgNr_le< LENGTH > &  moduler  )  [inline]
 

s číslem provede operaci umocnění nadruhou a modulo moduler


Dokumentace pro tuto třídu byla generována z následujícího souboru:
Generováno Thu Mar 31 19:40:06 2005 pro projekt RSA programem  doxygen 1.4.1