X-Git-Url: http://git.silcnet.org/gitweb/?p=crypto.git;a=blobdiff_plain;f=lib%2Fsilccrypt%2Fsilccipher.h;fp=lib%2Fsilccrypt%2Fsilccipher.h;h=e64e3149359fac4f2b20d11bbc4f4d209532cc9f;hp=7011bdfd40bbe375ae7e02b22efeb883fc87fe16;hb=9f20f0382b6229eca740925a73f96294f6dcedc6;hpb=1b4e874f9401653b659a6adec2d2f046f9331586 diff --git a/lib/silccrypt/silccipher.h b/lib/silccrypt/silccipher.h index 7011bdfd..e64e3149 100644 --- a/lib/silccrypt/silccipher.h +++ b/lib/silccrypt/silccipher.h @@ -191,10 +191,10 @@ SilcBool silc_cipher_unregister_all(void); * * DESCRIPTION * - * Allocates a new SILC cipher object. Function returns 1 on succes and 0 - * on error. The allocated cipher is returned in new_cipher argument. The - * caller must set the key to the cipher after this function has returned - * by calling the ciphers set_key function. + * Allocates a new SILC cipher object. Function returns TRUE on succes + * and FALSE on error. The allocated cipher is returned in new_cipher + * argument. The caller must set the key to the cipher after this + * function has returned by calling the silc_cipher_set_key. * * The following ciphers are supported: * @@ -213,6 +213,23 @@ SilcBool silc_cipher_unregister_all(void); ***/ SilcBool silc_cipher_alloc(const char *name, SilcCipher *new_cipher); +/****f* silccrypt/SilcCipherAPI/silc_cipher_alloc + * + * SYNOPSIS + * + * SilcBool silc_cipher_alloc_full(const char *alg_name, + * SilcUInt32 key_len, + * SilcCipherMode mode, + * SilcCipher *new_cipher); + * DESCRIPTION + * + * Same as silc_cipher_alloc but takes the cipher algorithm name, + * key length and mode as separate arguments. + * + ***/ +SilcBool silc_cipher_alloc_full(const char *alg_name, SilcUInt32 key_len, + SilcCipherMode mode, SilcCipher *new_cipher); + /****f* silccrypt/SilcCipherAPI/silc_cipher_free * * SYNOPSIS @@ -396,11 +413,24 @@ SilcUInt32 silc_cipher_get_iv_len(SilcCipher cipher); * * DESCRIPTION * - * Returns the name of the cipher. + * Returns the full name of the cipher (eg. 'aes-256-ctr'). * ***/ const char *silc_cipher_get_name(SilcCipher cipher); +/****f* silccrypt/SilcCipherAPI/silc_cipher_get_alg_name + * + * SYNOPSIS + * + * const char *silc_cipher_get_alg_name(SilcCipher cipher); + * + * DESCRIPTION + * + * Returns the algorithm name of the cipher (eg. 'aes'). + * + ***/ +const char *silc_cipher_get_alg_name(SilcCipher cipher); + /****f* silccrypt/SilcCipherAPI/silc_cipher_get_mode * * SYNOPSIS