+
+/****f* silccrypt/SilcCipherAPI/silc_cipher_is_supported
+ *
+ * SYNOPSIS
+ *
+ * SilcBool silc_cipher_is_supported(const char *name);
+ *
+ * DESCRIPTION
+ *
+ * Returns TRUE if cipher `name' is supported.
+ *
+ ***/
+SilcBool silc_cipher_is_supported(const char *name);
+
+/****f* silccrypt/SilcCipherAPI/silc_cipher_get_supported
+ *
+ * SYNOPSIS
+ *
+ * char *silc_cipher_get_supported(SilcBool only_registered);
+ *
+ * DESCRIPTION
+ *
+ * Returns comma separated list of supported ciphers. If `only_registered'
+ * is TRUE only ciphers explicitly registered with silc_cipher_register
+ * are returned. If FALSE, then all registered and default builtin
+ * ciphers are returned. However, if there are no registered ciphers
+ * and `only_registered' is TRUE, the builtin ciphers are returned.
+ *
+ ***/
+char *silc_cipher_get_supported(SilcBool only_registered);
+
+/****f* silccrypt/SilcCipherAPI/silc_cipher_encrypt
+ *
+ * SYNOPSIS
+ *
+ * SilcBool silc_cipher_encrypt(SilcCipher cipher,
+ * const unsigned char *src,
+ * unsigned char *dst, SilcUInt32 len,
+ * unsigned char *iv);
+ *
+ * DESCRIPTION
+ *
+ * Encrypts data from `src' into `dst' with the specified cipher and
+ * Initial Vector (IV). If the `iv' is NULL then the cipher's internal
+ * IV is used. The `src' and `dst' maybe same buffer.
+ *
+ ***/
+SilcBool silc_cipher_encrypt(SilcCipher cipher, const unsigned char *src,
+ unsigned char *dst, SilcUInt32 len,
+ unsigned char *iv);
+
+/****f* silccrypt/SilcCipherAPI/silc_cipher_decrypt
+ *
+ * SYNOPSIS
+ *
+ * SilcBool silc_cipher_decrypt(SilcCipher cipher,
+ * const unsigned char *src,
+ * unsigned char *dst, SilcUInt32 len,
+ * unsigned char *iv);
+ *
+ * DESCRIPTION
+ *
+ * Decrypts data from `src' into `dst' with the specified cipher and
+ * Initial Vector (IV). If the `iv' is NULL then the cipher's internal
+ * IV is used. The `src' and `dst' maybe same buffer.
+ *
+ ***/
+SilcBool silc_cipher_decrypt(SilcCipher cipher, const unsigned char *src,
+ unsigned char *dst, SilcUInt32 len,
+ unsigned char *iv);
+
+/****f* silccrypt/SilcCipherAPI/silc_cipher_set_key
+ *
+ * SYNOPSIS
+ *
+ * SilcBool silc_cipher_set_key(SilcCipher cipher, const unsigned char *key,
+ * SilcUInt32 bit_keylen, SilcBool encryption);
+ *
+ * DESCRIPTION
+ *
+ * Sets the key for the cipher. The `keylen' is the key length in
+ * bits. If the `encryption' is TRUE the key is for encryption, if FALSE
+ * the key is for decryption.
+ *
+ ***/
+SilcBool silc_cipher_set_key(SilcCipher cipher, const unsigned char *key,
+ SilcUInt32 bit_keylen, SilcBool encryption);
+
+/****f* silccrypt/SilcCipherAPI/silc_cipher_set_iv
+ *
+ * SYNOPSIS
+ *
+ * void silc_cipher_set_iv(SilcCipher cipher, const unsigned char *iv);
+ *
+ * DESCRIPTION
+ *
+ * Sets the IV (initialization vector) for the cipher. The `iv' must be
+ * the size of the block size of the cipher. If `iv' is NULL this
+ * does not do anything.
+ *
+ * If the encryption mode is CTR (Counter mode) this also resets the
+ * the counter for a new block. This is done also if `iv' is NULL.
+ *
+ * If the encryption mode is CFB (cipher feedback) this also resets the
+ * the feedback stream for a new block. This is done also if `iv' is NULL.
+ *
+ ***/
+void silc_cipher_set_iv(SilcCipher cipher, const unsigned char *iv);
+
+/****f* silccrypt/SilcCipherAPI/silc_cipher_get_iv
+ *
+ * SYNOPSIS
+ *
+ * unsigned char *silc_cipher_get_iv(SilcCipher cipher);
+ *
+ * DESCRIPTION
+ *
+ * Returns the IV (initial vector) of the cipher. The returned
+ * pointer must not be freed by the caller. If the caller modifies
+ * the returned pointer the IV inside cipher is also modified.
+ *
+ ***/
+unsigned char *silc_cipher_get_iv(SilcCipher cipher);
+
+/****f* silccrypt/SilcCipherAPI/silc_cipher_get_key_len
+ *
+ * SYNOPSIS
+ *
+ * SilcUInt32 silc_cipher_get_key_len(SilcCipher cipher);
+ *
+ * DESCRIPTION
+ *
+ * Returns the key length of the cipher in bits.
+ *
+ ***/
+SilcUInt32 silc_cipher_get_key_len(SilcCipher cipher);
+
+/****f* silccrypt/SilcCipherAPI/silc_cipher_get_block_len
+ *
+ * SYNOPSIS
+ *
+ * SilcUInt32 silc_cipher_get_block_len(SilcCipher cipher);
+ *
+ * DESCRIPTION
+ *
+ * Returns the block size of the cipher in bytes.
+ *
+ ***/
+SilcUInt32 silc_cipher_get_block_len(SilcCipher cipher);
+
+/****f* silccrypt/SilcCipherAPI/silc_cipher_get_iv_len
+ *
+ * SYNOPSIS
+ *
+ * SilcUInt32 silc_cipher_get_iv_len(SilcCipher cipher);
+ *
+ * DESCRIPTION
+ *
+ * Returns the IV length of the cipher in bytes.
+ *
+ ***/
+SilcUInt32 silc_cipher_get_iv_len(SilcCipher cipher);
+
+/****f* silccrypt/SilcCipherAPI/silc_cipher_get_name
+ *
+ * SYNOPSIS
+ *
+ * const char *silc_cipher_get_name(SilcCipher cipher);
+ *
+ * DESCRIPTION
+ *
+ * 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
+ *
+ * SilcCipherMode silc_cipher_get_mode(SilcCipher cipher);
+ *
+ * DESCRIPTION
+ *
+ * Returns the cipher mode.
+ *
+ ***/
+SilcCipherMode silc_cipher_get_mode(SilcCipher cipher);
+
+#endif /* SILCCIPHER_H */