|
| void | _encrypt2 (void) |
| void | _encrypt (void) |
| void | _decrypt (void) |
| void | _decrypt2 (void) |
| void | _getwheel (void) |
| static ULONG | encrypt_c (UBYTE *p, ULONG len, UWORD wheel1, UWORD wheel2, UWORD wheel3) |
| | Encrypt memadr,length,wheel1,wheel2,wheel3: encrypts a block in place with the three-wheel cipher.
|
| static UBYTE | rndwheel (ULONG range) |
| static ULONG | encrypt2_c (UBYTE *p, ULONG len) |
| | Encrypt memadr,length: as above with random start wheels (vallib Rnd); GetWheel tells the state after it.
|
| static ULONG | decrypt_c (UBYTE *base, ULONG len, UWORD wheel1, UWORD wheel2, UWORD wheel3) |
| | Decrypt memadr,length,wheel1,wheel2,wheel3: decrypts a block in place, from the end backwards.
|
| static ULONG | decrypt2_c (UBYTE *p, ULONG len, UWORD wheel1, UWORD wheel2, UWORD wheel3, UWORD mode) |
| | Decrypt memadr,length,wheel1,wheel2,wheel3,mode: as above; mode 1 starts from the wheels Encrypt started with.
|
| static ULONG | getwheel_c (UWORD n) |
| | GetWheel(wheel#): a wheel after the last Encrypt/Decrypt.
|
| ULONG decrypt2_c |
( |
UBYTE * | p, |
|
|
ULONG | len, |
|
|
UWORD | wheel1, |
|
|
UWORD | wheel2, |
|
|
UWORD | wheel3, |
|
|
UWORD | mode ) |
|
static |
Decrypt memadr,length,wheel1,wheel2,wheel3,mode: as above; mode 1 starts from the wheels Encrypt started with.
Mode 1 (the low byte, CMPI.b) adds the length to the wheels first, as the 24-bit number w3:w2:w1 the odometer of Encrypt counts (Fixed (#629): the original added the length's bytes 0..2 to the wheels each without the carry into the next one, so the state could be one step off).
- Parameters
-
| p | d0: memadr |
| len | d1: length |
| wheel1 | d2: wheel 1 |
| wheel2 | d3: wheel 2 |
| wheel3 | d4: wheel 3 |
| mode | d5: 1 = the start wheels, else as Decrypt above |
- Returns
- d0: memadr with the last byte written in its low byte
| ULONG decrypt_c |
( |
UBYTE * | base, |
|
|
ULONG | len, |
|
|
UWORD | wheel1, |
|
|
UWORD | wheel2, |
|
|
UWORD | wheel3 ) |
|
static |
Decrypt memadr,length,wheel1,wheel2,wheel3: decrypts a block in place, from the end backwards.
The wheels are those Encrypt left (GetWheel); each byte loses w1 + w2 + w3, then the wheels step back. The last state is kept for GetWheel. A length of 0 (or one of 2^31 and above) does nothing (Fixed (#630): the original processed one byte, the one at memadr-1).
- Parameters
-
| base | d0: memadr |
| len | d1: length |
| wheel1 | d2: wheel 1 (its low byte) |
| wheel2 | d3: wheel 2 |
| wheel3 | d4: wheel 3 |
- Returns
- d0: memadr with the last byte written in its low byte (memadr when nothing is processed)
| ULONG encrypt_c |
( |
UBYTE * | p, |
|
|
ULONG | len, |
|
|
UWORD | wheel1, |
|
|
UWORD | wheel2, |
|
|
UWORD | wheel3 ) |
|
static |
Encrypt memadr,length,wheel1,wheel2,wheel3: encrypts a block in place with the three-wheel cipher.
Every byte b becomes b + w1 + w2 + w3, the wheels stepped before each byte like an odometer (w1 + 1, on its carry w2 + 1, on that w3 + 1); the last state is kept for GetWheel. A length of 0 (or one of 2^31 and above) does nothing (Fixed (#630): the original processed one byte).
- Parameters
-
| p | d0: memadr |
| len | d1: length |
| wheel1 | d2: the start of wheel 1 (its low byte, ANDI.l $ff) |
| wheel2 | d3: the start of wheel 2 |
| wheel3 | d4: the start of wheel 3 |
- Returns
- d0: memadr with the last byte written in its low byte (memadr when nothing is processed)