/*
 * Generated by util/mkerr.pl DO NOT EDIT
 * Copyright 1995-2017 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/gmsdf.h>

/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR

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

static ERR_STRING_DATA SDF_str_functs[] = {
    {ERR_FUNC(SDF_F_SDF_CALCULATEMAC), "SDF_CalculateMAC"},
    {ERR_FUNC(SDF_F_SDF_CLOSEDEVICE), "SDF_CloseDevice"},
    {ERR_FUNC(SDF_F_SDF_CLOSESESSION), "SDF_CloseSession"},
    {ERR_FUNC(SDF_F_SDF_CREATEFILE), "SDF_CreateFile"},
    {ERR_FUNC(SDF_F_SDF_DECRYPT), "SDF_Decrypt"},
    {ERR_FUNC(SDF_F_SDF_DELETEFILE), "SDF_DeleteFile"},
    {ERR_FUNC(SDF_F_SDF_DESTROYKEY), "SDF_DestroyKey"},
    {ERR_FUNC(SDF_F_SDF_ENCRYPT), "SDF_Encrypt"},
    {ERR_FUNC(SDF_F_SDF_EXCHANGEDIGITENVELOPEBASEONECC),
     "SDF_ExchangeDigitEnvelopeBaseOnECC"},
    {ERR_FUNC(SDF_F_SDF_EXCHANGEDIGITENVELOPEBASEONRSA),
     "SDF_ExchangeDigitEnvelopeBaseOnRSA"},
    {ERR_FUNC(SDF_F_SDF_EXPORTENCPUBLICKEY_ECC),
     "SDF_ExportEncPublicKey_ECC"},
    {ERR_FUNC(SDF_F_SDF_EXPORTENCPUBLICKEY_RSA),
     "SDF_ExportEncPublicKey_RSA"},
    {ERR_FUNC(SDF_F_SDF_EXPORTSIGNPUBLICKEY_ECC),
     "SDF_ExportSignPublicKey_ECC"},
    {ERR_FUNC(SDF_F_SDF_EXPORTSIGNPUBLICKEY_RSA),
     "SDF_ExportSignPublicKey_RSA"},
    {ERR_FUNC(SDF_F_SDF_EXTERNALENCRYPT_ECC), "SDF_ExternalEncrypt_ECC"},
    {ERR_FUNC(SDF_F_SDF_EXTERNALPRIVATEKEYOPERATION_RSA),
     "SDF_EXTERNALPRIVATEKEYOPERATION_RSA"},
    {ERR_FUNC(SDF_F_SDF_EXTERNALPUBLICKEYOPERATION_RSA),
     "SDF_ExternalPublicKeyOperation_RSA"},
    {ERR_FUNC(SDF_F_SDF_EXTERNALVERIFY_ECC), "SDF_ExternalVerify_ECC"},
    {ERR_FUNC(SDF_F_SDF_GENERATEAGREEMENTDATAANDKEYWITHECC),
     "SDF_GenerateAgreementDataAndKeyWithECC"},
    {ERR_FUNC(SDF_F_SDF_GENERATEAGREEMENTDATAWITHECC),
     "SDF_GenerateAgreementDataWithECC"},
    {ERR_FUNC(SDF_F_SDF_GENERATEKEYPAIR_ECC), "SDF_GenerateKeyPair_ECC"},
    {ERR_FUNC(SDF_F_SDF_GENERATEKEYPAIR_RSA), "SDF_GenerateKeyPair_RSA"},
    {ERR_FUNC(SDF_F_SDF_GENERATEKEYWITHECC), "SDF_GenerateKeyWithECC"},
    {ERR_FUNC(SDF_F_SDF_GENERATEKEYWITHEPK_ECC),
     "SDF_GenerateKeyWithEPK_ECC"},
    {ERR_FUNC(SDF_F_SDF_GENERATEKEYWITHEPK_RSA),
     "SDF_GenerateKeyWithEPK_RSA"},
    {ERR_FUNC(SDF_F_SDF_GENERATEKEYWITHIPK_ECC),
     "SDF_GenerateKeyWithIPK_ECC"},
    {ERR_FUNC(SDF_F_SDF_GENERATEKEYWITHIPK_RSA),
     "SDF_GenerateKeyWithIPK_RSA"},
    {ERR_FUNC(SDF_F_SDF_GENERATEKEYWITHKEK), "SDF_GenerateKeyWithKEK"},
    {ERR_FUNC(SDF_F_SDF_GENERATERANDOM), "SDF_GenerateRandom"},
    {ERR_FUNC(SDF_F_SDF_GETDEVICEINFO), "SDF_GetDeviceInfo"},
    {ERR_FUNC(SDF_F_SDF_GETPRIVATEKEYACCESSRIGHT),
     "SDF_GetPrivateKeyAccessRight"},
    {ERR_FUNC(SDF_F_SDF_HASHFINAL), "SDF_HashFinal"},
    {ERR_FUNC(SDF_F_SDF_HASHINIT), "SDF_HashInit"},
    {ERR_FUNC(SDF_F_SDF_HASHUPDATE), "SDF_HashUpdate"},
    {ERR_FUNC(SDF_F_SDF_IMPORTKEY), "SDF_ImportKey"},
    {ERR_FUNC(SDF_F_SDF_IMPORTKEYWITHISK_ECC), "SDF_ImportKeyWithISK_ECC"},
    {ERR_FUNC(SDF_F_SDF_IMPORTKEYWITHISK_RSA), "SDF_ImportKeyWithISK_RSA"},
    {ERR_FUNC(SDF_F_SDF_IMPORTKEYWITHKEK), "SDF_ImportKeyWithKEK"},
    {ERR_FUNC(SDF_F_SDF_INTERNALPRIVATEKEYOPERATION_RSA),
     "SDF_InternalPrivateKeyOperation_RSA"},
    {ERR_FUNC(SDF_F_SDF_INTERNALPUBLICKEYOPERATION_RSA),
     "SDF_InternalPublicKeyOperation_RSA"},
    {ERR_FUNC(SDF_F_SDF_INTERNALSIGN_ECC), "SDF_InternalSign_ECC"},
    {ERR_FUNC(SDF_F_SDF_INTERNALVERIFY_ECC), "SDF_InternalVerify_ECC"},
    {ERR_FUNC(SDF_F_SDF_METHOD_LOAD_LIBRARY), "SDF_METHOD_LOAD_LIBRARY"},
    {ERR_FUNC(SDF_F_SDF_OPENDEVICE), "SDF_OpenDevice"},
    {ERR_FUNC(SDF_F_SDF_OPENSESSION), "SDF_OpenSession"},
    {ERR_FUNC(SDF_F_SDF_READFILE), "SDF_ReadFile"},
    {ERR_FUNC(SDF_F_SDF_RELEASEPRIVATEKEYACCESSRIGHT),
     "SDF_ReleasePrivateKeyAccessRight"},
    {ERR_FUNC(SDF_F_SDF_WRITEFILE), "SDF_WriteFile"},
    {0, NULL}
};

static ERR_STRING_DATA SDF_str_reasons[] = {
    {ERR_REASON(SDF_R_INVALID_KEY_LENGTH), "invalid key length"},
    {ERR_REASON(SDF_R_INVALID_SDF_LIBRARY), "invalid sdf library"},
    {ERR_REASON(SDF_R_INVALID_SESSION_HANDLE), "invalid session handle"},
    {ERR_REASON(SDF_R_LOAD_LIBRARY_FAILURE), "load library failure"},
    {ERR_REASON(SDF_R_METHOD_OPERATION_FAILURE), "method operation failure"},
    {ERR_REASON(SDF_R_NOT_INITIALIZED), "not initialized"},
    {ERR_REASON(SDF_R_NOT_SUPPORTED), "not supported"},
    {ERR_REASON(SDF_R_OPERATION_FAILED), "operation failed"},
    {ERR_REASON(SDF_R_SDF_METHOD_RETURN_FAILURE),
     "sdf method return failure"},
    {ERR_REASON(SDF_R_SDF_OPERATION_FAILED), "sdf operation failed"},
    {0, NULL}
};

#endif

int ERR_load_SDF_strings(void)
{
#ifndef OPENSSL_NO_ERR

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