|
JubeatPlus 3.9.11
|
A Blowfish cipher that works in place on an NSMutableData.
More...
#include <BFCodec.h>


Instance Methods | |
| (instancetype) | - init |
| Builds a codec with a zeroed chaining vector and a fresh key schedule. | |
| (void) | - cipherInit:length: |
| Sets the key from a raw buffer, and resets the chaining vector to its fixed value. | |
| (void) | - cipherInit: |
| Sets the key from a data buffer. | |
| (unsigned int) | - encipher: |
| Encrypts a buffer in place, growing it to hold the padding and a length trailer. | |
| (BOOL) | - decipher: |
| Decrypts a buffer in place. | |
| (void) | - dealloc |
| Wipes the chaining vector and releases the key schedule. | |
A Blowfish cipher that works in place on an NSMutableData.
| - (void) cipherInit: | (nullable NSData *) | key |
Sets the key from a data buffer.
Callers pass a 16-byte MD5 digest. A nil key returns without touching anything, so the codec keeps whatever key it had.
| key | The key material. |
| - (void) cipherInit: | (const char *) | key | |
| length: | (int) | length |
Sets the key from a raw buffer, and resets the chaining vector to its fixed value.
The vector is not derived from the key or from anything else — it is eight bytes written literally into the ivar. See TYPES_PENDING.md.
| key | The key material. |
| length | The key's length in bytes. |
| - (void) dealloc |
Wipes the chaining vector and releases the key schedule.
| - (BOOL) decipher: | (nullable NSMutableData *) | data |
Decrypts a buffer in place.
Both of the trailer's words are checked before anything is decrypted, and the buffer is truncated back to the plaintext afterwards. The return type is BOOL rather than the void this header previously claimed, from the metadata encoding B24@0:8@16 .
| data | The buffer to decrypt, modified in place. |
| - (unsigned int) encipher: | (nullable NSMutableData *) | data |
Encrypts a buffer in place, growing it to hold the padding and a length trailer.
The buffer is resized to (length + 15) & ~7 : the plaintext rounded up to a block boundary, plus one more block holding the original length. Chaining is CBC from the fixed vector.
| data | The buffer to encrypt, modified in place. |
| - (instancetype) init |
Builds a codec with a zeroed chaining vector and a fresh key schedule.