1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
3 * LibTomCrypt is a library that provides various cryptographic
4 * algorithms in a highly modular and flexible manner.
6 * The library is free for all purposes without any express
13 LRW_MODE implementation, Encrypt blocks, Tom St Denis
20 @param pt The plaintext
21 @param ct [out] The ciphertext
22 @param len The length in octets, must be a multiple of 16
23 @param lrw The LRW state
25 int lrw_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, symmetric_LRW *lrw)
29 LTC_ARGCHK(pt != NULL);
30 LTC_ARGCHK(ct != NULL);
31 LTC_ARGCHK(lrw != NULL);
33 if ((err = cipher_is_valid(lrw->cipher)) != CRYPT_OK) {
37 if (cipher_descriptor[lrw->cipher].accel_lrw_encrypt != NULL) {
38 return cipher_descriptor[lrw->cipher].accel_lrw_encrypt(pt, ct, len, lrw->IV, lrw->tweak, &lrw->key);
41 return lrw_process(pt, ct, len, LRW_ENCRYPT, lrw);
46 /* ref: $Format:%D$ */
47 /* git commit: $Format:%H$ */
48 /* commit time: $Format:%ai$ */