/*
 * 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/gmsaf.h>

/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR

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

static ERR_STRING_DATA SAF_str_functs[] = {
    {ERR_FUNC(SAF_F_SAF_ADDCACERTIFICATE), "SAF_AddCaCertificate"},
    {ERR_FUNC(SAF_F_SAF_ADDTRUSTEDROOTCACERTIFICATE),
     "SAF_AddTrustedRootCaCertificate"},
    {ERR_FUNC(SAF_F_SAF_BASE64_CREATEBASE64OBJ),
     "SAF_Base64_CreateBase64Obj"},
    {ERR_FUNC(SAF_F_SAF_BASE64_DECODE), "SAF_Base64_Decode"},
    {ERR_FUNC(SAF_F_SAF_BASE64_DECODEFINAL), "SAF_Base64_DecodeFinal"},
    {ERR_FUNC(SAF_F_SAF_BASE64_DECODEUPDATE), "SAF_Base64_DecodeUpdate"},
    {ERR_FUNC(SAF_F_SAF_BASE64_ENCODE), "SAF_Base64_Encode"},
    {ERR_FUNC(SAF_F_SAF_BASE64_ENCODEFINAL), "SAF_Base64_EncodeFinal"},
    {ERR_FUNC(SAF_F_SAF_BASE64_ENCODEUPDATE), "SAF_Base64_EncodeUpdate"},
    {ERR_FUNC(SAF_F_SAF_CHANGEPIN), "SAF_ChangePin"},
    {ERR_FUNC(SAF_F_SAF_CREATEHASHOBJ), "SAF_CreateHashObj"},
    {ERR_FUNC(SAF_F_SAF_CREATESYMMKEYOBJ), "SAF_CreateSymmKeyObj"},
    {ERR_FUNC(SAF_F_SAF_DESTROYHASHOBJ), "SAF_DestroyHashObj"},
    {ERR_FUNC(SAF_F_SAF_ECCPUBLICKEYENC), "SAF_EccPublicKeyEnc"},
    {ERR_FUNC(SAF_F_SAF_ECCPUBLICKEYENCBYCERT), "SAF_EccPublicKeyEncByCert"},
    {ERR_FUNC(SAF_F_SAF_ECCSIGN), "SAF_EccSign"},
    {ERR_FUNC(SAF_F_SAF_ECCVERIFYSIGN), "SAF_EccVerifySign"},
    {ERR_FUNC(SAF_F_SAF_ECCVERIFYSIGNBYCERT), "SAF_EccVerifySignByCert"},
    {ERR_FUNC(SAF_F_SAF_GENECCKEYPAIR), "SAF_GenEccKeyPair"},
    {ERR_FUNC(SAF_F_SAF_GENERATEKEYWITHEPK), "SAF_GenerateKeyWithEPK"},
    {ERR_FUNC(SAF_F_SAF_GENRANDOM), "SAF_GenRandom"},
    {ERR_FUNC(SAF_F_SAF_GENRSAKEYPAIR), "SAF_GenRsaKeyPair"},
    {ERR_FUNC(SAF_F_SAF_GETCACERTIFICATE), "SAF_GetCaCertificate"},
    {ERR_FUNC(SAF_F_SAF_GETCACERTIFICATECOUNT), "SAF_GetCaCertificateCount"},
    {ERR_FUNC(SAF_F_SAF_GETECCPUBLICKEY), "SAF_GetEccPublicKey"},
    {ERR_FUNC(SAF_F_SAF_GETROOTCACERTIFICATE), "SAF_GetRootCaCertificate"},
    {ERR_FUNC(SAF_F_SAF_GETROOTCACERTIFICATECOUNT),
     "SAF_GetRootCaCertificateCount"},
    {ERR_FUNC(SAF_F_SAF_GETRSAPUBLICKEY), "SAF_GetRsaPublicKey"},
    {ERR_FUNC(SAF_F_SAF_GETVERSION), "SAF_GetVersion"},
    {ERR_FUNC(SAF_F_SAF_HASH), "SAF_Hash"},
    {ERR_FUNC(SAF_F_SAF_HASHFINAL), "SAF_HashFinal"},
    {ERR_FUNC(SAF_F_SAF_HASHUPDATE), "SAF_HashUpdate"},
    {ERR_FUNC(SAF_F_SAF_INITIALIZE), "SAF_Initialize"},
    {ERR_FUNC(SAF_F_SAF_KEY_NEW), "SAF_KEY_new"},
    {ERR_FUNC(SAF_F_SAF_LOAD_PRIVATE_KEY), "SAF_load_private_key"},
    {ERR_FUNC(SAF_F_SAF_LOAD_PUBLIC_KEY), "SAF_load_public_key"},
    {ERR_FUNC(SAF_F_SAF_LOGIN), "SAF_Login"},
    {ERR_FUNC(SAF_F_SAF_LOGOUT), "SAF_Logout"},
    {ERR_FUNC(SAF_F_SAF_MACFINAL), "SAF_MacFinal"},
    {ERR_FUNC(SAF_F_SAF_MACUPDATE), "SAF_MacUpdate"},
    {ERR_FUNC(SAF_F_SAF_PKCS7_DECODEDIGESTEDDATA),
     "SAF_Pkcs7_DecodeDigestedData"},
    {ERR_FUNC(SAF_F_SAF_PKCS7_DECODEENVELOPEDDATA),
     "SAF_Pkcs7_DecodeEnvelopedData"},
    {ERR_FUNC(SAF_F_SAF_PKCS7_DECODESIGNEDDATA),
     "SAF_Pkcs7_DecodeSignedData"},
    {ERR_FUNC(SAF_F_SAF_PKCS7_ENCODEDIGESTEDDATA),
     "SAF_Pkcs7_EncodeDigestedData"},
    {ERR_FUNC(SAF_F_SAF_PKCS7_ENCODEENVELOPEDDATA),
     "SAF_Pkcs7_EncodeEnvelopedData"},
    {ERR_FUNC(SAF_F_SAF_PKCS7_ENCODESIGNEDDATA),
     "SAF_Pkcs7_EncodeSignedData"},
    {ERR_FUNC(SAF_F_SAF_REMOVECACERTIFICATE), "SAF_RemoveCaCertificate"},
    {ERR_FUNC(SAF_F_SAF_REMOVEROOTCACERTIFICATE),
     "SAF_RemoveRootCaCertificate"},
    {ERR_FUNC(SAF_F_SAF_RSASIGN), "SAF_RsaSign"},
    {ERR_FUNC(SAF_F_SAF_RSAVERIFYSIGN), "SAF_RsaVerifySign"},
    {ERR_FUNC(SAF_F_SAF_SYMMDECRYPTFINAL), "SAF_SymmDecryptFinal"},
    {ERR_FUNC(SAF_F_SAF_SYMMDECRYPTUPDATE), "SAF_SymmDecryptUpdate"},
    {ERR_FUNC(SAF_F_SAF_SYMMENCRYPTFINAL), "SAF_SymmEncryptFinal"},
    {ERR_FUNC(SAF_F_SAF_SYMMENCRYPTUPDATE), "SAF_SymmEncryptUpdate"},
    {ERR_FUNC(SAF_F_SAF_SYMMKEYOBJ_DUP), "SAF_SYMMKEYOBJ_dup"},
    {ERR_FUNC(SAF_F_SAF_VERIFYSIGNBYCERT), "SAF_VerifySignByCert"},
    {0, NULL}
};

static ERR_STRING_DATA SAF_str_reasons[] = {
    {ERR_REASON(SAF_R_BUFFER_TOO_SMALL), "buffer too small"},
    {ERR_REASON(SAF_R_CMAC_FAILURE), "cmac failure"},
    {ERR_REASON(SAF_R_DECRYPT_NOT_INITIALIZED), "decrypt not initialized"},
    {ERR_REASON(SAF_R_ENCRYPT_KEY_FAILURE), "encrypt key failure"},
    {ERR_REASON(SAF_R_ENCRYPT_NOT_INITIALIED), "encrypt not initialied"},
    {ERR_REASON(SAF_R_GEN_RANDOM_FAILURE), "gen random failure"},
    {ERR_REASON(SAF_R_INT_OVERFLOW), "int overflow"},
    {ERR_REASON(SAF_R_INVALID_ALGOR), "invalid algor"},
    {ERR_REASON(SAF_R_INVALID_APP), "invalid app"},
    {ERR_REASON(SAF_R_INVALID_CERTIFICATE), "invalid certificate"},
    {ERR_REASON(SAF_R_INVALID_DIGEST_ALGOR), "invalid digest algor"},
    {ERR_REASON(SAF_R_INVALID_HANDLE), "invalid handle"},
    {ERR_REASON(SAF_R_INVALID_INDEX), "invalid index"},
    {ERR_REASON(SAF_R_INVALID_INPUT_LENGTH), "invalid input length"},
    {ERR_REASON(SAF_R_INVALID_KEY_HANDLE), "invalid key handle"},
    {ERR_REASON(SAF_R_INVALID_KEY_LENGTH), "invalid key length"},
    {ERR_REASON(SAF_R_INVALID_KEY_USAGE), "invalid key usage"},
    {ERR_REASON(SAF_R_INVALID_LENGTH), "invalid length"},
    {ERR_REASON(SAF_R_INVALID_PKCS7), "invalid pkcs7"},
    {ERR_REASON(SAF_R_INVALID_PKCS7_DATA), "invalid pkcs7 data"},
    {ERR_REASON(SAF_R_INVALID_PKCS7_TYPE), "invalid pkcs7 type"},
    {ERR_REASON(SAF_R_INVALID_PKEY_TYPE), "invalid pkey type"},
    {ERR_REASON(SAF_R_INVALID_PUBLIC_KEY), "invalid public key"},
    {ERR_REASON(SAF_R_LOA), "loa"},
    {ERR_REASON(SAF_R_LOAD_CERTS_FAILURE), "load certs failure"},
    {ERR_REASON(SAF_R_LOAD_KEY_FAILURE), "load key failure"},
    {ERR_REASON(SAF_R_LOAD_PRIVATE_KEY_FAILURE), "load private key failure"},
    {ERR_REASON(SAF_R_LOAD_PUBLIC_KEY_FAILURE), "load public key failure"},
    {ERR_REASON(SAF_R_MAC_FAILURE), "mac failure"},
    {ERR_REASON(SAF_R_NOT_SUPPORTED), "not supported"},
    {ERR_REASON(SAF_R_OPERATION_NOT_INITIALIZED),
     "operation not initialized"},
    {ERR_REASON(SAF_R_PKCS7_VERIFY_FAILURE), "pkcs7 verify failure"},
    {ERR_REASON(SAF_R_UNSUPPORTED_ALGOR), "unsupported algor"},
    {ERR_REASON(SAF_R_UNSUPPORTED_DIGEST_ALGOR), "unsupported digest algor"},
    {0, NULL}
};

#endif

int ERR_load_SAF_strings(void)
{
#ifndef OPENSSL_NO_ERR

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