X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=lib%2Fsilccrypt%2Faes.c;h=88877978407582fd38ea1357c69ec10ad1025391;hp=bb78fd166bf88675fe9e366902c2a58c679686fd;hb=fb1e58b1bc106212a845da866d0d4e9433c3ae22;hpb=cfbb152ac8b20cd4581fa72833b7a373de4c3bae diff --git a/lib/silccrypt/aes.c b/lib/silccrypt/aes.c index bb78fd16..88877978 100644 --- a/lib/silccrypt/aes.c +++ b/lib/silccrypt/aes.c @@ -54,6 +54,13 @@ SILC_CIPHER_API_SET_KEY(aes_cbc) return TRUE; } +/* Sets IV for the cipher. */ + +SILC_CIPHER_API_SET_IV(aes_cbc) +{ + +} + /* Returns the size of the cipher context. */ SILC_CIPHER_API_CONTEXT_LEN(aes_cbc) @@ -124,6 +131,16 @@ SILC_CIPHER_API_SET_KEY(aes_ctr) return TRUE; } +/* Sets IV for the cipher. */ + +SILC_CIPHER_API_SET_IV(aes_ctr) +{ + AesContext *aes = context; + + /* Starts new block. */ + aes->u.enc.inf.b[2] = 0; +} + /* Returns the size of the cipher context. */ SILC_CIPHER_API_CONTEXT_LEN(aes_ctr) @@ -138,7 +155,7 @@ SILC_CIPHER_API_ENCRYPT(aes_ctr) { AesContext *aes = context; SilcUInt32 ctr[4]; - int i; + int i = 16; SILC_GET32_MSB(ctr[0], iv); SILC_GET32_MSB(ctr[1], iv + 4);