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

/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR

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

static ERR_STRING_DATA SM9_str_functs[] = {
    {ERR_FUNC(SM9_F_SM9CIPHERTEXT_CHECK), "SM9Ciphertext_check"},
    {ERR_FUNC(SM9_F_SM9ENCPARAMETERS_DECRYPT), "SM9EncParameters_decrypt"},
    {ERR_FUNC(SM9_F_SM9ENCPARAMETERS_ENCRYPT), "SM9EncParameters_encrypt"},
    {ERR_FUNC(SM9_F_SM9ENCPARAMETERS_GENERATE_MAC),
     "SM9EncParameters_generate_mac"},
    {ERR_FUNC(SM9_F_SM9ENCPARAMETERS_GET_KEY_LENGTH),
     "SM9EncParameters_get_key_length"},
    {ERR_FUNC(SM9_F_SM9PUBLICPARAMETERS_GET_POINT_SIZE),
     "SM9PublicParameters_get_point_size"},
    {ERR_FUNC(SM9_F_SM9_DECRYPT), "SM9_decrypt"},
    {ERR_FUNC(SM9_F_SM9_DO_DECRYPT), "SM9_do_decrypt"},
    {ERR_FUNC(SM9_F_SM9_DO_ENCRYPT), "SM9_do_encrypt"},
    {ERR_FUNC(SM9_F_SM9_DO_SIGN), "SM9_do_sign"},
    {ERR_FUNC(SM9_F_SM9_DO_SIGN_TYPE1CURVE), "SM9_do_sign_type1curve"},
    {ERR_FUNC(SM9_F_SM9_DO_VERIFY), "SM9_do_verify"},
    {ERR_FUNC(SM9_F_SM9_DO_VERIFY_TYPE1CURVE), "SM9_do_verify_type1curve"},
    {ERR_FUNC(SM9_F_SM9_ENCRYPT), "SM9_encrypt"},
    {ERR_FUNC(SM9_F_SM9_EXTRACT_PRIVATE_KEY), "SM9_extract_private_key"},
    {ERR_FUNC(SM9_F_SM9_SETUP_TYPE1CURVE), "SM9_setup_type1curve"},
    {ERR_FUNC(SM9_F_SM9_SIGN), "SM9_sign"},
    {ERR_FUNC(SM9_F_SM9_UNWRAP_KEY), "SM9_unwrap_key"},
    {ERR_FUNC(SM9_F_SM9_VERIFY), "SM9_verify"},
    {ERR_FUNC(SM9_F_SM9_WRAP_KEY), "SM9_wrap_key"},
    {0, NULL}
};

static ERR_STRING_DATA SM9_str_reasons[] = {
    {ERR_REASON(SM9_R_BUFFER_TOO_SMALL), "buffer too small"},
    {ERR_REASON(SM9_R_COMPUTE_PAIRING_FAILURE), "compute pairing failure"},
    {ERR_REASON(SM9_R_GENERATE_MAC_FAILURE), "generate mac failure"},
    {ERR_REASON(SM9_R_HASH_FAILURE), "hash failure"},
    {ERR_REASON(SM9_R_INVALID_CIPHERTEXT), "invalid ciphertext"},
    {ERR_REASON(SM9_R_INVALID_CURVE), "invalid curve"},
    {ERR_REASON(SM9_R_INVALID_DIGEST), "invalid digest"},
    {ERR_REASON(SM9_R_INVALID_DIGEST_LENGTH), "invalid digest length"},
    {ERR_REASON(SM9_R_INVALID_ENCPARAMETERS), "invalid encparameters"},
    {ERR_REASON(SM9_R_INVALID_ID), "invalid id"},
    {ERR_REASON(SM9_R_INVALID_ID_LENGTH), "invalid id length"},
    {ERR_REASON(SM9_R_INVALID_INPUT), "invalid input"},
    {ERR_REASON(SM9_R_INVALID_KEY_LENGTH), "invalid key length"},
    {ERR_REASON(SM9_R_INVALID_MD), "invalid md"},
    {ERR_REASON(SM9_R_INVALID_PARAMETER), "invalid parameter"},
    {ERR_REASON(SM9_R_INVALID_SIGNATURE), "invalid signature"},
    {ERR_REASON(SM9_R_INVALID_TYPE1CURVE), "invalid type1curve"},
    {ERR_REASON(SM9_R_KDF_FAILURE), "kdf failure"},
    {ERR_REASON(SM9_R_NOT_NAMED_CURVE), "not named curve"},
    {ERR_REASON(SM9_R_PARSE_PAIRING), "parse pairing"},
    {ERR_REASON(SM9_R_ZERO_ID), "zero id"},
    {0, NULL}
};

#endif

int ERR_load_SM9_strings(void)
{
#ifndef OPENSSL_NO_ERR

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