~ubuntu-branches/ubuntu/maverick/openssl/maverick

« back to all changes in this revision

Viewing changes to doc/crypto/EVP_EncryptInit.pod

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx
  • Date: 2005-12-13 21:37:42 UTC
  • mto: (11.1.1 lenny)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20051213213742-d0ydaylf80l16bj1
Tags: upstream-0.9.8a
ImportĀ upstreamĀ versionĀ 0.9.8a

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
 #include <openssl/evp.h>
24
24
 
25
 
 int EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a);
 
25
 void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a);
26
26
 
27
27
 int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
28
28
         ENGINE *impl, unsigned char *key, unsigned char *iv);
236
236
 
237
237
=head1 RETURN VALUES
238
238
 
239
 
EVP_CIPHER_CTX_init, EVP_EncryptInit_ex(), EVP_EncryptUpdate() and
240
 
EVP_EncryptFinal_ex() return 1 for success and 0 for failure.
 
239
EVP_EncryptInit_ex(), EVP_EncryptUpdate() and EVP_EncryptFinal_ex()
 
240
return 1 for success and 0 for failure.
241
241
 
242
242
EVP_DecryptInit_ex() and EVP_DecryptUpdate() return 1 for success and 0 for failure.
243
243
EVP_DecryptFinal_ex() returns 0 if the decrypt failed or 1 for success.
479
479
                if(!EVP_CipherUpdate(&ctx, outbuf, &outlen, inbuf, inlen))
480
480
                        {
481
481
                        /* Error */
 
482
                        EVP_CIPHER_CTX_cleanup(&ctx);
482
483
                        return 0;
483
484
                        }
484
485
                fwrite(outbuf, 1, outlen, out);
486
487
        if(!EVP_CipherFinal_ex(&ctx, outbuf, &outlen))
487
488
                {
488
489
                /* Error */
 
490
                EVP_CIPHER_CTX_cleanup(&ctx);
489
491
                return 0;
490
492
                }
491
493
        fwrite(outbuf, 1, outlen, out);