Fix error code.
[openssl.git] / crypto / engine / eng_aesni.c
index 2d7f6f3ecc94b7ddc9cb06028297a6ed1ab5730d..2a997cae36dc0cf1daf44901d200af0bc2ff3f27 100644 (file)
 #if !defined(OPENSSL_NO_HW) && !defined(OPENSSL_NO_HW_AES_NI) && !defined(OPENSSL_NO_AES)
 
 #include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <openssl/crypto.h>
+#include "cryptlib.h"
 #include <openssl/dso.h>
 #include <openssl/engine.h>
 #include <openssl/evp.h>
 #include <openssl/aes.h>
 #include <openssl/err.h>
-#include <cryptlib.h>
 #include <openssl/modes.h>
 
 /* AES-NI is available *ONLY* on some x86 CPUs.  Not only that it
@@ -248,7 +245,7 @@ typedef struct
 } AESNI_KEY;
 
 static int
-aesni_init_key (EVP_CIPHER_CTX *ctx, const unsigned char *user_key,
+aesni_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *user_key,
                    const unsigned char *iv, int enc)
 {
        int ret;
@@ -262,7 +259,7 @@ aesni_init_key (EVP_CIPHER_CTX *ctx, const unsigned char *user_key,
                ret=aesni_set_decrypt_key(user_key, ctx->key_len * 8, key);
 
        if(ret < 0) {
-               EVPerr(EVP_F_AES_INIT_KEY,EVP_R_AES_KEY_SETUP_FAILED);
+               EVPerr(EVP_F_AESNI_INIT_KEY,EVP_R_AES_KEY_SETUP_FAILED);
                return 0;
        }