projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added SILC Server library.
[silc.git]
/
lib
/
silccrypt
/
rc5.c
diff --git
a/lib/silccrypt/rc5.c
b/lib/silccrypt/rc5.c
index f74dfd377d9780bdd8ce0362affbecc0b4974fce..dfbe7e4376e23292c2205c43e6fb90740969fb32 100644
(file)
--- a/
lib/silccrypt/rc5.c
+++ b/
lib/silccrypt/rc5.c
@@
-38,7
+38,8
@@
*
*/
*
*/
-#include "silcincludes.h"
+#include "silc.h"
+#include "rc5_internal.h"
#include "rc5.h"
/*
#include "rc5.h"
/*
@@
-47,9
+48,9
@@
/* Sets the key for the cipher. */
/* Sets the key for the cipher. */
-SILC_CIPHER_API_SET_KEY(
aes
)
+SILC_CIPHER_API_SET_KEY(
rc5
)
{
{
-
ui
nt32 k[8];
+
SilcUI
nt32 k[8];
SILC_GET_WORD_KEY(key, k, keylen);
rc5_set_key((RC5Context *)context, k, keylen);
SILC_GET_WORD_KEY(key, k, keylen);
rc5_set_key((RC5Context *)context, k, keylen);
@@
-60,22
+61,14
@@
SILC_CIPHER_API_SET_KEY(aes)
/* Sets the string as a new key for the cipher. The string is first
hashed and then used as a new key. */
/* 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. */
return 1;
}
/* Returns the size of the cipher context. */
-SILC_CIPHER_API_CONTEXT_LEN(
aes
)
+SILC_CIPHER_API_CONTEXT_LEN(
rc5
)
{
return sizeof(RC5Context);
}
{
return sizeof(RC5Context);
}
@@
-83,9
+76,9
@@
SILC_CIPHER_API_CONTEXT_LEN(aes)
/* Encrypts with the cipher in CBC mode. Source and destination buffers
maybe one and same. */
/* 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
)
{
{
-
ui
nt32 tiv[4];
+
SilcUI
nt32 tiv[4];
int i;
SILC_CBC_GET_IV(tiv, iv);
int i;
SILC_CBC_GET_IV(tiv, iv);
@@
-108,9
+101,9
@@
SILC_CIPHER_API_ENCRYPT_CBC(aes)
/* Decrypts with the cipher in CBC mode. Source and destination buffers
maybe one and same. */
/* 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
)
{
{
-
ui
nt32 tmp[4], tmp2[4], tiv[4];
+
SilcUI
nt32 tmp[4], tmp2[4], tiv[4];
int i;
SILC_CBC_GET_IV(tiv, iv);
int i;
SILC_CBC_GET_IV(tiv, iv);
@@
-146,7
+139,7
@@
SILC_CIPHER_API_DECRYPT_CBC(aes)
/* Sets RC5 key */
/* Sets RC5 key */
-int rc5_set_key(RC5Context *ctx, const
ui
nt32 in_key[], int key_len)
+int rc5_set_key(RC5Context *ctx, const
SilcUI
nt32 in_key[], int key_len)
{
u32 i, j, k, A, B, L[c];
u32 *out_key = ctx->out_key;
{
u32 i, j, k, A, B, L[c];
u32 *out_key = ctx->out_key;