Gridarta Editor
|
Public Member Functions | |
void | decrypt (final byte @NotNull[] ciphertext, final byte @NotNull[] plaintext) |
void | encrypt (final byte @NotNull[] plaintext, final byte @NotNull[] ciphertext) |
Xtea (final byte @NotNull[] key) | |
Static Private Member Functions | |
static int | getInt (final byte @NotNull[] data, final int offset) |
static void | putInt (final int value, final byte @NotNull[] data, final int offset) |
Private Attributes | |
final int[] | k = new int[4] |
Static Private Attributes | |
static final int | DELTA = 0x9E3779B9 |
static final int | NUM_ROUNDS = 32 |
net.sf.gridarta.utils.Xtea.Xtea | ( | final byte @NotNull[] | key | ) |
Creates a new instance.
key | the key to use; must be 16 bytes |
Definition at line 49 of file Xtea.java.
References net.sf.gridarta.utils.Xtea.getInt(), and net.sf.gridarta.utils.Xtea.k.
void net.sf.gridarta.utils.Xtea.decrypt | ( | final byte @NotNull[] | ciphertext, |
final byte @NotNull[] | plaintext | ||
) |
Decrypts a data block.
ciphertext | the block to decrypt; must be 8 bytes |
plaintext | the decrypted block; must be 8 bytes |
Definition at line 89 of file Xtea.java.
References net.sf.gridarta.utils.Xtea.DELTA, net.sf.gridarta.utils.Xtea.getInt(), net.sf.gridarta.utils.Xtea.k, net.sf.gridarta.utils.Xtea.NUM_ROUNDS, and net.sf.gridarta.utils.Xtea.putInt().
Referenced by net.sf.gridarta.utils.XteaTest.test().
void net.sf.gridarta.utils.Xtea.encrypt | ( | final byte @NotNull[] | plaintext, |
final byte @NotNull[] | ciphertext | ||
) |
Encrypts a data block.
plaintext | the block to encrypt; must be 8 bytes |
ciphertext | the encrypted block; must be 8 bytes |
Definition at line 65 of file Xtea.java.
References net.sf.gridarta.utils.Xtea.DELTA, net.sf.gridarta.utils.Xtea.getInt(), net.sf.gridarta.utils.Xtea.k, net.sf.gridarta.utils.Xtea.NUM_ROUNDS, and net.sf.gridarta.utils.Xtea.putInt().
Referenced by net.sf.gridarta.model.index.MapsIndexer< G, A, R >.getCacheFile(), and net.sf.gridarta.utils.XteaTest.test().
|
staticprivate |
Converts 4 data bytes to an
.
data | the data array |
offset | the starting offset into data
|
Definition at line 115 of file Xtea.java.
Referenced by net.sf.gridarta.utils.Xtea.decrypt(), net.sf.gridarta.utils.Xtea.encrypt(), and net.sf.gridarta.utils.Xtea.Xtea().
|
staticprivate |
Converts an
value into 4 data bytes.
value | the int
|
data | the data array |
offset | the starting offset into data
|
Definition at line 125 of file Xtea.java.
Referenced by net.sf.gridarta.utils.Xtea.decrypt(), and net.sf.gridarta.utils.Xtea.encrypt().
|
staticprivate |
The magic constant (1<<32)/PHI.
Definition at line 38 of file Xtea.java.
Referenced by net.sf.gridarta.utils.Xtea.decrypt(), and net.sf.gridarta.utils.Xtea.encrypt().
|
private |
The state.
Definition at line 43 of file Xtea.java.
Referenced by net.sf.gridarta.utils.Xtea.decrypt(), net.sf.gridarta.utils.Xtea.encrypt(), and net.sf.gridarta.utils.Xtea.Xtea().
|
staticprivate |
The number of rounds.
Definition at line 33 of file Xtea.java.
Referenced by net.sf.gridarta.utils.Xtea.decrypt(), and net.sf.gridarta.utils.Xtea.encrypt().