mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-07 08:56:17 +08:00
A clean version
This commit is contained in:
@@ -1,85 +0,0 @@
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2014 - 2017 The GmSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the GmSSL Project.
|
||||
* (http://gmssl.org/)"
|
||||
*
|
||||
* 4. The name "GmSSL Project" must not be used to endorse or promote
|
||||
* products derived from this software without prior written
|
||||
* permission. For written permission, please contact
|
||||
* guanzhi1980@gmail.com.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "GmSSL"
|
||||
* nor may "GmSSL" appear in their names without prior written
|
||||
* permission of the GmSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the GmSSL Project
|
||||
* (http://gmssl.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE GmSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE GmSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*/
|
||||
#ifndef HEADER_BASE58_H
|
||||
#define HEADER_BASE58_H
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
#ifndef OPENSSL_NO_BASE58
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
int base58_encode(const void *in, size_t inlen, char *out, size_t *outlen);
|
||||
int base58_decode(const char *in, size_t inlen, void *out, size_t *outlen);
|
||||
|
||||
/* BEGIN ERROR CODES */
|
||||
/*
|
||||
* The following lines are auto generated by the script mkerr.pl. Any changes
|
||||
* made after this point may be overwritten when the script is next run.
|
||||
*/
|
||||
|
||||
int ERR_load_BASE58_strings(void);
|
||||
|
||||
/* Error codes for the BASE58 functions. */
|
||||
|
||||
/* Function codes. */
|
||||
# define BASE58_F_BASE58_DECODE 100
|
||||
|
||||
/* Reason codes. */
|
||||
# define BASE58_R_HIGHBIT_SET_ON_INVALID_DIGIT 100
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
@@ -101,7 +101,6 @@ typedef struct err_state_st {
|
||||
# define ERR_LIB_SDF 63
|
||||
# define ERR_LIB_SKF 64
|
||||
# define ERR_LIB_SM2 66
|
||||
# define ERR_LIB_BASE58 67
|
||||
|
||||
# define ERR_LIB_USER 128
|
||||
|
||||
@@ -148,7 +147,6 @@ typedef struct err_state_st {
|
||||
# define SM9err(f,r) ERR_PUT_error(ERR_LIB_SM9,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
# define SDFerr(f,r) ERR_PUT_error(ERR_LIB_SDF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
# define SKFerr(f,r) ERR_PUT_error(ERR_LIB_SKF,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
# define BASE58err(f,r) ERR_PUT_error(ERR_LIB_BASE58,(f),(r),OPENSSL_FILE,OPENSSL_LINE)
|
||||
|
||||
# define ERR_PACK(l,f,r) ( \
|
||||
(((unsigned int)(l) & 0x0FF) << 24L) | \
|
||||
@@ -204,7 +202,6 @@ typedef struct err_state_st {
|
||||
# define ERR_R_SM9_LIB ERR_LIB_SM9/* 61 */
|
||||
# define ERR_R_SDF_LIB ERR_LIB_SDF/* 63 */
|
||||
# define ERR_R_SKF_LIB ERR_LIB_SKF/* 64 */
|
||||
# define ERR_R_BASE58_LIB ERR_LIB_BASE58/* 67 */
|
||||
|
||||
# define ERR_R_NESTED_ASN1_ERROR 58
|
||||
|
||||
|
||||
@@ -41,9 +41,9 @@ extern "C" {
|
||||
*/
|
||||
# define OPENSSL_VERSION_NUMBER 0x1010004fL
|
||||
# ifdef OPENSSL_FIPS
|
||||
# define OPENSSL_VERSION_TEXT "GmSSL 2.5.0 - OpenSSL 1.1.0d-fips 28 Feb 2019"
|
||||
# define OPENSSL_VERSION_TEXT "GmSSL 2.5.1 - OpenSSL 1.1.0d-fips 13 Jun 2019"
|
||||
# else
|
||||
# define OPENSSL_VERSION_TEXT "GmSSL 2.5.0 - OpenSSL 1.1.0d 28 Feb 2019"
|
||||
# define OPENSSL_VERSION_TEXT "GmSSL 2.5.1 - OpenSSL 1.1.0d 13 Jun 2019"
|
||||
# endif
|
||||
|
||||
/*-
|
||||
|
||||
@@ -51,20 +51,10 @@ extern "C" {
|
||||
|
||||
# define PEM_STRING_PAILLIER "PAILLIER PRIVATE KEY"
|
||||
# define PEM_STRING_PAILLIER_PUBLIC "PAILLIER PUBLIC KEY"
|
||||
# define PEM_STRING_CPK_MASTER "CPK MASTER PRIVATE KEY"
|
||||
# define PEM_STRING_CPK_MASTER_PUBLIC "CPK MASTER PUBLIC KEY"
|
||||
# define PEM_STRING_SM9_MASTER "SM9 MASTER PRIVATE KEY"
|
||||
# define PEM_STRING_SM9_MASTER_PUBLIC "SM9 MASTER PUBLIC KEY"
|
||||
# define PEM_STRING_SM9 "SM9 PRIVATE KEY"
|
||||
# define PEM_STRING_SM9_PUBLIC "SM9 PUBLIC KEY"
|
||||
# define PEM_STRING_BFIBE_MASTER "BFIBE MASTER PRIVATE KEY"
|
||||
# define PEM_STRING_BFIBE_MASTER_PUBLIC "BFIBE MASTER PUBLIC KEY"
|
||||
# define PEM_STRING_BFIBE "BFIBE PRIVATE KEY"
|
||||
# define PEM_STRING_BFIBE_PUBLIC "BFIBE PUBLIC KEY"
|
||||
# define PEM_STRING_BB1IBE_MASTER "BB1IBE MASTER PRIVATE KEY"
|
||||
# define PEM_STRING_BB1IBE_MASTER_PUBLIC "BB1IBE MASTER PUBLIC KEY"
|
||||
# define PEM_STRING_BB1IBE "BB1IBE PRIVATE KEY"
|
||||
# define PEM_STRING_BB1IBE_PUBLIC "BB1IBE PUBLIC KEY"
|
||||
|
||||
# define PEM_TYPE_ENCRYPTED 10
|
||||
# define PEM_TYPE_MIC_ONLY 20
|
||||
@@ -378,8 +368,6 @@ DECLARE_PEM_rw_cb(PaillierPrivateKey, PAILLIER)
|
||||
DECLARE_PEM_rw_const(PaillierPublicKey, PAILLIER)
|
||||
DECLARE_PEM_rw(PAILLIER_PUBKEY, PAILLIER)
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_CPK
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_SM9
|
||||
DECLARE_PEM_rw_cb(SM9MasterSecret, SM9_MASTER_KEY)
|
||||
DECLARE_PEM_rw_const(SM9PublicParameters, SM9_MASTER_KEY)
|
||||
@@ -388,10 +376,6 @@ DECLARE_PEM_rw_cb(SM9PrivateKey, SM9_KEY)
|
||||
DECLARE_PEM_rw_const(SM9PublicKey, SM9_KEY)
|
||||
DECLARE_PEM_rw(SM9_PUBKEY, SM9_KEY)
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_BFIBE
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_BB1IBE
|
||||
# endif
|
||||
DECLARE_PEM_rw_cb(PrivateKey, EVP_PKEY)
|
||||
DECLARE_PEM_rw(PUBKEY, EVP_PKEY)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user