*
*/
-#include "silcincludes.h"
+#include "silc.h"
+#include "rc5_internal.h"
#include "rc5.h"
/*
/* Sets the key for the cipher. */
-SILC_CIPHER_API_SET_KEY(aes)
+SILC_CIPHER_API_SET_KEY(rc5)
{
- uint32 k[8];
+ SilcUInt32 k[8];
SILC_GET_WORD_KEY(key, k, keylen);
rc5_set_key((RC5Context *)context, k, keylen);
/* Sets the string as a new key for the cipher. The string is first
hashed and then used as a new key. */
-SILC_CIPHER_API_SET_KEY_WITH_STRING(aes)
+SILC_CIPHER_API_SET_KEY_WITH_STRING(rc5)
{
- /* unsigned char key[md5_hash_len];
- SilcMarsContext *ctx = (SilcMarsContext *)context;
-
- make_md5_hash(string, &key);
- memcpy(&ctx->key, mars_set_key(&key, keylen), keylen);
- memset(&key, 'F', sizeoof(key));
- */
-
return 1;
}
/* Returns the size of the cipher context. */
-SILC_CIPHER_API_CONTEXT_LEN(aes)
+SILC_CIPHER_API_CONTEXT_LEN(rc5)
{
return sizeof(RC5Context);
}
/* Encrypts with the cipher in CBC mode. Source and destination buffers
maybe one and same. */
-SILC_CIPHER_API_ENCRYPT_CBC(aes)
+SILC_CIPHER_API_ENCRYPT_CBC(rc5)
{
- uint32 tiv[4];
+ SilcUInt32 tiv[4];
int i;
SILC_CBC_GET_IV(tiv, iv);
/* Decrypts with the cipher in CBC mode. Source and destination buffers
maybe one and same. */
-SILC_CIPHER_API_DECRYPT_CBC(aes)
+SILC_CIPHER_API_DECRYPT_CBC(rc5)
{
- uint32 tmp[4], tmp2[4], tiv[4];
+ SilcUInt32 tmp[4], tmp2[4], tiv[4];
int i;
SILC_CBC_GET_IV(tiv, iv);
/* Sets RC5 key */
-int rc5_set_key(RC5Context *ctx, const uint32 in_key[], int key_len)
+int rc5_set_key(RC5Context *ctx, const SilcUInt32 in_key[], int key_len)
{
u32 i, j, k, A, B, L[c];
u32 *out_key = ctx->out_key;