/*
 * Generated by util/mkerr.pl DO NOT EDIT
 * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
 *
 * Licensed under the OpenSSL license (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
 */

#include <stdio.h>
#include <openssl/err.h>
#include <openssl/gmapi.h>

/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR

# define ERR_FUNC(func) ERR_PACK(ERR_LIB_GMAPI,func,0)
# define ERR_REASON(reason) ERR_PACK(ERR_LIB_GMAPI,0,reason)

static ERR_STRING_DATA GMAPI_str_functs[] = {
    {ERR_FUNC(GMAPI_F_ECDSA_SIG_GET_ECCSIGNATURE),
     "ECDSA_SIG_get_ECCSignature"},
    {ERR_FUNC(GMAPI_F_ECDSA_SIG_GET_ECCSIGNATUREBLOB),
     "ECDSA_SIG_get_ECCSIGNATUREBLOB"},
    {ERR_FUNC(GMAPI_F_ECDSA_SIG_NEW_FROM_ECCSIGNATURE),
     "ECDSA_SIG_new_from_ECCSignature"},
    {ERR_FUNC(GMAPI_F_ECDSA_SIG_NEW_FROM_ECCSIGNATUREBLOB),
     "ECDSA_SIG_new_from_ECCSIGNATUREBLOB"},
    {ERR_FUNC(GMAPI_F_ECDSA_SIG_SET_ECCSIGNATURE),
     "ECDSA_SIG_set_ECCSignature"},
    {ERR_FUNC(GMAPI_F_ECDSA_SIG_SET_ECCSIGNATUREBLOB),
     "ECDSA_SIG_set_ECCSIGNATUREBLOB"},
    {ERR_FUNC(GMAPI_F_EC_KEY_GET_ECCPRIVATEKEYBLOB),
     "EC_KEY_get_ECCPRIVATEKEYBLOB"},
    {ERR_FUNC(GMAPI_F_EC_KEY_GET_ECCPUBLICKEYBLOB),
     "EC_KEY_get_ECCPUBLICKEYBLOB"},
    {ERR_FUNC(GMAPI_F_EC_KEY_GET_ECCREFPRIVATEKEY),
     "EC_KEY_get_ECCrefPrivateKey"},
    {ERR_FUNC(GMAPI_F_EC_KEY_GET_ECCREFPUBLICKEY),
     "EC_KEY_get_ECCrefPublicKey"},
    {ERR_FUNC(GMAPI_F_EC_KEY_NEW_FROM_ECCPRIVATEKEYBLOB),
     "EC_KEY_new_from_ECCPRIVATEKEYBLOB"},
    {ERR_FUNC(GMAPI_F_EC_KEY_NEW_FROM_ECCPUBLICKEYBLOB),
     "EC_KEY_new_from_ECCPUBLICKEYBLOB"},
    {ERR_FUNC(GMAPI_F_EC_KEY_NEW_FROM_ECCREFPRIVATEKEY),
     "EC_KEY_new_from_ECCrefPrivateKey"},
    {ERR_FUNC(GMAPI_F_EC_KEY_NEW_FROM_ECCREFPUBLICKEY),
     "EC_KEY_new_from_ECCrefPublicKey"},
    {ERR_FUNC(GMAPI_F_EC_KEY_SET_ECCPRIVATEKEYBLOB),
     "EC_KEY_set_ECCPRIVATEKEYBLOB"},
    {ERR_FUNC(GMAPI_F_EC_KEY_SET_ECCPUBLICKEYBLOB),
     "EC_KEY_set_ECCPUBLICKEYBLOB"},
    {ERR_FUNC(GMAPI_F_EC_KEY_SET_ECCREFPRIVATEKEY),
     "EC_KEY_set_ECCrefPrivateKey"},
    {ERR_FUNC(GMAPI_F_EC_KEY_SET_ECCREFPUBLICKEY),
     "EC_KEY_set_ECCrefPublicKey"},
    {ERR_FUNC(GMAPI_F_RSA_GET_RSAPRIVATEKEYBLOB),
     "RSA_get_RSAPRIVATEKEYBLOB"},
    {ERR_FUNC(GMAPI_F_RSA_GET_RSAPUBLICKEYBLOB), "RSA_get_RSAPUBLICKEYBLOB"},
    {ERR_FUNC(GMAPI_F_RSA_GET_RSAREFPRIVATEKEY), "RSA_get_RSArefPrivateKey"},
    {ERR_FUNC(GMAPI_F_RSA_GET_RSAREFPUBLICKEY), "RSA_get_RSArefPublicKey"},
    {ERR_FUNC(GMAPI_F_RSA_NEW_FROM_RSAPRIVATEKEYBLOB),
     "RSA_new_from_RSAPRIVATEKEYBLOB"},
    {ERR_FUNC(GMAPI_F_RSA_NEW_FROM_RSAPUBLICKEYBLOB),
     "RSA_new_from_RSAPUBLICKEYBLOB"},
    {ERR_FUNC(GMAPI_F_RSA_NEW_FROM_RSAREFPRIVATEKEY),
     "RSA_new_from_RSArefPrivateKey"},
    {ERR_FUNC(GMAPI_F_RSA_NEW_FROM_RSAREFPUBLICKEY),
     "RSA_new_from_RSArefPublicKey"},
    {ERR_FUNC(GMAPI_F_RSA_SET_RSAPRIVATEKEYBLOB),
     "RSA_set_RSAPRIVATEKEYBLOB"},
    {ERR_FUNC(GMAPI_F_RSA_SET_RSAPUBLICKEYBLOB), "RSA_set_RSAPUBLICKEYBLOB"},
    {ERR_FUNC(GMAPI_F_RSA_SET_RSAREFPRIVATEKEY), "RSA_set_RSArefPrivateKey"},
    {ERR_FUNC(GMAPI_F_RSA_SET_RSAREFPUBLICKEY), "RSA_set_RSArefPublicKey"},
    {ERR_FUNC(GMAPI_F_SAF_BASE64_CREATEBASE64OBJ),
     "SAF_Base64_CreateBase64Obj"},
    {ERR_FUNC(GMAPI_F_SAF_BASE64_DECODE), "SAF_Base64_Decode"},
    {ERR_FUNC(GMAPI_F_SAF_BASE64_DECODEFINAL), "SAF_Base64_DecodeFinal"},
    {ERR_FUNC(GMAPI_F_SAF_BASE64_DECODEUPDATE), "SAF_Base64_DecodeUpdate"},
    {ERR_FUNC(GMAPI_F_SAF_BASE64_ENCODE), "SAF_Base64_Encode"},
    {ERR_FUNC(GMAPI_F_SAF_BASE64_ENCODEFINAL), "SAF_Base64_EncodeFinal"},
    {ERR_FUNC(GMAPI_F_SAF_BASE64_ENCODEUPDATE), "SAF_Base64_EncodeUpdate"},
    {ERR_FUNC(GMAPI_F_SAF_CREATESYMMKEYOBJ), "SAF_CreateSymmKeyObj"},
    {ERR_FUNC(GMAPI_F_SAF_ECCPUBLICKEYENC), "SAF_EccPublicKeyEnc"},
    {ERR_FUNC(GMAPI_F_SAF_ECCPUBLICKEYENCBYCERT),
     "SAF_EccPublicKeyEncByCert"},
    {ERR_FUNC(GMAPI_F_SAF_ECCSIGN), "SAF_EccSign"},
    {ERR_FUNC(GMAPI_F_SAF_ECCVERIFYSIGN), "SAF_EccVerifySign"},
    {ERR_FUNC(GMAPI_F_SAF_ECCVERIFYSIGNBYCERT), "SAF_EccVerifySignByCert"},
    {ERR_FUNC(GMAPI_F_SAF_GENECCKEYPAIR), "SAF_GenEccKeyPair"},
    {ERR_FUNC(GMAPI_F_SAF_GENERATEAGREEMENTDATAWITHECC),
     "SAF_GenerateAgreementDataWithECC"},
    {ERR_FUNC(GMAPI_F_SAF_GENERATEKEYWITHECC), "SAF_GenerateKeyWithECC"},
    {ERR_FUNC(GMAPI_F_SAF_GETECCPUBLICKEY), "SAF_GetEccPublicKey"},
    {ERR_FUNC(GMAPI_F_SAF_MACFINAL), "SAF_MacFinal"},
    {ERR_FUNC(GMAPI_F_SAF_MACUPDATE), "SAF_MacUpdate"},
    {ERR_FUNC(GMAPI_F_SAF_PKCS7_DECODEDIGESTEDDATA),
     "SAF_Pkcs7_DecodeDigestedData"},
    {ERR_FUNC(GMAPI_F_SAF_PKCS7_ENCODEDIGESTEDDATA),
     "SAF_Pkcs7_EncodeDigestedData"},
    {ERR_FUNC(GMAPI_F_SAF_SYMMDECRYPTUPDATE), "SAF_SymmDecryptUpdate"},
    {ERR_FUNC(GMAPI_F_SAF_SYMMENCRYPTUPDATE), "SAF_SymmEncryptUpdate"},
    {ERR_FUNC(GMAPI_F_SKF_CLOSEHANDLE), "SKF_CloseHandle"},
    {ERR_FUNC(GMAPI_F_SKF_DECRYPT), "SKF_Decrypt"},
    {ERR_FUNC(GMAPI_F_SKF_DECRYPTFINAL), "SKF_DecryptFinal"},
    {ERR_FUNC(GMAPI_F_SKF_DECRYPTINIT), "SKF_DecryptInit"},
    {ERR_FUNC(GMAPI_F_SKF_DECRYPTUPDATE), "SKF_DecryptUpdate"},
    {ERR_FUNC(GMAPI_F_SKF_DIGEST), "SKF_Digest"},
    {ERR_FUNC(GMAPI_F_SKF_DIGESTFINAL), "SKF_DigestFinal"},
    {ERR_FUNC(GMAPI_F_SKF_DIGESTINIT), "SKF_DigestInit"},
    {ERR_FUNC(GMAPI_F_SKF_DIGESTUPDATE), "SKF_DigestUpdate"},
    {ERR_FUNC(GMAPI_F_SKF_ENCRYPT), "SKF_Encrypt"},
    {ERR_FUNC(GMAPI_F_SKF_ENCRYPTFINAL), "SKF_EncryptFinal"},
    {ERR_FUNC(GMAPI_F_SKF_ENCRYPTINIT), "SKF_EncryptInit"},
    {ERR_FUNC(GMAPI_F_SKF_ENCRYPTUPDATE), "SKF_EncryptUpdate"},
    {ERR_FUNC(GMAPI_F_SKF_EXTECCDECRYPT), "SKF_ExtECCDecrypt"},
    {ERR_FUNC(GMAPI_F_SKF_EXTECCENCRYPT), "SKF_ExtECCEncrypt"},
    {ERR_FUNC(GMAPI_F_SKF_EXTECCSIGN), "SKF_ExtECCSign"},
    {ERR_FUNC(GMAPI_F_SKF_EXTECCVERIFY), "SKF_ExtECCVerify"},
    {ERR_FUNC(GMAPI_F_SKF_EXTRSAPRIKEYOPERATION),
     "SKF_ExtRSAPriKeyOperation"},
    {ERR_FUNC(GMAPI_F_SKF_EXTRSAPUBKEYOPERATION),
     "SKF_ExtRSAPubKeyOperation"},
    {ERR_FUNC(GMAPI_F_SKF_GENEXTECCKEYPAIR), "SKF_GenExtECCKeyPair"},
    {ERR_FUNC(GMAPI_F_SKF_GENEXTRSAKEY), "SKF_GenExtRSAKey"},
    {ERR_FUNC(GMAPI_F_SKF_GENRANDOM), "SKF_GenRandom"},
    {ERR_FUNC(GMAPI_F_SKF_GETDEVINFO), "SKF_GetDevInfo"},
    {ERR_FUNC(GMAPI_F_SKF_GETDEVSTATE), "SKF_GetDevState"},
    {ERR_FUNC(GMAPI_F_SKF_HANDLE_GET_CBCMAC_CTX),
     "SKF_HANDLE_get_cbcmac_ctx"},
    {ERR_FUNC(GMAPI_F_SKF_HANDLE_GET_CIPHER), "SKF_HANDLE_get_cipher"},
    {ERR_FUNC(GMAPI_F_SKF_HANDLE_GET_CIPHER_CTX),
     "SKF_HANDLE_get_cipher_ctx"},
    {ERR_FUNC(GMAPI_F_SKF_HANDLE_GET_KEY), "SKF_HANDLE_get_key"},
    {ERR_FUNC(GMAPI_F_SKF_HANDLE_GET_MD_CTX), "SKF_HANDLE_get_md_ctx"},
    {ERR_FUNC(GMAPI_F_SKF_MAC), "SKF_Mac"},
    {ERR_FUNC(GMAPI_F_SKF_MACFINAL), "SKF_MacFinal"},
    {ERR_FUNC(GMAPI_F_SKF_MACINIT), "SKF_MacInit"},
    {ERR_FUNC(GMAPI_F_SKF_MACUPDATE), "SKF_MacUpdate"},
    {ERR_FUNC(GMAPI_F_SKF_SETSYMMKEY), "SKF_SetSymmKey"},
    {ERR_FUNC(GMAPI_F_SM2_CIPHERTEXT_VALUE_GET_ECCCIPHER),
     "SM2_CIPHERTEXT_VALUE_get_ECCCipher"},
    {ERR_FUNC(GMAPI_F_SM2_CIPHERTEXT_VALUE_GET_ECCCIPHERBLOB),
     "SM2_CIPHERTEXT_VALUE_get_ECCCIPHERBLOB"},
    {ERR_FUNC(GMAPI_F_SM2_CIPHERTEXT_VALUE_NEW_FROM_ECCCIPHER),
     "SM2_CIPHERTEXT_VALUE_new_from_ECCCipher"},
    {ERR_FUNC(GMAPI_F_SM2_CIPHERTEXT_VALUE_NEW_FROM_ECCCIPHERBLOB),
     "SM2_CIPHERTEXT_VALUE_new_from_ECCCIPHERBLOB"},
    {ERR_FUNC(GMAPI_F_SM2_CIPHERTEXT_VALUE_SET_ECCCIPHER),
     "SM2_CIPHERTEXT_VALUE_set_ECCCipher"},
    {ERR_FUNC(GMAPI_F_SM2_CIPHERTEXT_VALUE_SET_ECCCIPHERBLOB),
     "SM2_CIPHERTEXT_VALUE_set_ECCCIPHERBLOB"},
    {0, NULL}
};

