diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2000-05-27 12:38:43 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2000-05-27 12:38:43 +0000 |
commit | be06a9348d83187071270a29aabfe10cc3904f85 (patch) | |
tree | bd19112dbfbaa0b19bd83b1a94e85ad6a794fcdb /crypto/evp/e_ecb_r5.c | |
parent | 7f0606016cbbec917b1fe094b84b062e87abe7da (diff) | |
download | openssl-be06a9348d83187071270a29aabfe10cc3904f85.tar.gz |
Second phase of EVP cipher overhaul.
Change functions like EVP_EncryptUpdate() so they now return a
value. These normally have software only implementations
which cannot fail so this was acceptable. However ciphers
can be implemented in hardware and these could return errors.
Diffstat (limited to 'crypto/evp/e_ecb_r5.c')
-rw-r--r-- | crypto/evp/e_ecb_r5.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/crypto/evp/e_ecb_r5.c b/crypto/evp/e_ecb_r5.c index 1bf19e6f95..ba55e41a6c 100644 --- a/crypto/evp/e_ecb_r5.c +++ b/crypto/evp/e_ecb_r5.c @@ -63,9 +63,9 @@ #include <openssl/evp.h> #include <openssl/objects.h> -static void rc5_32_12_16_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, +static int rc5_32_12_16_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, unsigned char *iv,int enc); -static void rc5_32_12_16_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, +static int rc5_32_12_16_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl); static EVP_CIPHER rc5_ecb_cipher= { @@ -87,20 +87,21 @@ EVP_CIPHER *EVP_rc5_32_12_16_ecb(void) return(&rc5_ecb_cipher); } -static void rc5_32_12_16_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, +static int rc5_32_12_16_ecb_init_key(EVP_CIPHER_CTX *ctx, unsigned char *key, unsigned char *iv, int enc) { if (key != NULL) RC5_32_set_key(&(ctx->c.rc5_ks),EVP_RC5_32_12_16_KEY_SIZE,key, RC5_12_ROUNDS); + return 1; } -static void rc5_32_12_16_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, +static int rc5_32_12_16_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, unsigned char *in, unsigned int inl) { unsigned int i; - if (inl < 8) return; + if (inl < 8) return 1; inl-=8; for (i=0; i<=inl; i+=8) { @@ -108,6 +109,7 @@ static void rc5_32_12_16_ecb_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, &(in[i]),&(out[i]), &(ctx->c.rc5_ks),ctx->encrypt); } + return 1; } #endif |