unsigned long TwoFishDecryptRaw(const char *in, char *out, unsigned long len, TWOFISH *tfdata) { _TwoFish_ResetCBC(tfdata); /* reset CBC flag. */ tfdata->output=(unsigned char*)out; /* output straight into output buffer. */ return _TwoFish_CryptRaw(in,out,len,TRUE,tfdata); /* and go for it. */ }
/* TwoFish Raw Decryption * * Does not use header, but does use CBC (if more than one block has to be decrypted). * * Input: Pointer to the buffer of the ciphertext to be decrypted. * Pointer to the buffer receiving the plaintext. * The length of the ciphertext buffer (at least one cipher block). * The TwoFish structure. * * Output: The amount of bytes decrypted if successful, otherwise 0. */ uint32_t TwoFishDecryptRaw(uint8_t *in, uint8_t *out, uint32_t len, TWOFISH *tfdata) { _TwoFish_ResetCBC(tfdata); /* reset CBC flag. */ tfdata->output = out; /* output straight into output buffer. */ return _TwoFish_CryptRaw(in, out, len, TRUE, tfdata); /* and go for it. */ }