static ERR_STRING_DATA GMAPI_str_reasons[] = {
    {ERR_REASON(GMAPI_R_BUFFER_TOO_SMALL), "buffer too small"},
    {ERR_REASON(GMAPI_R_CBCMAC_FAILURE), "cbcmac failure"},
    {ERR_REASON(GMAPI_R_CTX_NOT_CREATED), "ctx not created"},
    {ERR_REASON(GMAPI_R_DECODE_EC_PRIVATE_KEY_FAILED),
     "decode ec private key failed"},
    {ERR_REASON(GMAPI_R_DECODE_EC_PUBLIC_KEY_FAILED),
     "decode ec public key failed"},
    {ERR_REASON(GMAPI_R_DECRYPT_FAILED), "decrypt failed"},
    {ERR_REASON(GMAPI_R_ENCODE_CIPHERTEXT_FAILED),
     "encode ciphertext failed"},
    {ERR_REASON(GMAPI_R_ENCODE_FAILED), "encode failed"},
    {ERR_REASON(GMAPI_R_ENCODE_RSA_PUBLIC_KEY_FAILED),
     "encode rsa public key failed"},
    {ERR_REASON(GMAPI_R_ENCODE_SIGNATURE_FAILED), "encode signature failed"},
    {ERR_REASON(GMAPI_R_ENCRYPT_FAILED), "encrypt failed"},
    {ERR_REASON(GMAPI_R_FAIL), "fail"},
    {ERR_REASON(GMAPI_R_GEN_RANDOM), "gen random"},
    {ERR_REASON(GMAPI_R_GEN_RSA_FAILED), "gen rsa failed"},
    {ERR_REASON(GMAPI_R_GET_PRIVATE_KEY_FAILED), "get private key failed"},
    {ERR_REASON(GMAPI_R_GET_PUBLIC_KEY_FAILED), "get public key failed"},
    {ERR_REASON(GMAPI_R_INT_OVERFLOW), "int overflow"},
    {ERR_REASON(GMAPI_R_INVALID_ALGID), "invalid algid"},
    {ERR_REASON(GMAPI_R_INVALID_ALGOR), "invalid algor"},
    {ERR_REASON(GMAPI_R_INVALID_ARGUMENTS), "invalid arguments"},
    {ERR_REASON(GMAPI_R_INVALID_BIGNUM_LENGTH), "invalid bignum length"},
    {ERR_REASON(GMAPI_R_INVALID_BLOB), "invalid blob"},
    {ERR_REASON(GMAPI_R_INVALID_CIPHERTEXT), "invalid ciphertext"},
    {ERR_REASON(GMAPI_R_INVALID_CIPHERTEXT_LENGTH),
     "invalid ciphertext length"},
    {ERR_REASON(GMAPI_R_INVALID_CIPHERTEXT_MAC), "invalid ciphertext mac"},
    {ERR_REASON(GMAPI_R_INVALID_CIPHERTEXT_POINT),
     "invalid ciphertext point"},
    {ERR_REASON(GMAPI_R_INVALID_CIPHER_CTX_HANDLE),
     "invalid cipher ctx handle"},
    {ERR_REASON(GMAPI_R_INVALID_CIPHETEXT_LENGTH),
     "invalid ciphetext length"},
    {ERR_REASON(GMAPI_R_INVALID_CONTEXT), "invalid context"},
    {ERR_REASON(GMAPI_R_INVALID_DIGEST_ALGOR), "invalid digest algor"},
    {ERR_REASON(GMAPI_R_INVALID_DIGEST_LENGTH), "invalid digest length"},
    {ERR_REASON(GMAPI_R_INVALID_ECC_PRIVATE_KEY), "invalid ecc private key"},
    {ERR_REASON(GMAPI_R_INVALID_ECC_PUBLIC_KEY), "invalid ecc public key"},
    {ERR_REASON(GMAPI_R_INVALID_EC_KEY), "invalid ec key"},
    {ERR_REASON(GMAPI_R_INVALID_EC_PRIVATE_KEY), "invalid ec private key"},
    {ERR_REASON(GMAPI_R_INVALID_EC_PUBLIC_KEY), "invalid ec public key"},
    {ERR_REASON(GMAPI_R_INVALID_FEED_BIT_LENGTH), "invalid feed bit length"},
    {ERR_REASON(GMAPI_R_INVALID_HANDLE), "invalid handle"},
    {ERR_REASON(GMAPI_R_INVALID_HANDLE_ALGOR), "invalid handle algor"},
    {ERR_REASON(GMAPI_R_INVALID_HANDLE_MAGIC), "invalid handle magic"},
    {ERR_REASON(GMAPI_R_INVALID_HANDLE_TYPE), "invalid handle type"},
    {ERR_REASON(GMAPI_R_INVALID_HASH_HANDLE), "invalid hash handle"},
    {ERR_REASON(GMAPI_R_INVALID_ID_LENGTH), "invalid id length"},
    {ERR_REASON(GMAPI_R_INVALID_INPUT_LENGTH), "invalid input length"},
    {ERR_REASON(GMAPI_R_INVALID_IV_LENGTH), "invalid iv length"},
    {ERR_REASON(GMAPI_R_INVALID_KEY_HANDLE), "invalid key handle"},
    {ERR_REASON(GMAPI_R_INVALID_KEY_LENGTH), "invalid key length"},
    {ERR_REASON(GMAPI_R_INVALID_KEY_USAGE), "invalid key usage"},
    {ERR_REASON(GMAPI_R_INVALID_LENGTH), "invalid length"},
    {ERR_REASON(GMAPI_R_INVALID_MAC_HANDLE), "invalid mac handle"},
    {ERR_REASON(GMAPI_R_INVALID_PLAINTEXT_LENGTH),
     "invalid plaintext length"},
    {ERR_REASON(GMAPI_R_INVALID_PRIVATE_KEY), "invalid private key"},
    {ERR_REASON(GMAPI_R_INVALID_PUBLIC_KEY), "invalid public key"},
    {ERR_REASON(GMAPI_R_INVALID_RANDOM_LENGTH), "invalid random length"},
    {ERR_REASON(GMAPI_R_INVALID_RSA_KEY_LENGTH), "invalid rsa key length"},
    {ERR_REASON(GMAPI_R_INVALID_RSA_PRIVATE_KEY), "invalid rsa private key"},
    {ERR_REASON(GMAPI_R_INVALID_RSA_PUBLIC_KEY), "invalid rsa public key"},
    {ERR_REASON(GMAPI_R_INVALID_SIGNATURE), "invalid signature"},
    {ERR_REASON(GMAPI_R_INVALID_SM2_CIPHERTEXT), "invalid sm2 ciphertext"},
    {ERR_REASON(GMAPI_R_INVALID_SM2_SIGNATURE), "invalid sm2 signature"},
    {ERR_REASON(GMAPI_R_MAC_FAILURE), "mac failure"},
    {ERR_REASON(GMAPI_R_MALLOC_FAILED), "malloc failed"},
    {ERR_REASON(GMAPI_R_NOT_CONVERTABLE), "not convertable"},
    {ERR_REASON(GMAPI_R_NO_PUBLIC_KEY), "no public key"},
    {ERR_REASON(GMAPI_R_NULL_ARGUMENT), "null argument"},
    {ERR_REASON(GMAPI_R_OPERATION_NOT_INITIALIZED),
     "operation not initialized"},
    {ERR_REASON(GMAPI_R_SAF_ERROR), "saf error"},
    {ERR_REASON(GMAPI_R_SIGN_FAILED), "sign failed"},
    {ERR_REASON(GMAPI_R_VERIFY_NOT_PASS), "verify not pass"},
    {0, NULL}
};

#endif

int ERR_load_GMAPI_strings(void)
{
#ifndef OPENSSL_NO_ERR

    if (ERR_func_error_string(GMAPI_str_functs[0].error) == NULL) {
        ERR_load_strings(0, GMAPI_str_functs);
        ERR_load_strings(0, GMAPI_str_reasons);
    }
#endif
    return 1;
}
