|
Gridarta Editor
|
Implements the XTEA algorithm. More...
Collaboration diagram for net.sf.gridarta.utils.Xtea:Public Member Functions | |
| void | decrypt (@NotNull final byte[] ciphertext, @NotNull final byte[] plaintext) |
| Decrypts a data block. More... | |
| void | encrypt (@NotNull final byte[] plaintext, @NotNull final byte[] ciphertext) |
| Encrypts a data block. More... | |
| Xtea (@NotNull final byte[] key) | |
| Creates a new instance. More... | |
Static Private Member Functions | |
| static int | getInt (@NotNull final byte[] data, final int offset) |
| Converts 4 data bytes to an. More... | |
| static void | putInt (final int value, @NotNull final byte[] data, final int offset) |
| Converts an. More... | |
Private Attributes | |
| final int [] | k = new int[4] |
| The state. More... | |
Static Private Attributes | |
| static final int | DELTA = 0x9E3779B9 |
| The magic constant (1<<32)/PHI. More... | |
| static final int | NUM_ROUNDS = 32 |
| The number of rounds. More... | |
| net.sf.gridarta.utils.Xtea.Xtea | ( | @NotNull final byte [] | key | ) |
Creates a new instance.
| key | the key to use; must be 16 bytes |
Definition at line 50 of file Xtea.java.
References net.sf.gridarta.utils.Xtea.getInt().
Here is the call graph for this function:| void net.sf.gridarta.utils.Xtea.decrypt | ( | @NotNull final byte [] | ciphertext, |
| @NotNull final byte [] | 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 90 of file Xtea.java.
References net.sf.gridarta.utils.Xtea.DELTA, net.sf.gridarta.utils.Xtea.getInt(), net.sf.gridarta.utils.Xtea.NUM_ROUNDS, and net.sf.gridarta.utils.Xtea.putInt().
Referenced by net.sf.gridarta.utils.XteaTest.test().
Here is the call graph for this function:
Here is the caller graph for this function:| void net.sf.gridarta.utils.Xtea.encrypt | ( | @NotNull final byte [] | plaintext, |
| @NotNull final byte [] | 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 66 of file Xtea.java.
References net.sf.gridarta.utils.Xtea.DELTA, net.sf.gridarta.utils.Xtea.getInt(), 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().
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprivate |
Converts 4 data bytes to an.
.
| data | the data array |
| offset | the starting offset into data |
Definition at line 116 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().
Here is the caller graph for this function:
|
staticprivate |
Converts an.
value into 4 data bytes.
| value | the int |
| data | the data array |
| offset | the starting offset into data |
Definition at line 126 of file Xtea.java.
Referenced by net.sf.gridarta.utils.Xtea.decrypt(), and net.sf.gridarta.utils.Xtea.encrypt().
Here is the caller graph for this function:
|
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 |
|
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().