#include <sapphire.h>
|
unsigned char | keyrand (int limit, unsigned char *user_key, unsigned char keysize, unsigned char *rsum, unsigned *keypos) |
|
Definition at line 49 of file sapphire.h.
Sapphire::Sapphire |
( |
unsigned char * |
key = NULL , |
|
|
unsigned char |
keysize = 0 |
|
) |
| |
Definition at line 151 of file sapphire.cpp.
void initialize(unsigned char *key, unsigned char keysize)
void Sapphire::burn |
( |
void |
| ) |
|
unsigned char Sapphire::decrypt |
( |
unsigned char |
b | ) |
|
Definition at line 200 of file sapphire.cpp.
202 unsigned char swaptemp;
unsigned char last_cipher
unsigned char Sapphire::encrypt |
( |
unsigned char |
b = 0 | ) |
|
Definition at line 169 of file sapphire.cpp.
177 unsigned char swaptemp;
unsigned char last_cipher
void Sapphire::hash_final |
( |
unsigned char * |
hash, |
|
|
unsigned char |
hashlength = 20 |
|
) |
| |
Definition at line 225 of file sapphire.cpp.
232 for (i=0;i<hashlength;i++)
unsigned char encrypt(unsigned char b=0)
void Sapphire::hash_init |
( |
void |
| ) |
|
Definition at line 130 of file sapphire.cpp.
147 for (i=0, j=255;i<256;i++,j--)
148 cards[i] = (
unsigned char) j;
unsigned char last_cipher
void Sapphire::initialize |
( |
unsigned char * |
key, |
|
|
unsigned char |
keysize |
|
) |
| |
Definition at line 75 of file sapphire.cpp.
86 unsigned char toswap, swaptemp, rsum;
109 toswap =
keyrand(i, key, keysize, &rsum, &keypos);
112 cards[toswap] = swaptemp;
126 toswap = swaptemp = rsum = 0;
unsigned char last_cipher
unsigned char keyrand(int limit, unsigned char *user_key, unsigned char keysize, unsigned char *rsum, unsigned *keypos)
SWORD_NAMESPACE_START unsigned char Sapphire::keyrand |
( |
int |
limit, |
|
|
unsigned char * |
user_key, |
|
|
unsigned char |
keysize, |
|
|
unsigned char * |
rsum, |
|
|
unsigned * |
keypos |
|
) |
| |
|
private |
Definition at line 44 of file sapphire.cpp.
57 while (mask < (
unsigned)limit)
58 mask = (mask << 1) + 1;
61 *rsum =
cards[*rsum] + user_key[(*keypos)++];
62 if (*keypos >= keysize)
68 if (++retry_limiter > 11)
71 while (u > (
unsigned)limit);
unsigned char Sapphire::avalanche |
|
private |
unsigned char Sapphire::cards[256] |
|
private |
unsigned char Sapphire::last_cipher |
|
private |
unsigned char Sapphire::last_plain |
|
private |
unsigned char Sapphire::ratchet |
|
private |
unsigned char Sapphire::rotor |
|
private |
The documentation for this class was generated from the following files: