documentation and fix des
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23628 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -63,6 +63,17 @@ RCSID("$Id$");
|
|||||||
* @page page_evp EVP - generic crypto interface
|
* @page page_evp EVP - generic crypto interface
|
||||||
*
|
*
|
||||||
* See the library functions here: @ref hcrypto_evp
|
* See the library functions here: @ref hcrypto_evp
|
||||||
|
*
|
||||||
|
* @section evp_cipher EVP Cipher
|
||||||
|
*
|
||||||
|
* The use of EVP_CipherInit_ex() and EVP_Cipher() is pretty easy to
|
||||||
|
* understand forward, then EVP_CipherUpdate() and
|
||||||
|
* EVP_CipherFinal_ex() really needs an example to explain.
|
||||||
|
*
|
||||||
|
* @example example_evp_cipher.c
|
||||||
|
*
|
||||||
|
* This is an example how to use EVP_CipherInit_ex(),
|
||||||
|
* EVP_CipherUpdate() and EVP_CipherFinal_ex().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct hc_EVP_MD_CTX {
|
struct hc_EVP_MD_CTX {
|
||||||
@@ -800,6 +811,11 @@ EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *c, ENGINE *engine,
|
|||||||
* @param in input data to the operation.
|
* @param in input data to the operation.
|
||||||
* @param inlen length of data.
|
* @param inlen length of data.
|
||||||
*
|
*
|
||||||
|
* The output buffer length should at least be EVP_CIPHER_block_size()
|
||||||
|
* byte longer then the input length.
|
||||||
|
*
|
||||||
|
* See @ref evp_cipher for an example how to use this function.
|
||||||
|
*
|
||||||
* @return 1 on success.
|
* @return 1 on success.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -817,6 +833,11 @@ EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, void *out, int *outlen,
|
|||||||
* @param out output data from the operation.
|
* @param out output data from the operation.
|
||||||
* @param outlen output length
|
* @param outlen output length
|
||||||
*
|
*
|
||||||
|
* The input length needs to be at least EVP_CIPHER_block_size() bytes
|
||||||
|
* long.
|
||||||
|
*
|
||||||
|
* See @ref evp_cipher for an example how to use this function.
|
||||||
|
*
|
||||||
* @return 1 on success.
|
* @return 1 on success.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -1087,15 +1108,15 @@ des_cbc_do_cipher(EVP_CIPHER_CTX *ctx,
|
|||||||
unsigned int size)
|
unsigned int size)
|
||||||
{
|
{
|
||||||
DES_key_schedule *k = ctx->cipher_data;
|
DES_key_schedule *k = ctx->cipher_data;
|
||||||
DES_ede3_cbc_encrypt(in, out, size,
|
DES_cbc_encrypt(in, out, size,
|
||||||
k, (DES_cblock *)ctx->iv, ctx->encrypt);
|
k, (DES_cblock *)ctx->iv, ctx->encrypt);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
des_cbc_cleanup(EVP_CIPHER_CTX *ctx)
|
des_cbc_cleanup(EVP_CIPHER_CTX *ctx)
|
||||||
{
|
{
|
||||||
memset(ctx->cipher_data, 0, sizeof(struct des_ede3_cbc));
|
memset(ctx->cipher_data, 0, sizeof(struct DES_key_schedule));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user