*/
#include "replace.h"
+#include "aes.h"
+#ifdef SAMBA_RIJNDAEL
#include "rijndael-alg-fst.h"
-#include "aes.h"
int
AES_set_encrypt_key(const unsigned char *userkey, const int bits, AES_KEY *key)
{
rijndaelDecrypt(key->key, key->rounds, in, out);
}
+#endif /* SAMBA_RIJNDAEL */
+#ifdef SAMBA_AES_CBC_ENCRYPT
void
AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
unsigned long size, const AES_KEY *key,
}
}
}
+#endif /* SAMBA_AES_CBC_ENCRYPT */
+#ifdef SAMBA_AES_CFB8_ENCRYPT
void
AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
unsigned long size, const AES_KEY *key,
memcpy(iv, &tmp[1], AES_BLOCK_SIZE);
}
}
+#endif /* SAMBA_AES_CFB8_ENCRYPT */
#ifndef LIB_CRYPTO_AES_H
#define LIB_CRYPTO_AES_H 1
+#define SAMBA_RIJNDAEL 1
+#define SAMBA_AES_CBC_ENCRYPT 1
+#define SAMBA_AES_CFB8_ENCRYPT 1
+#define SAMBA_AES_BLOCK_XOR 1
+
/* symbol renaming */
#define AES_set_encrypt_key samba_AES_set_encrypt_key
#define AES_set_decrypt_key samba_AES_decrypt_key
}
#endif
+#ifdef SAMBA_AES_BLOCK_XOR
static inline void aes_block_xor(const uint8_t in1[AES_BLOCK_SIZE],
const uint8_t in2[AES_BLOCK_SIZE],
uint8_t out[AES_BLOCK_SIZE])
memcpy(out, o, AES_BLOCK_SIZE);
}
}
+#endif /* SAMBA_AES_BLOCK_XOR */
static inline void aes_block_lshift(const uint8_t in[AES_BLOCK_SIZE],
uint8_t out[AES_BLOCK_SIZE])