├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── Makefile ├── README.md ├── ncmlib ├── ext │ ├── include │ │ └── openssl │ │ │ ├── __DECC_INCLUDE_EPILOGUE.H │ │ │ ├── __DECC_INCLUDE_PROLOGUE.H │ │ │ ├── aes.h │ │ │ ├── applink.c │ │ │ ├── asn1.h │ │ │ ├── asn1_mac.h │ │ │ ├── asn1err.h │ │ │ ├── asn1t.h │ │ │ ├── async.h │ │ │ ├── asyncerr.h │ │ │ ├── bio.h │ │ │ ├── bioerr.h │ │ │ ├── blowfish.h │ │ │ ├── bn.h │ │ │ ├── bnerr.h │ │ │ ├── buffer.h │ │ │ ├── buffererr.h │ │ │ ├── camellia.h │ │ │ ├── cast.h │ │ │ ├── cmac.h │ │ │ ├── cms.h │ │ │ ├── cmserr.h │ │ │ ├── comp.h │ │ │ ├── comperr.h │ │ │ ├── conf.h │ │ │ ├── conf_api.h │ │ │ ├── conferr.h │ │ │ ├── crypto.h │ │ │ ├── cryptoerr.h │ │ │ ├── ct.h │ │ │ ├── cterr.h │ │ │ ├── des.h │ │ │ ├── dh.h │ │ │ ├── dherr.h │ │ │ ├── dsa.h │ │ │ ├── dsaerr.h │ │ │ ├── dtls1.h │ │ │ ├── e_os2.h │ │ │ ├── ebcdic.h │ │ │ ├── ec.h │ │ │ ├── ecdh.h │ │ │ ├── ecdsa.h │ │ │ ├── ecerr.h │ │ │ ├── engine.h │ │ │ ├── engineerr.h │ │ │ ├── err.h │ │ │ ├── evp.h │ │ │ ├── evperr.h │ │ │ ├── hmac.h │ │ │ ├── idea.h │ │ │ ├── kdf.h │ │ │ ├── kdferr.h │ │ │ ├── lhash.h │ │ │ ├── md2.h │ │ │ ├── md4.h │ │ │ ├── md5.h │ │ │ ├── mdc2.h │ │ │ ├── modes.h │ │ │ ├── obj_mac.h │ │ │ ├── objects.h │ │ │ ├── objectserr.h │ │ │ ├── ocsp.h │ │ │ ├── ocsperr.h │ │ │ ├── opensslconf.h │ │ │ ├── opensslv.h │ │ │ ├── ossl_typ.h │ │ │ ├── pem.h │ │ │ ├── pem2.h │ │ │ ├── pemerr.h │ │ │ ├── pkcs12.h │ │ │ ├── pkcs12err.h │ │ │ ├── pkcs7.h │ │ │ ├── pkcs7err.h │ │ │ ├── rand.h │ │ │ ├── rand_drbg.h │ │ │ ├── randerr.h │ │ │ ├── rc2.h │ │ │ ├── rc4.h │ │ │ ├── rc5.h │ │ │ ├── ripemd.h │ │ │ ├── rsa.h │ │ │ ├── rsaerr.h │ │ │ ├── safestack.h │ │ │ ├── seed.h │ │ │ ├── sha.h │ │ │ ├── srp.h │ │ │ ├── srtp.h │ │ │ ├── ssl.h │ │ │ ├── ssl2.h │ │ │ ├── ssl3.h │ │ │ ├── sslerr.h │ │ │ ├── stack.h │ │ │ ├── store.h │ │ │ ├── storeerr.h │ │ │ ├── symhacks.h │ │ │ ├── tls1.h │ │ │ ├── ts.h │ │ │ ├── tserr.h │ │ │ ├── txt_db.h │ │ │ ├── ui.h │ │ │ ├── uierr.h │ │ │ ├── whrlpool.h │ │ │ ├── x509.h │ │ │ ├── x509_vfy.h │ │ │ ├── x509err.h │ │ │ ├── x509v3.h │ │ │ └── x509v3err.h │ └── lib │ │ ├── libcrypto_static.lib │ │ └── libssl_static.lib ├── include │ └── ncmlib │ │ └── ncmdump.h ├── ncmlib.vcxproj ├── ncmlib.vcxproj.filters ├── ncmlib.vcxproj.user └── src │ ├── base64.cpp │ ├── base64.h │ ├── ncmdump.cpp │ ├── pkcs7.cpp │ ├── pkcs7.h │ └── rapidjson │ ├── allocators.h │ ├── cursorstreamwrapper.h │ ├── document.h │ ├── encodedstream.h │ ├── encodings.h │ ├── error │ ├── en.h │ └── error.h │ ├── filereadstream.h │ ├── filewritestream.h │ ├── fwd.h │ ├── internal │ ├── biginteger.h │ ├── clzll.h │ ├── diyfp.h │ ├── dtoa.h │ ├── ieee754.h │ ├── itoa.h │ ├── meta.h │ ├── pow10.h │ ├── regex.h │ ├── stack.h │ ├── strfunc.h │ ├── strtod.h │ └── swap.h │ ├── istreamwrapper.h │ ├── memorybuffer.h │ ├── memorystream.h │ ├── msinttypes │ ├── inttypes.h │ └── stdint.h │ ├── ostreamwrapper.h │ ├── pointer.h │ ├── prettywriter.h │ ├── rapidjson.h │ ├── reader.h │ ├── schema.h │ ├── stream.h │ ├── stringbuffer.h │ ├── uri.h │ └── writer.h ├── ncmpp.sln └── ncmpp ├── ncmpp.vcxproj ├── ncmpp.vcxproj.filters ├── ncmpp.vcxproj.user └── src ├── cmdline.h ├── main.cpp └── pool.h /.gitignore: -------------------------------------------------------------------------------- 1 | /.vs 2 | /build -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Specify the minimum version for CMake 2 | cmake_minimum_required(VERSION 3.20) 3 | 4 | # Project's name 5 | project(ncmpp) 6 | 7 | # Set the C++ standard 8 | set(CMAKE_CXX_STANDARD 17) 9 | set(CMAKE_CXX_STANDARD_REQUIRED True) 10 | 11 | # Add the directories where the header files are located 12 | include_directories(ncmpp/include) 13 | include_directories(ncmlib/include) 14 | 15 | # Add the source files 16 | file(GLOB NCMPP_SRC "ncmpp/src/*.cpp") 17 | file(GLOB NCMLIB_SRC "ncmlib/src/*.cpp") 18 | 19 | # Create the library 20 | add_library(ncmlib ${NCMLIB_SRC}) 21 | 22 | # Create the executable 23 | add_executable(ncmpp ${NCMPP_SRC}) 24 | 25 | # Link the libraries 26 | target_link_libraries(ncmpp ncmlib) 27 | target_link_libraries(ncmpp ssl) 28 | target_link_libraries(ncmpp crypto) 29 | if(WIN32) 30 | link_directories(${CMAKE_SOURCE_DIR}/ncmlib/ext/lib) 31 | endif() 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Majjcom 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Compiler 2 | CXX = g++ 3 | 4 | # Compiler flags 5 | CXXFLAGS = -Wall -Wextra -std=c++17 6 | LDFLAGS = -L./ncmlib -lncmlib -lssl -lcrypto 7 | 8 | # Include directories 9 | INCLUDES = -I./ncmpp/include -I./ncmlib/include 10 | 11 | # Source files 12 | SOURCES_NCMPP = $(wildcard ncmpp/src/*.cpp) 13 | SOURCES_NCMLIB = $(wildcard ncmlib/src/*.cpp) 14 | 15 | # Object files 16 | OBJECTS_NCMPP = $(SOURCES_NCMPP:.cpp=.o) 17 | OBJECTS_NCMLIB = $(SOURCES_NCMLIB:.cpp=.o) 18 | 19 | # Output binary for ncmpp and static library for ncmlib 20 | OUTPUT_NCMPP = ncmpp/ncmpp 21 | OUTPUT_NCMLIB = ncmlib/libncmlib.a 22 | 23 | # Default target 24 | all: $(OUTPUT_NCMLIB) $(OUTPUT_NCMPP) 25 | 26 | $(OUTPUT_NCMPP): $(OBJECTS_NCMPP) $(OUTPUT_NCMLIB) 27 | $(CXX) $(CXXFLAGS) $(INCLUDES) -o $@ $(OBJECTS_NCMPP) $(LDFLAGS) 28 | 29 | $(OUTPUT_NCMLIB): $(OBJECTS_NCMLIB) 30 | ar qc $@ $^ 31 | ranlib $@ 32 | 33 | %.o: %.cpp 34 | $(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@ 35 | 36 | # Clean target 37 | clean: 38 | rm -f $(OBJECTS_NCMPP) $(OBJECTS_NCMLIB) $(OUTPUT_NCMPP) $(OUTPUT_NCMLIB) 39 | 40 | .PHONY: all clean 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ncmpp 2 | 3 | 一个极速的多线程ncm解密器 4 | 5 | 建议使用带有图形界面的版本:[ncmppGui](https://github.com/Majjcom/ncmppGui) 6 | 7 | ## 使用方法 8 | 9 | ### 快速开始 10 | 11 | - 下载`Release`中最新版本的可执行文件 12 | 13 | - 将文件复制到有`ncm`文件的目录中 14 | 15 | - 双击运行程序 16 | 17 | - 等待解密完成 18 | - 解密后的文件存放在`unlock`文件夹中 19 | 20 | ### 命令行参数 21 | 22 | --threads[t] 最大线解密程数 23 | 24 | --showtime[s] 显示解密消耗的时间 25 | 26 | ## 构建环境 27 | 28 | Windows 10 29 | 30 | Visual Studio 2022 31 | 32 | SDK: 10.0.19041.0 33 | 34 | openssl: 1.1.1s -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/__DECC_INCLUDE_EPILOGUE.H: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | /* 11 | * This file is only used by HP C/C++ on VMS, and is included automatically 12 | * after each header file from this directory 13 | */ 14 | 15 | /* 16 | * The C++ compiler doesn't understand these pragmas, even though it 17 | * understands the corresponding command line qualifier. 18 | */ 19 | #ifndef __cplusplus 20 | /* restore state. Must correspond to the save in __decc_include_prologue.h */ 21 | # pragma names restore 22 | #endif 23 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/__DECC_INCLUDE_PROLOGUE.H: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | /* 11 | * This file is only used by HP C/C++ on VMS, and is included automatically 12 | * after each header file from this directory 13 | */ 14 | 15 | /* 16 | * The C++ compiler doesn't understand these pragmas, even though it 17 | * understands the corresponding command line qualifier. 18 | */ 19 | #ifndef __cplusplus 20 | /* save state */ 21 | # pragma names save 22 | /* have the compiler shorten symbols larger than 31 chars to 23 chars 23 | * followed by a 8 hex char CRC 24 | */ 25 | # pragma names as_is,shortened 26 | #endif 27 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/aes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_AES_H 11 | # define HEADER_AES_H 12 | 13 | # include 14 | 15 | # include 16 | # ifdef __cplusplus 17 | extern "C" { 18 | # endif 19 | 20 | # define AES_ENCRYPT 1 21 | # define AES_DECRYPT 0 22 | 23 | /* 24 | * Because array size can't be a const in C, the following two are macros. 25 | * Both sizes are in bytes. 26 | */ 27 | # define AES_MAXNR 14 28 | # define AES_BLOCK_SIZE 16 29 | 30 | /* This should be a hidden type, but EVP requires that the size be known */ 31 | struct aes_key_st { 32 | # ifdef AES_LONG 33 | unsigned long rd_key[4 * (AES_MAXNR + 1)]; 34 | # else 35 | unsigned int rd_key[4 * (AES_MAXNR + 1)]; 36 | # endif 37 | int rounds; 38 | }; 39 | typedef struct aes_key_st AES_KEY; 40 | 41 | const char *AES_options(void); 42 | 43 | int AES_set_encrypt_key(const unsigned char *userKey, const int bits, 44 | AES_KEY *key); 45 | int AES_set_decrypt_key(const unsigned char *userKey, const int bits, 46 | AES_KEY *key); 47 | 48 | void AES_encrypt(const unsigned char *in, unsigned char *out, 49 | const AES_KEY *key); 50 | void AES_decrypt(const unsigned char *in, unsigned char *out, 51 | const AES_KEY *key); 52 | 53 | void AES_ecb_encrypt(const unsigned char *in, unsigned char *out, 54 | const AES_KEY *key, const int enc); 55 | void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, 56 | size_t length, const AES_KEY *key, 57 | unsigned char *ivec, const int enc); 58 | void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out, 59 | size_t length, const AES_KEY *key, 60 | unsigned char *ivec, int *num, const int enc); 61 | void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out, 62 | size_t length, const AES_KEY *key, 63 | unsigned char *ivec, int *num, const int enc); 64 | void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out, 65 | size_t length, const AES_KEY *key, 66 | unsigned char *ivec, int *num, const int enc); 67 | void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out, 68 | size_t length, const AES_KEY *key, 69 | unsigned char *ivec, int *num); 70 | /* NB: the IV is _two_ blocks long */ 71 | void AES_ige_encrypt(const unsigned char *in, unsigned char *out, 72 | size_t length, const AES_KEY *key, 73 | unsigned char *ivec, const int enc); 74 | /* NB: the IV is _four_ blocks long */ 75 | void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out, 76 | size_t length, const AES_KEY *key, 77 | const AES_KEY *key2, const unsigned char *ivec, 78 | const int enc); 79 | 80 | int AES_wrap_key(AES_KEY *key, const unsigned char *iv, 81 | unsigned char *out, 82 | const unsigned char *in, unsigned int inlen); 83 | int AES_unwrap_key(AES_KEY *key, const unsigned char *iv, 84 | unsigned char *out, 85 | const unsigned char *in, unsigned int inlen); 86 | 87 | 88 | # ifdef __cplusplus 89 | } 90 | # endif 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/applink.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #define APPLINK_STDIN 1 11 | #define APPLINK_STDOUT 2 12 | #define APPLINK_STDERR 3 13 | #define APPLINK_FPRINTF 4 14 | #define APPLINK_FGETS 5 15 | #define APPLINK_FREAD 6 16 | #define APPLINK_FWRITE 7 17 | #define APPLINK_FSETMOD 8 18 | #define APPLINK_FEOF 9 19 | #define APPLINK_FCLOSE 10 /* should not be used */ 20 | 21 | #define APPLINK_FOPEN 11 /* solely for completeness */ 22 | #define APPLINK_FSEEK 12 23 | #define APPLINK_FTELL 13 24 | #define APPLINK_FFLUSH 14 25 | #define APPLINK_FERROR 15 26 | #define APPLINK_CLEARERR 16 27 | #define APPLINK_FILENO 17 /* to be used with below */ 28 | 29 | #define APPLINK_OPEN 18 /* formally can't be used, as flags can vary */ 30 | #define APPLINK_READ 19 31 | #define APPLINK_WRITE 20 32 | #define APPLINK_LSEEK 21 33 | #define APPLINK_CLOSE 22 34 | #define APPLINK_MAX 22 /* always same as last macro */ 35 | 36 | #ifndef APPMACROS_ONLY 37 | # include 38 | # include 39 | # include 40 | 41 | static void *app_stdin(void) 42 | { 43 | return stdin; 44 | } 45 | 46 | static void *app_stdout(void) 47 | { 48 | return stdout; 49 | } 50 | 51 | static void *app_stderr(void) 52 | { 53 | return stderr; 54 | } 55 | 56 | static int app_feof(FILE *fp) 57 | { 58 | return feof(fp); 59 | } 60 | 61 | static int app_ferror(FILE *fp) 62 | { 63 | return ferror(fp); 64 | } 65 | 66 | static void app_clearerr(FILE *fp) 67 | { 68 | clearerr(fp); 69 | } 70 | 71 | static int app_fileno(FILE *fp) 72 | { 73 | return _fileno(fp); 74 | } 75 | 76 | static int app_fsetmod(FILE *fp, char mod) 77 | { 78 | return _setmode(_fileno(fp), mod == 'b' ? _O_BINARY : _O_TEXT); 79 | } 80 | 81 | #ifdef __cplusplus 82 | extern "C" { 83 | #endif 84 | 85 | __declspec(dllexport) 86 | void ** 87 | # if defined(__BORLANDC__) 88 | /* 89 | * __stdcall appears to be the only way to get the name 90 | * decoration right with Borland C. Otherwise it works 91 | * purely incidentally, as we pass no parameters. 92 | */ 93 | __stdcall 94 | # else 95 | __cdecl 96 | # endif 97 | OPENSSL_Applink(void) 98 | { 99 | static int once = 1; 100 | static void *OPENSSL_ApplinkTable[APPLINK_MAX + 1] = 101 | { (void *)APPLINK_MAX }; 102 | 103 | if (once) { 104 | OPENSSL_ApplinkTable[APPLINK_STDIN] = app_stdin; 105 | OPENSSL_ApplinkTable[APPLINK_STDOUT] = app_stdout; 106 | OPENSSL_ApplinkTable[APPLINK_STDERR] = app_stderr; 107 | OPENSSL_ApplinkTable[APPLINK_FPRINTF] = fprintf; 108 | OPENSSL_ApplinkTable[APPLINK_FGETS] = fgets; 109 | OPENSSL_ApplinkTable[APPLINK_FREAD] = fread; 110 | OPENSSL_ApplinkTable[APPLINK_FWRITE] = fwrite; 111 | OPENSSL_ApplinkTable[APPLINK_FSETMOD] = app_fsetmod; 112 | OPENSSL_ApplinkTable[APPLINK_FEOF] = app_feof; 113 | OPENSSL_ApplinkTable[APPLINK_FCLOSE] = fclose; 114 | 115 | OPENSSL_ApplinkTable[APPLINK_FOPEN] = fopen; 116 | OPENSSL_ApplinkTable[APPLINK_FSEEK] = fseek; 117 | OPENSSL_ApplinkTable[APPLINK_FTELL] = ftell; 118 | OPENSSL_ApplinkTable[APPLINK_FFLUSH] = fflush; 119 | OPENSSL_ApplinkTable[APPLINK_FERROR] = app_ferror; 120 | OPENSSL_ApplinkTable[APPLINK_CLEARERR] = app_clearerr; 121 | OPENSSL_ApplinkTable[APPLINK_FILENO] = app_fileno; 122 | 123 | OPENSSL_ApplinkTable[APPLINK_OPEN] = _open; 124 | OPENSSL_ApplinkTable[APPLINK_READ] = _read; 125 | OPENSSL_ApplinkTable[APPLINK_WRITE] = _write; 126 | OPENSSL_ApplinkTable[APPLINK_LSEEK] = _lseek; 127 | OPENSSL_ApplinkTable[APPLINK_CLOSE] = _close; 128 | 129 | once = 0; 130 | } 131 | 132 | return OPENSSL_ApplinkTable; 133 | } 134 | 135 | #ifdef __cplusplus 136 | } 137 | #endif 138 | #endif 139 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/asn1_mac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #error "This file is obsolete; please update your software." 11 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/async.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #include 11 | 12 | #ifndef HEADER_ASYNC_H 13 | # define HEADER_ASYNC_H 14 | 15 | #if defined(_WIN32) 16 | # if defined(BASETYPES) || defined(_WINDEF_H) 17 | /* application has to include to use this */ 18 | #define OSSL_ASYNC_FD HANDLE 19 | #define OSSL_BAD_ASYNC_FD INVALID_HANDLE_VALUE 20 | # endif 21 | #else 22 | #define OSSL_ASYNC_FD int 23 | #define OSSL_BAD_ASYNC_FD -1 24 | #endif 25 | # include 26 | 27 | 28 | # ifdef __cplusplus 29 | extern "C" { 30 | # endif 31 | 32 | typedef struct async_job_st ASYNC_JOB; 33 | typedef struct async_wait_ctx_st ASYNC_WAIT_CTX; 34 | 35 | #define ASYNC_ERR 0 36 | #define ASYNC_NO_JOBS 1 37 | #define ASYNC_PAUSE 2 38 | #define ASYNC_FINISH 3 39 | 40 | int ASYNC_init_thread(size_t max_size, size_t init_size); 41 | void ASYNC_cleanup_thread(void); 42 | 43 | #ifdef OSSL_ASYNC_FD 44 | ASYNC_WAIT_CTX *ASYNC_WAIT_CTX_new(void); 45 | void ASYNC_WAIT_CTX_free(ASYNC_WAIT_CTX *ctx); 46 | int ASYNC_WAIT_CTX_set_wait_fd(ASYNC_WAIT_CTX *ctx, const void *key, 47 | OSSL_ASYNC_FD fd, 48 | void *custom_data, 49 | void (*cleanup)(ASYNC_WAIT_CTX *, const void *, 50 | OSSL_ASYNC_FD, void *)); 51 | int ASYNC_WAIT_CTX_get_fd(ASYNC_WAIT_CTX *ctx, const void *key, 52 | OSSL_ASYNC_FD *fd, void **custom_data); 53 | int ASYNC_WAIT_CTX_get_all_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *fd, 54 | size_t *numfds); 55 | int ASYNC_WAIT_CTX_get_changed_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *addfd, 56 | size_t *numaddfds, OSSL_ASYNC_FD *delfd, 57 | size_t *numdelfds); 58 | int ASYNC_WAIT_CTX_clear_fd(ASYNC_WAIT_CTX *ctx, const void *key); 59 | #endif 60 | 61 | int ASYNC_is_capable(void); 62 | 63 | int ASYNC_start_job(ASYNC_JOB **job, ASYNC_WAIT_CTX *ctx, int *ret, 64 | int (*func)(void *), void *args, size_t size); 65 | int ASYNC_pause_job(void); 66 | 67 | ASYNC_JOB *ASYNC_get_current_job(void); 68 | ASYNC_WAIT_CTX *ASYNC_get_wait_ctx(ASYNC_JOB *job); 69 | void ASYNC_block_pause(void); 70 | void ASYNC_unblock_pause(void); 71 | 72 | 73 | # ifdef __cplusplus 74 | } 75 | # endif 76 | #endif 77 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/asyncerr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_ASYNCERR_H 12 | # define HEADER_ASYNCERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # ifdef __cplusplus 19 | extern "C" 20 | # endif 21 | int ERR_load_ASYNC_strings(void); 22 | 23 | /* 24 | * ASYNC function codes. 25 | */ 26 | # define ASYNC_F_ASYNC_CTX_NEW 100 27 | # define ASYNC_F_ASYNC_INIT_THREAD 101 28 | # define ASYNC_F_ASYNC_JOB_NEW 102 29 | # define ASYNC_F_ASYNC_PAUSE_JOB 103 30 | # define ASYNC_F_ASYNC_START_FUNC 104 31 | # define ASYNC_F_ASYNC_START_JOB 105 32 | # define ASYNC_F_ASYNC_WAIT_CTX_SET_WAIT_FD 106 33 | 34 | /* 35 | * ASYNC reason codes. 36 | */ 37 | # define ASYNC_R_FAILED_TO_SET_POOL 101 38 | # define ASYNC_R_FAILED_TO_SWAP_CONTEXT 102 39 | # define ASYNC_R_INIT_FAILED 105 40 | # define ASYNC_R_INVALID_POOL_SIZE 103 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/blowfish.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_BLOWFISH_H 11 | # define HEADER_BLOWFISH_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_BF 16 | # include 17 | # ifdef __cplusplus 18 | extern "C" { 19 | # endif 20 | 21 | # define BF_ENCRYPT 1 22 | # define BF_DECRYPT 0 23 | 24 | /*- 25 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 26 | * ! BF_LONG has to be at least 32 bits wide. ! 27 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 28 | */ 29 | # define BF_LONG unsigned int 30 | 31 | # define BF_ROUNDS 16 32 | # define BF_BLOCK 8 33 | 34 | typedef struct bf_key_st { 35 | BF_LONG P[BF_ROUNDS + 2]; 36 | BF_LONG S[4 * 256]; 37 | } BF_KEY; 38 | 39 | void BF_set_key(BF_KEY *key, int len, const unsigned char *data); 40 | 41 | void BF_encrypt(BF_LONG *data, const BF_KEY *key); 42 | void BF_decrypt(BF_LONG *data, const BF_KEY *key); 43 | 44 | void BF_ecb_encrypt(const unsigned char *in, unsigned char *out, 45 | const BF_KEY *key, int enc); 46 | void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, 47 | const BF_KEY *schedule, unsigned char *ivec, int enc); 48 | void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out, 49 | long length, const BF_KEY *schedule, 50 | unsigned char *ivec, int *num, int enc); 51 | void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out, 52 | long length, const BF_KEY *schedule, 53 | unsigned char *ivec, int *num); 54 | const char *BF_options(void); 55 | 56 | # ifdef __cplusplus 57 | } 58 | # endif 59 | # endif 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/bnerr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_BNERR_H 12 | # define HEADER_BNERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # ifdef __cplusplus 19 | extern "C" 20 | # endif 21 | int ERR_load_BN_strings(void); 22 | 23 | /* 24 | * BN function codes. 25 | */ 26 | # define BN_F_BNRAND 127 27 | # define BN_F_BNRAND_RANGE 138 28 | # define BN_F_BN_BLINDING_CONVERT_EX 100 29 | # define BN_F_BN_BLINDING_CREATE_PARAM 128 30 | # define BN_F_BN_BLINDING_INVERT_EX 101 31 | # define BN_F_BN_BLINDING_NEW 102 32 | # define BN_F_BN_BLINDING_UPDATE 103 33 | # define BN_F_BN_BN2DEC 104 34 | # define BN_F_BN_BN2HEX 105 35 | # define BN_F_BN_COMPUTE_WNAF 142 36 | # define BN_F_BN_CTX_GET 116 37 | # define BN_F_BN_CTX_NEW 106 38 | # define BN_F_BN_CTX_START 129 39 | # define BN_F_BN_DIV 107 40 | # define BN_F_BN_DIV_RECP 130 41 | # define BN_F_BN_EXP 123 42 | # define BN_F_BN_EXPAND_INTERNAL 120 43 | # define BN_F_BN_GENCB_NEW 143 44 | # define BN_F_BN_GENERATE_DSA_NONCE 140 45 | # define BN_F_BN_GENERATE_PRIME_EX 141 46 | # define BN_F_BN_GF2M_MOD 131 47 | # define BN_F_BN_GF2M_MOD_EXP 132 48 | # define BN_F_BN_GF2M_MOD_MUL 133 49 | # define BN_F_BN_GF2M_MOD_SOLVE_QUAD 134 50 | # define BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR 135 51 | # define BN_F_BN_GF2M_MOD_SQR 136 52 | # define BN_F_BN_GF2M_MOD_SQRT 137 53 | # define BN_F_BN_LSHIFT 145 54 | # define BN_F_BN_MOD_EXP2_MONT 118 55 | # define BN_F_BN_MOD_EXP_MONT 109 56 | # define BN_F_BN_MOD_EXP_MONT_CONSTTIME 124 57 | # define BN_F_BN_MOD_EXP_MONT_WORD 117 58 | # define BN_F_BN_MOD_EXP_RECP 125 59 | # define BN_F_BN_MOD_EXP_SIMPLE 126 60 | # define BN_F_BN_MOD_INVERSE 110 61 | # define BN_F_BN_MOD_INVERSE_NO_BRANCH 139 62 | # define BN_F_BN_MOD_LSHIFT_QUICK 119 63 | # define BN_F_BN_MOD_SQRT 121 64 | # define BN_F_BN_MONT_CTX_NEW 149 65 | # define BN_F_BN_MPI2BN 112 66 | # define BN_F_BN_NEW 113 67 | # define BN_F_BN_POOL_GET 147 68 | # define BN_F_BN_RAND 114 69 | # define BN_F_BN_RAND_RANGE 122 70 | # define BN_F_BN_RECP_CTX_NEW 150 71 | # define BN_F_BN_RSHIFT 146 72 | # define BN_F_BN_SET_WORDS 144 73 | # define BN_F_BN_STACK_PUSH 148 74 | # define BN_F_BN_USUB 115 75 | 76 | /* 77 | * BN reason codes. 78 | */ 79 | # define BN_R_ARG2_LT_ARG3 100 80 | # define BN_R_BAD_RECIPROCAL 101 81 | # define BN_R_BIGNUM_TOO_LONG 114 82 | # define BN_R_BITS_TOO_SMALL 118 83 | # define BN_R_CALLED_WITH_EVEN_MODULUS 102 84 | # define BN_R_DIV_BY_ZERO 103 85 | # define BN_R_ENCODING_ERROR 104 86 | # define BN_R_EXPAND_ON_STATIC_BIGNUM_DATA 105 87 | # define BN_R_INPUT_NOT_REDUCED 110 88 | # define BN_R_INVALID_LENGTH 106 89 | # define BN_R_INVALID_RANGE 115 90 | # define BN_R_INVALID_SHIFT 119 91 | # define BN_R_NOT_A_SQUARE 111 92 | # define BN_R_NOT_INITIALIZED 107 93 | # define BN_R_NO_INVERSE 108 94 | # define BN_R_NO_SOLUTION 116 95 | # define BN_R_PRIVATE_KEY_TOO_LARGE 117 96 | # define BN_R_P_IS_NOT_PRIME 112 97 | # define BN_R_TOO_MANY_ITERATIONS 113 98 | # define BN_R_TOO_MANY_TEMPORARY_VARIABLES 109 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/buffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_BUFFER_H 11 | # define HEADER_BUFFER_H 12 | 13 | # include 14 | # ifndef HEADER_CRYPTO_H 15 | # include 16 | # endif 17 | # include 18 | 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | # include 25 | # include 26 | 27 | /* 28 | * These names are outdated as of OpenSSL 1.1; a future release 29 | * will move them to be deprecated. 30 | */ 31 | # define BUF_strdup(s) OPENSSL_strdup(s) 32 | # define BUF_strndup(s, size) OPENSSL_strndup(s, size) 33 | # define BUF_memdup(data, size) OPENSSL_memdup(data, size) 34 | # define BUF_strlcpy(dst, src, size) OPENSSL_strlcpy(dst, src, size) 35 | # define BUF_strlcat(dst, src, size) OPENSSL_strlcat(dst, src, size) 36 | # define BUF_strnlen(str, maxlen) OPENSSL_strnlen(str, maxlen) 37 | 38 | struct buf_mem_st { 39 | size_t length; /* current number of bytes */ 40 | char *data; 41 | size_t max; /* size of buffer */ 42 | unsigned long flags; 43 | }; 44 | 45 | # define BUF_MEM_FLAG_SECURE 0x01 46 | 47 | BUF_MEM *BUF_MEM_new(void); 48 | BUF_MEM *BUF_MEM_new_ex(unsigned long flags); 49 | void BUF_MEM_free(BUF_MEM *a); 50 | size_t BUF_MEM_grow(BUF_MEM *str, size_t len); 51 | size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len); 52 | void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz); 53 | 54 | 55 | # ifdef __cplusplus 56 | } 57 | # endif 58 | #endif 59 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/buffererr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_BUFERR_H 12 | # define HEADER_BUFERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # ifdef __cplusplus 19 | extern "C" 20 | # endif 21 | int ERR_load_BUF_strings(void); 22 | 23 | /* 24 | * BUF function codes. 25 | */ 26 | # define BUF_F_BUF_MEM_GROW 100 27 | # define BUF_F_BUF_MEM_GROW_CLEAN 105 28 | # define BUF_F_BUF_MEM_NEW 101 29 | 30 | /* 31 | * BUF reason codes. 32 | */ 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/camellia.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_CAMELLIA_H 11 | # define HEADER_CAMELLIA_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_CAMELLIA 16 | # include 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | # define CAMELLIA_ENCRYPT 1 22 | # define CAMELLIA_DECRYPT 0 23 | 24 | /* 25 | * Because array size can't be a const in C, the following two are macros. 26 | * Both sizes are in bytes. 27 | */ 28 | 29 | /* This should be a hidden type, but EVP requires that the size be known */ 30 | 31 | # define CAMELLIA_BLOCK_SIZE 16 32 | # define CAMELLIA_TABLE_BYTE_LEN 272 33 | # define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4) 34 | 35 | typedef unsigned int KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN]; /* to match 36 | * with WORD */ 37 | 38 | struct camellia_key_st { 39 | union { 40 | double d; /* ensures 64-bit align */ 41 | KEY_TABLE_TYPE rd_key; 42 | } u; 43 | int grand_rounds; 44 | }; 45 | typedef struct camellia_key_st CAMELLIA_KEY; 46 | 47 | int Camellia_set_key(const unsigned char *userKey, const int bits, 48 | CAMELLIA_KEY *key); 49 | 50 | void Camellia_encrypt(const unsigned char *in, unsigned char *out, 51 | const CAMELLIA_KEY *key); 52 | void Camellia_decrypt(const unsigned char *in, unsigned char *out, 53 | const CAMELLIA_KEY *key); 54 | 55 | void Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out, 56 | const CAMELLIA_KEY *key, const int enc); 57 | void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out, 58 | size_t length, const CAMELLIA_KEY *key, 59 | unsigned char *ivec, const int enc); 60 | void Camellia_cfb128_encrypt(const unsigned char *in, unsigned char *out, 61 | size_t length, const CAMELLIA_KEY *key, 62 | unsigned char *ivec, int *num, const int enc); 63 | void Camellia_cfb1_encrypt(const unsigned char *in, unsigned char *out, 64 | size_t length, const CAMELLIA_KEY *key, 65 | unsigned char *ivec, int *num, const int enc); 66 | void Camellia_cfb8_encrypt(const unsigned char *in, unsigned char *out, 67 | size_t length, const CAMELLIA_KEY *key, 68 | unsigned char *ivec, int *num, const int enc); 69 | void Camellia_ofb128_encrypt(const unsigned char *in, unsigned char *out, 70 | size_t length, const CAMELLIA_KEY *key, 71 | unsigned char *ivec, int *num); 72 | void Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out, 73 | size_t length, const CAMELLIA_KEY *key, 74 | unsigned char ivec[CAMELLIA_BLOCK_SIZE], 75 | unsigned char ecount_buf[CAMELLIA_BLOCK_SIZE], 76 | unsigned int *num); 77 | 78 | # ifdef __cplusplus 79 | } 80 | # endif 81 | # endif 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/cast.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_CAST_H 11 | # define HEADER_CAST_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_CAST 16 | # ifdef __cplusplus 17 | extern "C" { 18 | # endif 19 | 20 | # define CAST_ENCRYPT 1 21 | # define CAST_DECRYPT 0 22 | 23 | # define CAST_LONG unsigned int 24 | 25 | # define CAST_BLOCK 8 26 | # define CAST_KEY_LENGTH 16 27 | 28 | typedef struct cast_key_st { 29 | CAST_LONG data[32]; 30 | int short_key; /* Use reduced rounds for short key */ 31 | } CAST_KEY; 32 | 33 | void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data); 34 | void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out, 35 | const CAST_KEY *key, int enc); 36 | void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key); 37 | void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key); 38 | void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out, 39 | long length, const CAST_KEY *ks, unsigned char *iv, 40 | int enc); 41 | void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out, 42 | long length, const CAST_KEY *schedule, 43 | unsigned char *ivec, int *num, int enc); 44 | void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out, 45 | long length, const CAST_KEY *schedule, 46 | unsigned char *ivec, int *num); 47 | 48 | # ifdef __cplusplus 49 | } 50 | # endif 51 | # endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/cmac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_CMAC_H 11 | # define HEADER_CMAC_H 12 | 13 | # ifndef OPENSSL_NO_CMAC 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | # include 20 | 21 | /* Opaque */ 22 | typedef struct CMAC_CTX_st CMAC_CTX; 23 | 24 | CMAC_CTX *CMAC_CTX_new(void); 25 | void CMAC_CTX_cleanup(CMAC_CTX *ctx); 26 | void CMAC_CTX_free(CMAC_CTX *ctx); 27 | EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx); 28 | int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in); 29 | 30 | int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen, 31 | const EVP_CIPHER *cipher, ENGINE *impl); 32 | int CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen); 33 | int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen); 34 | int CMAC_resume(CMAC_CTX *ctx); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | # endif 41 | #endif 42 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/comp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_COMP_H 11 | # define HEADER_COMP_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_COMP 16 | # include 17 | # include 18 | # ifdef __cplusplus 19 | extern "C" { 20 | # endif 21 | 22 | 23 | 24 | COMP_CTX *COMP_CTX_new(COMP_METHOD *meth); 25 | const COMP_METHOD *COMP_CTX_get_method(const COMP_CTX *ctx); 26 | int COMP_CTX_get_type(const COMP_CTX* comp); 27 | int COMP_get_type(const COMP_METHOD *meth); 28 | const char *COMP_get_name(const COMP_METHOD *meth); 29 | void COMP_CTX_free(COMP_CTX *ctx); 30 | 31 | int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen, 32 | unsigned char *in, int ilen); 33 | int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen, 34 | unsigned char *in, int ilen); 35 | 36 | COMP_METHOD *COMP_zlib(void); 37 | 38 | #if OPENSSL_API_COMPAT < 0x10100000L 39 | #define COMP_zlib_cleanup() while(0) continue 40 | #endif 41 | 42 | # ifdef HEADER_BIO_H 43 | # ifdef ZLIB 44 | const BIO_METHOD *BIO_f_zlib(void); 45 | # endif 46 | # endif 47 | 48 | 49 | # ifdef __cplusplus 50 | } 51 | # endif 52 | # endif 53 | #endif 54 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/comperr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_COMPERR_H 12 | # define HEADER_COMPERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # include 19 | 20 | # ifndef OPENSSL_NO_COMP 21 | 22 | # ifdef __cplusplus 23 | extern "C" 24 | # endif 25 | int ERR_load_COMP_strings(void); 26 | 27 | /* 28 | * COMP function codes. 29 | */ 30 | # define COMP_F_BIO_ZLIB_FLUSH 99 31 | # define COMP_F_BIO_ZLIB_NEW 100 32 | # define COMP_F_BIO_ZLIB_READ 101 33 | # define COMP_F_BIO_ZLIB_WRITE 102 34 | # define COMP_F_COMP_CTX_NEW 103 35 | 36 | /* 37 | * COMP reason codes. 38 | */ 39 | # define COMP_R_ZLIB_DEFLATE_ERROR 99 40 | # define COMP_R_ZLIB_INFLATE_ERROR 100 41 | # define COMP_R_ZLIB_NOT_SUPPORTED 101 42 | 43 | # endif 44 | #endif 45 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/conf_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_CONF_API_H 11 | # define HEADER_CONF_API_H 12 | 13 | # include 14 | # include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /* Up until OpenSSL 0.9.5a, this was new_section */ 21 | CONF_VALUE *_CONF_new_section(CONF *conf, const char *section); 22 | /* Up until OpenSSL 0.9.5a, this was get_section */ 23 | CONF_VALUE *_CONF_get_section(const CONF *conf, const char *section); 24 | /* Up until OpenSSL 0.9.5a, this was CONF_get_section */ 25 | STACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf, 26 | const char *section); 27 | 28 | int _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value); 29 | char *_CONF_get_string(const CONF *conf, const char *section, 30 | const char *name); 31 | long _CONF_get_number(const CONF *conf, const char *section, 32 | const char *name); 33 | 34 | int _CONF_new_data(CONF *conf); 35 | void _CONF_free_data(CONF *conf); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif 41 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/conferr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_CONFERR_H 12 | # define HEADER_CONFERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # ifdef __cplusplus 19 | extern "C" 20 | # endif 21 | int ERR_load_CONF_strings(void); 22 | 23 | /* 24 | * CONF function codes. 25 | */ 26 | # define CONF_F_CONF_DUMP_FP 104 27 | # define CONF_F_CONF_LOAD 100 28 | # define CONF_F_CONF_LOAD_FP 103 29 | # define CONF_F_CONF_PARSE_LIST 119 30 | # define CONF_F_DEF_LOAD 120 31 | # define CONF_F_DEF_LOAD_BIO 121 32 | # define CONF_F_GET_NEXT_FILE 107 33 | # define CONF_F_MODULE_ADD 122 34 | # define CONF_F_MODULE_INIT 115 35 | # define CONF_F_MODULE_LOAD_DSO 117 36 | # define CONF_F_MODULE_RUN 118 37 | # define CONF_F_NCONF_DUMP_BIO 105 38 | # define CONF_F_NCONF_DUMP_FP 106 39 | # define CONF_F_NCONF_GET_NUMBER_E 112 40 | # define CONF_F_NCONF_GET_SECTION 108 41 | # define CONF_F_NCONF_GET_STRING 109 42 | # define CONF_F_NCONF_LOAD 113 43 | # define CONF_F_NCONF_LOAD_BIO 110 44 | # define CONF_F_NCONF_LOAD_FP 114 45 | # define CONF_F_NCONF_NEW 111 46 | # define CONF_F_PROCESS_INCLUDE 116 47 | # define CONF_F_SSL_MODULE_INIT 123 48 | # define CONF_F_STR_COPY 101 49 | 50 | /* 51 | * CONF reason codes. 52 | */ 53 | # define CONF_R_ERROR_LOADING_DSO 110 54 | # define CONF_R_LIST_CANNOT_BE_NULL 115 55 | # define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100 56 | # define CONF_R_MISSING_EQUAL_SIGN 101 57 | # define CONF_R_MISSING_INIT_FUNCTION 112 58 | # define CONF_R_MODULE_INITIALIZATION_ERROR 109 59 | # define CONF_R_NO_CLOSE_BRACE 102 60 | # define CONF_R_NO_CONF 105 61 | # define CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE 106 62 | # define CONF_R_NO_SECTION 107 63 | # define CONF_R_NO_SUCH_FILE 114 64 | # define CONF_R_NO_VALUE 108 65 | # define CONF_R_NUMBER_TOO_LARGE 121 66 | # define CONF_R_RECURSIVE_DIRECTORY_INCLUDE 111 67 | # define CONF_R_SSL_COMMAND_SECTION_EMPTY 117 68 | # define CONF_R_SSL_COMMAND_SECTION_NOT_FOUND 118 69 | # define CONF_R_SSL_SECTION_EMPTY 119 70 | # define CONF_R_SSL_SECTION_NOT_FOUND 120 71 | # define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103 72 | # define CONF_R_UNKNOWN_MODULE_NAME 113 73 | # define CONF_R_VARIABLE_EXPANSION_TOO_LONG 116 74 | # define CONF_R_VARIABLE_HAS_NO_VALUE 104 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/cryptoerr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_CRYPTOERR_H 12 | # define HEADER_CRYPTOERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # ifdef __cplusplus 19 | extern "C" 20 | # endif 21 | int ERR_load_CRYPTO_strings(void); 22 | 23 | /* 24 | * CRYPTO function codes. 25 | */ 26 | # define CRYPTO_F_CMAC_CTX_NEW 120 27 | # define CRYPTO_F_CRYPTO_DUP_EX_DATA 110 28 | # define CRYPTO_F_CRYPTO_FREE_EX_DATA 111 29 | # define CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX 100 30 | # define CRYPTO_F_CRYPTO_MEMDUP 115 31 | # define CRYPTO_F_CRYPTO_NEW_EX_DATA 112 32 | # define CRYPTO_F_CRYPTO_OCB128_COPY_CTX 121 33 | # define CRYPTO_F_CRYPTO_OCB128_INIT 122 34 | # define CRYPTO_F_CRYPTO_SET_EX_DATA 102 35 | # define CRYPTO_F_FIPS_MODE_SET 109 36 | # define CRYPTO_F_GET_AND_LOCK 113 37 | # define CRYPTO_F_OPENSSL_ATEXIT 114 38 | # define CRYPTO_F_OPENSSL_BUF2HEXSTR 117 39 | # define CRYPTO_F_OPENSSL_FOPEN 119 40 | # define CRYPTO_F_OPENSSL_HEXSTR2BUF 118 41 | # define CRYPTO_F_OPENSSL_INIT_CRYPTO 116 42 | # define CRYPTO_F_OPENSSL_LH_NEW 126 43 | # define CRYPTO_F_OPENSSL_SK_DEEP_COPY 127 44 | # define CRYPTO_F_OPENSSL_SK_DUP 128 45 | # define CRYPTO_F_PKEY_HMAC_INIT 123 46 | # define CRYPTO_F_PKEY_POLY1305_INIT 124 47 | # define CRYPTO_F_PKEY_SIPHASH_INIT 125 48 | # define CRYPTO_F_SK_RESERVE 129 49 | 50 | /* 51 | * CRYPTO reason codes. 52 | */ 53 | # define CRYPTO_R_FIPS_MODE_NOT_SUPPORTED 101 54 | # define CRYPTO_R_ILLEGAL_HEX_DIGIT 102 55 | # define CRYPTO_R_ODD_NUMBER_OF_DIGITS 103 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/cterr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_CTERR_H 12 | # define HEADER_CTERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # include 19 | 20 | # ifndef OPENSSL_NO_CT 21 | 22 | # ifdef __cplusplus 23 | extern "C" 24 | # endif 25 | int ERR_load_CT_strings(void); 26 | 27 | /* 28 | * CT function codes. 29 | */ 30 | # define CT_F_CTLOG_NEW 117 31 | # define CT_F_CTLOG_NEW_FROM_BASE64 118 32 | # define CT_F_CTLOG_NEW_FROM_CONF 119 33 | # define CT_F_CTLOG_STORE_LOAD_CTX_NEW 122 34 | # define CT_F_CTLOG_STORE_LOAD_FILE 123 35 | # define CT_F_CTLOG_STORE_LOAD_LOG 130 36 | # define CT_F_CTLOG_STORE_NEW 131 37 | # define CT_F_CT_BASE64_DECODE 124 38 | # define CT_F_CT_POLICY_EVAL_CTX_NEW 133 39 | # define CT_F_CT_V1_LOG_ID_FROM_PKEY 125 40 | # define CT_F_I2O_SCT 107 41 | # define CT_F_I2O_SCT_LIST 108 42 | # define CT_F_I2O_SCT_SIGNATURE 109 43 | # define CT_F_O2I_SCT 110 44 | # define CT_F_O2I_SCT_LIST 111 45 | # define CT_F_O2I_SCT_SIGNATURE 112 46 | # define CT_F_SCT_CTX_NEW 126 47 | # define CT_F_SCT_CTX_VERIFY 128 48 | # define CT_F_SCT_NEW 100 49 | # define CT_F_SCT_NEW_FROM_BASE64 127 50 | # define CT_F_SCT_SET0_LOG_ID 101 51 | # define CT_F_SCT_SET1_EXTENSIONS 114 52 | # define CT_F_SCT_SET1_LOG_ID 115 53 | # define CT_F_SCT_SET1_SIGNATURE 116 54 | # define CT_F_SCT_SET_LOG_ENTRY_TYPE 102 55 | # define CT_F_SCT_SET_SIGNATURE_NID 103 56 | # define CT_F_SCT_SET_VERSION 104 57 | 58 | /* 59 | * CT reason codes. 60 | */ 61 | # define CT_R_BASE64_DECODE_ERROR 108 62 | # define CT_R_INVALID_LOG_ID_LENGTH 100 63 | # define CT_R_LOG_CONF_INVALID 109 64 | # define CT_R_LOG_CONF_INVALID_KEY 110 65 | # define CT_R_LOG_CONF_MISSING_DESCRIPTION 111 66 | # define CT_R_LOG_CONF_MISSING_KEY 112 67 | # define CT_R_LOG_KEY_INVALID 113 68 | # define CT_R_SCT_FUTURE_TIMESTAMP 116 69 | # define CT_R_SCT_INVALID 104 70 | # define CT_R_SCT_INVALID_SIGNATURE 107 71 | # define CT_R_SCT_LIST_INVALID 105 72 | # define CT_R_SCT_LOG_ID_MISMATCH 114 73 | # define CT_R_SCT_NOT_SET 106 74 | # define CT_R_SCT_UNSUPPORTED_VERSION 115 75 | # define CT_R_UNRECOGNIZED_SIGNATURE_NID 101 76 | # define CT_R_UNSUPPORTED_ENTRY_TYPE 102 77 | # define CT_R_UNSUPPORTED_VERSION 103 78 | 79 | # endif 80 | #endif 81 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/dherr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_DHERR_H 12 | # define HEADER_DHERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # include 19 | 20 | # ifndef OPENSSL_NO_DH 21 | 22 | # ifdef __cplusplus 23 | extern "C" 24 | # endif 25 | int ERR_load_DH_strings(void); 26 | 27 | /* 28 | * DH function codes. 29 | */ 30 | # define DH_F_COMPUTE_KEY 102 31 | # define DH_F_DHPARAMS_PRINT_FP 101 32 | # define DH_F_DH_BUILTIN_GENPARAMS 106 33 | # define DH_F_DH_CHECK_EX 121 34 | # define DH_F_DH_CHECK_PARAMS_EX 122 35 | # define DH_F_DH_CHECK_PUB_KEY_EX 123 36 | # define DH_F_DH_CMS_DECRYPT 114 37 | # define DH_F_DH_CMS_SET_PEERKEY 115 38 | # define DH_F_DH_CMS_SET_SHARED_INFO 116 39 | # define DH_F_DH_METH_DUP 117 40 | # define DH_F_DH_METH_NEW 118 41 | # define DH_F_DH_METH_SET1_NAME 119 42 | # define DH_F_DH_NEW_BY_NID 104 43 | # define DH_F_DH_NEW_METHOD 105 44 | # define DH_F_DH_PARAM_DECODE 107 45 | # define DH_F_DH_PKEY_PUBLIC_CHECK 124 46 | # define DH_F_DH_PRIV_DECODE 110 47 | # define DH_F_DH_PRIV_ENCODE 111 48 | # define DH_F_DH_PUB_DECODE 108 49 | # define DH_F_DH_PUB_ENCODE 109 50 | # define DH_F_DO_DH_PRINT 100 51 | # define DH_F_GENERATE_KEY 103 52 | # define DH_F_PKEY_DH_CTRL_STR 120 53 | # define DH_F_PKEY_DH_DERIVE 112 54 | # define DH_F_PKEY_DH_INIT 125 55 | # define DH_F_PKEY_DH_KEYGEN 113 56 | 57 | /* 58 | * DH reason codes. 59 | */ 60 | # define DH_R_BAD_GENERATOR 101 61 | # define DH_R_BN_DECODE_ERROR 109 62 | # define DH_R_BN_ERROR 106 63 | # define DH_R_CHECK_INVALID_J_VALUE 115 64 | # define DH_R_CHECK_INVALID_Q_VALUE 116 65 | # define DH_R_CHECK_PUBKEY_INVALID 122 66 | # define DH_R_CHECK_PUBKEY_TOO_LARGE 123 67 | # define DH_R_CHECK_PUBKEY_TOO_SMALL 124 68 | # define DH_R_CHECK_P_NOT_PRIME 117 69 | # define DH_R_CHECK_P_NOT_SAFE_PRIME 118 70 | # define DH_R_CHECK_Q_NOT_PRIME 119 71 | # define DH_R_DECODE_ERROR 104 72 | # define DH_R_INVALID_PARAMETER_NAME 110 73 | # define DH_R_INVALID_PARAMETER_NID 114 74 | # define DH_R_INVALID_PUBKEY 102 75 | # define DH_R_KDF_PARAMETER_ERROR 112 76 | # define DH_R_KEYS_NOT_SET 108 77 | # define DH_R_MISSING_PUBKEY 125 78 | # define DH_R_MODULUS_TOO_LARGE 103 79 | # define DH_R_NOT_SUITABLE_GENERATOR 120 80 | # define DH_R_NO_PARAMETERS_SET 107 81 | # define DH_R_NO_PRIVATE_VALUE 100 82 | # define DH_R_PARAMETER_ENCODING_ERROR 105 83 | # define DH_R_PEER_KEY_ERROR 111 84 | # define DH_R_SHARED_INFO_ERROR 113 85 | # define DH_R_UNABLE_TO_CHECK_GENERATOR 121 86 | 87 | # endif 88 | #endif 89 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/dsaerr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_DSAERR_H 12 | # define HEADER_DSAERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # include 19 | 20 | # ifndef OPENSSL_NO_DSA 21 | 22 | # ifdef __cplusplus 23 | extern "C" 24 | # endif 25 | int ERR_load_DSA_strings(void); 26 | 27 | /* 28 | * DSA function codes. 29 | */ 30 | # define DSA_F_DSAPARAMS_PRINT 100 31 | # define DSA_F_DSAPARAMS_PRINT_FP 101 32 | # define DSA_F_DSA_BUILTIN_PARAMGEN 125 33 | # define DSA_F_DSA_BUILTIN_PARAMGEN2 126 34 | # define DSA_F_DSA_DO_SIGN 112 35 | # define DSA_F_DSA_DO_VERIFY 113 36 | # define DSA_F_DSA_METH_DUP 127 37 | # define DSA_F_DSA_METH_NEW 128 38 | # define DSA_F_DSA_METH_SET1_NAME 129 39 | # define DSA_F_DSA_NEW_METHOD 103 40 | # define DSA_F_DSA_PARAM_DECODE 119 41 | # define DSA_F_DSA_PRINT_FP 105 42 | # define DSA_F_DSA_PRIV_DECODE 115 43 | # define DSA_F_DSA_PRIV_ENCODE 116 44 | # define DSA_F_DSA_PUB_DECODE 117 45 | # define DSA_F_DSA_PUB_ENCODE 118 46 | # define DSA_F_DSA_SIGN 106 47 | # define DSA_F_DSA_SIGN_SETUP 107 48 | # define DSA_F_DSA_SIG_NEW 102 49 | # define DSA_F_OLD_DSA_PRIV_DECODE 122 50 | # define DSA_F_PKEY_DSA_CTRL 120 51 | # define DSA_F_PKEY_DSA_CTRL_STR 104 52 | # define DSA_F_PKEY_DSA_KEYGEN 121 53 | 54 | /* 55 | * DSA reason codes. 56 | */ 57 | # define DSA_R_BAD_Q_VALUE 102 58 | # define DSA_R_BN_DECODE_ERROR 108 59 | # define DSA_R_BN_ERROR 109 60 | # define DSA_R_DECODE_ERROR 104 61 | # define DSA_R_INVALID_DIGEST_TYPE 106 62 | # define DSA_R_INVALID_PARAMETERS 112 63 | # define DSA_R_MISSING_PARAMETERS 101 64 | # define DSA_R_MISSING_PRIVATE_KEY 111 65 | # define DSA_R_MODULUS_TOO_LARGE 103 66 | # define DSA_R_NO_PARAMETERS_SET 107 67 | # define DSA_R_PARAMETER_ENCODING_ERROR 105 68 | # define DSA_R_Q_NOT_PRIME 113 69 | # define DSA_R_SEED_LEN_SMALL 110 70 | 71 | # endif 72 | #endif 73 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/dtls1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2005-2018 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_DTLS1_H 11 | # define HEADER_DTLS1_H 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | # define DTLS1_VERSION 0xFEFF 18 | # define DTLS1_2_VERSION 0xFEFD 19 | # define DTLS_MIN_VERSION DTLS1_VERSION 20 | # define DTLS_MAX_VERSION DTLS1_2_VERSION 21 | # define DTLS1_VERSION_MAJOR 0xFE 22 | 23 | # define DTLS1_BAD_VER 0x0100 24 | 25 | /* Special value for method supporting multiple versions */ 26 | # define DTLS_ANY_VERSION 0x1FFFF 27 | 28 | /* lengths of messages */ 29 | /* 30 | * Actually the max cookie length in DTLS is 255. But we can't change this now 31 | * due to compatibility concerns. 32 | */ 33 | # define DTLS1_COOKIE_LENGTH 256 34 | 35 | # define DTLS1_RT_HEADER_LENGTH 13 36 | 37 | # define DTLS1_HM_HEADER_LENGTH 12 38 | 39 | # define DTLS1_HM_BAD_FRAGMENT -2 40 | # define DTLS1_HM_FRAGMENT_RETRY -3 41 | 42 | # define DTLS1_CCS_HEADER_LENGTH 1 43 | 44 | # define DTLS1_AL_HEADER_LENGTH 2 45 | 46 | /* Timeout multipliers */ 47 | # define DTLS1_TMO_READ_COUNT 2 48 | # define DTLS1_TMO_WRITE_COUNT 2 49 | 50 | # define DTLS1_TMO_ALERT_COUNT 12 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | #endif 56 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/ebcdic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_EBCDIC_H 11 | # define HEADER_EBCDIC_H 12 | 13 | # include 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /* Avoid name clashes with other applications */ 20 | # define os_toascii _openssl_os_toascii 21 | # define os_toebcdic _openssl_os_toebcdic 22 | # define ebcdic2ascii _openssl_ebcdic2ascii 23 | # define ascii2ebcdic _openssl_ascii2ebcdic 24 | 25 | extern const unsigned char os_toascii[256]; 26 | extern const unsigned char os_toebcdic[256]; 27 | void *ebcdic2ascii(void *dest, const void *srce, size_t count); 28 | void *ascii2ebcdic(void *dest, const void *srce, size_t count); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | #endif 34 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/ecdh.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #include 11 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/ecdsa.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #include 11 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/hmac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_HMAC_H 11 | # define HEADER_HMAC_H 12 | 13 | # include 14 | 15 | # include 16 | 17 | # if OPENSSL_API_COMPAT < 0x10200000L 18 | # define HMAC_MAX_MD_CBLOCK 128 /* Deprecated */ 19 | # endif 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | size_t HMAC_size(const HMAC_CTX *e); 26 | HMAC_CTX *HMAC_CTX_new(void); 27 | int HMAC_CTX_reset(HMAC_CTX *ctx); 28 | void HMAC_CTX_free(HMAC_CTX *ctx); 29 | 30 | DEPRECATEDIN_1_1_0(__owur int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, 31 | const EVP_MD *md)) 32 | 33 | /*__owur*/ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, 34 | const EVP_MD *md, ENGINE *impl); 35 | /*__owur*/ int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, 36 | size_t len); 37 | /*__owur*/ int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, 38 | unsigned int *len); 39 | unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, 40 | const unsigned char *d, size_t n, unsigned char *md, 41 | unsigned int *md_len); 42 | __owur int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx); 43 | 44 | void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags); 45 | const EVP_MD *HMAC_CTX_get_md(const HMAC_CTX *ctx); 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/idea.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_IDEA_H 11 | # define HEADER_IDEA_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_IDEA 16 | # ifdef __cplusplus 17 | extern "C" { 18 | # endif 19 | 20 | typedef unsigned int IDEA_INT; 21 | 22 | # define IDEA_ENCRYPT 1 23 | # define IDEA_DECRYPT 0 24 | 25 | # define IDEA_BLOCK 8 26 | # define IDEA_KEY_LENGTH 16 27 | 28 | typedef struct idea_key_st { 29 | IDEA_INT data[9][6]; 30 | } IDEA_KEY_SCHEDULE; 31 | 32 | const char *IDEA_options(void); 33 | void IDEA_ecb_encrypt(const unsigned char *in, unsigned char *out, 34 | IDEA_KEY_SCHEDULE *ks); 35 | void IDEA_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks); 36 | void IDEA_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk); 37 | void IDEA_cbc_encrypt(const unsigned char *in, unsigned char *out, 38 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, 39 | int enc); 40 | void IDEA_cfb64_encrypt(const unsigned char *in, unsigned char *out, 41 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, 42 | int *num, int enc); 43 | void IDEA_ofb64_encrypt(const unsigned char *in, unsigned char *out, 44 | long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, 45 | int *num); 46 | void IDEA_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks); 47 | 48 | # if OPENSSL_API_COMPAT < 0x10100000L 49 | # define idea_options IDEA_options 50 | # define idea_ecb_encrypt IDEA_ecb_encrypt 51 | # define idea_set_encrypt_key IDEA_set_encrypt_key 52 | # define idea_set_decrypt_key IDEA_set_decrypt_key 53 | # define idea_cbc_encrypt IDEA_cbc_encrypt 54 | # define idea_cfb64_encrypt IDEA_cfb64_encrypt 55 | # define idea_ofb64_encrypt IDEA_ofb64_encrypt 56 | # define idea_encrypt IDEA_encrypt 57 | # endif 58 | 59 | # ifdef __cplusplus 60 | } 61 | # endif 62 | # endif 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/kdf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_KDF_H 11 | # define HEADER_KDF_H 12 | 13 | # include 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | # define EVP_PKEY_CTRL_TLS_MD (EVP_PKEY_ALG_CTRL) 19 | # define EVP_PKEY_CTRL_TLS_SECRET (EVP_PKEY_ALG_CTRL + 1) 20 | # define EVP_PKEY_CTRL_TLS_SEED (EVP_PKEY_ALG_CTRL + 2) 21 | # define EVP_PKEY_CTRL_HKDF_MD (EVP_PKEY_ALG_CTRL + 3) 22 | # define EVP_PKEY_CTRL_HKDF_SALT (EVP_PKEY_ALG_CTRL + 4) 23 | # define EVP_PKEY_CTRL_HKDF_KEY (EVP_PKEY_ALG_CTRL + 5) 24 | # define EVP_PKEY_CTRL_HKDF_INFO (EVP_PKEY_ALG_CTRL + 6) 25 | # define EVP_PKEY_CTRL_HKDF_MODE (EVP_PKEY_ALG_CTRL + 7) 26 | # define EVP_PKEY_CTRL_PASS (EVP_PKEY_ALG_CTRL + 8) 27 | # define EVP_PKEY_CTRL_SCRYPT_SALT (EVP_PKEY_ALG_CTRL + 9) 28 | # define EVP_PKEY_CTRL_SCRYPT_N (EVP_PKEY_ALG_CTRL + 10) 29 | # define EVP_PKEY_CTRL_SCRYPT_R (EVP_PKEY_ALG_CTRL + 11) 30 | # define EVP_PKEY_CTRL_SCRYPT_P (EVP_PKEY_ALG_CTRL + 12) 31 | # define EVP_PKEY_CTRL_SCRYPT_MAXMEM_BYTES (EVP_PKEY_ALG_CTRL + 13) 32 | 33 | # define EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND 0 34 | # define EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY 1 35 | # define EVP_PKEY_HKDEF_MODE_EXPAND_ONLY 2 36 | 37 | # define EVP_PKEY_CTX_set_tls1_prf_md(pctx, md) \ 38 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ 39 | EVP_PKEY_CTRL_TLS_MD, 0, (void *)(md)) 40 | 41 | # define EVP_PKEY_CTX_set1_tls1_prf_secret(pctx, sec, seclen) \ 42 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ 43 | EVP_PKEY_CTRL_TLS_SECRET, seclen, (void *)(sec)) 44 | 45 | # define EVP_PKEY_CTX_add1_tls1_prf_seed(pctx, seed, seedlen) \ 46 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ 47 | EVP_PKEY_CTRL_TLS_SEED, seedlen, (void *)(seed)) 48 | 49 | # define EVP_PKEY_CTX_set_hkdf_md(pctx, md) \ 50 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ 51 | EVP_PKEY_CTRL_HKDF_MD, 0, (void *)(md)) 52 | 53 | # define EVP_PKEY_CTX_set1_hkdf_salt(pctx, salt, saltlen) \ 54 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ 55 | EVP_PKEY_CTRL_HKDF_SALT, saltlen, (void *)(salt)) 56 | 57 | # define EVP_PKEY_CTX_set1_hkdf_key(pctx, key, keylen) \ 58 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ 59 | EVP_PKEY_CTRL_HKDF_KEY, keylen, (void *)(key)) 60 | 61 | # define EVP_PKEY_CTX_add1_hkdf_info(pctx, info, infolen) \ 62 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ 63 | EVP_PKEY_CTRL_HKDF_INFO, infolen, (void *)(info)) 64 | 65 | # define EVP_PKEY_CTX_hkdf_mode(pctx, mode) \ 66 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ 67 | EVP_PKEY_CTRL_HKDF_MODE, mode, NULL) 68 | 69 | # define EVP_PKEY_CTX_set1_pbe_pass(pctx, pass, passlen) \ 70 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ 71 | EVP_PKEY_CTRL_PASS, passlen, (void *)(pass)) 72 | 73 | # define EVP_PKEY_CTX_set1_scrypt_salt(pctx, salt, saltlen) \ 74 | EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \ 75 | EVP_PKEY_CTRL_SCRYPT_SALT, saltlen, (void *)(salt)) 76 | 77 | # define EVP_PKEY_CTX_set_scrypt_N(pctx, n) \ 78 | EVP_PKEY_CTX_ctrl_uint64(pctx, -1, EVP_PKEY_OP_DERIVE, \ 79 | EVP_PKEY_CTRL_SCRYPT_N, n) 80 | 81 | # define EVP_PKEY_CTX_set_scrypt_r(pctx, r) \ 82 | EVP_PKEY_CTX_ctrl_uint64(pctx, -1, EVP_PKEY_OP_DERIVE, \ 83 | EVP_PKEY_CTRL_SCRYPT_R, r) 84 | 85 | # define EVP_PKEY_CTX_set_scrypt_p(pctx, p) \ 86 | EVP_PKEY_CTX_ctrl_uint64(pctx, -1, EVP_PKEY_OP_DERIVE, \ 87 | EVP_PKEY_CTRL_SCRYPT_P, p) 88 | 89 | # define EVP_PKEY_CTX_set_scrypt_maxmem_bytes(pctx, maxmem_bytes) \ 90 | EVP_PKEY_CTX_ctrl_uint64(pctx, -1, EVP_PKEY_OP_DERIVE, \ 91 | EVP_PKEY_CTRL_SCRYPT_MAXMEM_BYTES, maxmem_bytes) 92 | 93 | 94 | # ifdef __cplusplus 95 | } 96 | # endif 97 | #endif 98 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/kdferr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_KDFERR_H 12 | # define HEADER_KDFERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # ifdef __cplusplus 19 | extern "C" 20 | # endif 21 | int ERR_load_KDF_strings(void); 22 | 23 | /* 24 | * KDF function codes. 25 | */ 26 | # define KDF_F_PKEY_HKDF_CTRL_STR 103 27 | # define KDF_F_PKEY_HKDF_DERIVE 102 28 | # define KDF_F_PKEY_HKDF_INIT 108 29 | # define KDF_F_PKEY_SCRYPT_CTRL_STR 104 30 | # define KDF_F_PKEY_SCRYPT_CTRL_UINT64 105 31 | # define KDF_F_PKEY_SCRYPT_DERIVE 109 32 | # define KDF_F_PKEY_SCRYPT_INIT 106 33 | # define KDF_F_PKEY_SCRYPT_SET_MEMBUF 107 34 | # define KDF_F_PKEY_TLS1_PRF_CTRL_STR 100 35 | # define KDF_F_PKEY_TLS1_PRF_DERIVE 101 36 | # define KDF_F_PKEY_TLS1_PRF_INIT 110 37 | # define KDF_F_TLS1_PRF_ALG 111 38 | 39 | /* 40 | * KDF reason codes. 41 | */ 42 | # define KDF_R_INVALID_DIGEST 100 43 | # define KDF_R_MISSING_ITERATION_COUNT 109 44 | # define KDF_R_MISSING_KEY 104 45 | # define KDF_R_MISSING_MESSAGE_DIGEST 105 46 | # define KDF_R_MISSING_PARAMETER 101 47 | # define KDF_R_MISSING_PASS 110 48 | # define KDF_R_MISSING_SALT 111 49 | # define KDF_R_MISSING_SECRET 107 50 | # define KDF_R_MISSING_SEED 106 51 | # define KDF_R_UNKNOWN_PARAMETER_TYPE 103 52 | # define KDF_R_VALUE_ERROR 108 53 | # define KDF_R_VALUE_MISSING 102 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/md2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_MD2_H 11 | # define HEADER_MD2_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_MD2 16 | # include 17 | # ifdef __cplusplus 18 | extern "C" { 19 | # endif 20 | 21 | typedef unsigned char MD2_INT; 22 | 23 | # define MD2_DIGEST_LENGTH 16 24 | # define MD2_BLOCK 16 25 | 26 | typedef struct MD2state_st { 27 | unsigned int num; 28 | unsigned char data[MD2_BLOCK]; 29 | MD2_INT cksm[MD2_BLOCK]; 30 | MD2_INT state[MD2_BLOCK]; 31 | } MD2_CTX; 32 | 33 | const char *MD2_options(void); 34 | int MD2_Init(MD2_CTX *c); 35 | int MD2_Update(MD2_CTX *c, const unsigned char *data, size_t len); 36 | int MD2_Final(unsigned char *md, MD2_CTX *c); 37 | unsigned char *MD2(const unsigned char *d, size_t n, unsigned char *md); 38 | 39 | # ifdef __cplusplus 40 | } 41 | # endif 42 | # endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/md4.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_MD4_H 11 | # define HEADER_MD4_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_MD4 16 | # include 17 | # include 18 | # ifdef __cplusplus 19 | extern "C" { 20 | # endif 21 | 22 | /*- 23 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 24 | * ! MD4_LONG has to be at least 32 bits wide. ! 25 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 26 | */ 27 | # define MD4_LONG unsigned int 28 | 29 | # define MD4_CBLOCK 64 30 | # define MD4_LBLOCK (MD4_CBLOCK/4) 31 | # define MD4_DIGEST_LENGTH 16 32 | 33 | typedef struct MD4state_st { 34 | MD4_LONG A, B, C, D; 35 | MD4_LONG Nl, Nh; 36 | MD4_LONG data[MD4_LBLOCK]; 37 | unsigned int num; 38 | } MD4_CTX; 39 | 40 | int MD4_Init(MD4_CTX *c); 41 | int MD4_Update(MD4_CTX *c, const void *data, size_t len); 42 | int MD4_Final(unsigned char *md, MD4_CTX *c); 43 | unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md); 44 | void MD4_Transform(MD4_CTX *c, const unsigned char *b); 45 | 46 | # ifdef __cplusplus 47 | } 48 | # endif 49 | # endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_MD5_H 11 | # define HEADER_MD5_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_MD5 16 | # include 17 | # include 18 | # ifdef __cplusplus 19 | extern "C" { 20 | # endif 21 | 22 | /* 23 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 24 | * ! MD5_LONG has to be at least 32 bits wide. ! 25 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 26 | */ 27 | # define MD5_LONG unsigned int 28 | 29 | # define MD5_CBLOCK 64 30 | # define MD5_LBLOCK (MD5_CBLOCK/4) 31 | # define MD5_DIGEST_LENGTH 16 32 | 33 | typedef struct MD5state_st { 34 | MD5_LONG A, B, C, D; 35 | MD5_LONG Nl, Nh; 36 | MD5_LONG data[MD5_LBLOCK]; 37 | unsigned int num; 38 | } MD5_CTX; 39 | 40 | int MD5_Init(MD5_CTX *c); 41 | int MD5_Update(MD5_CTX *c, const void *data, size_t len); 42 | int MD5_Final(unsigned char *md, MD5_CTX *c); 43 | unsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md); 44 | void MD5_Transform(MD5_CTX *c, const unsigned char *b); 45 | # ifdef __cplusplus 46 | } 47 | # endif 48 | # endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/mdc2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_MDC2_H 11 | # define HEADER_MDC2_H 12 | 13 | # include 14 | 15 | #ifndef OPENSSL_NO_MDC2 16 | # include 17 | # include 18 | # ifdef __cplusplus 19 | extern "C" { 20 | # endif 21 | 22 | # define MDC2_BLOCK 8 23 | # define MDC2_DIGEST_LENGTH 16 24 | 25 | typedef struct mdc2_ctx_st { 26 | unsigned int num; 27 | unsigned char data[MDC2_BLOCK]; 28 | DES_cblock h, hh; 29 | int pad_type; /* either 1 or 2, default 1 */ 30 | } MDC2_CTX; 31 | 32 | int MDC2_Init(MDC2_CTX *c); 33 | int MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len); 34 | int MDC2_Final(unsigned char *md, MDC2_CTX *c); 35 | unsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md); 36 | 37 | # ifdef __cplusplus 38 | } 39 | # endif 40 | # endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/objectserr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_OBJERR_H 12 | # define HEADER_OBJERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # ifdef __cplusplus 19 | extern "C" 20 | # endif 21 | int ERR_load_OBJ_strings(void); 22 | 23 | /* 24 | * OBJ function codes. 25 | */ 26 | # define OBJ_F_OBJ_ADD_OBJECT 105 27 | # define OBJ_F_OBJ_ADD_SIGID 107 28 | # define OBJ_F_OBJ_CREATE 100 29 | # define OBJ_F_OBJ_DUP 101 30 | # define OBJ_F_OBJ_NAME_NEW_INDEX 106 31 | # define OBJ_F_OBJ_NID2LN 102 32 | # define OBJ_F_OBJ_NID2OBJ 103 33 | # define OBJ_F_OBJ_NID2SN 104 34 | # define OBJ_F_OBJ_TXT2OBJ 108 35 | 36 | /* 37 | * OBJ reason codes. 38 | */ 39 | # define OBJ_R_OID_EXISTS 102 40 | # define OBJ_R_UNKNOWN_NID 101 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/ocsperr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_OCSPERR_H 12 | # define HEADER_OCSPERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # include 19 | 20 | # ifndef OPENSSL_NO_OCSP 21 | 22 | # ifdef __cplusplus 23 | extern "C" 24 | # endif 25 | int ERR_load_OCSP_strings(void); 26 | 27 | /* 28 | * OCSP function codes. 29 | */ 30 | # define OCSP_F_D2I_OCSP_NONCE 102 31 | # define OCSP_F_OCSP_BASIC_ADD1_STATUS 103 32 | # define OCSP_F_OCSP_BASIC_SIGN 104 33 | # define OCSP_F_OCSP_BASIC_SIGN_CTX 119 34 | # define OCSP_F_OCSP_BASIC_VERIFY 105 35 | # define OCSP_F_OCSP_CERT_ID_NEW 101 36 | # define OCSP_F_OCSP_CHECK_DELEGATED 106 37 | # define OCSP_F_OCSP_CHECK_IDS 107 38 | # define OCSP_F_OCSP_CHECK_ISSUER 108 39 | # define OCSP_F_OCSP_CHECK_VALIDITY 115 40 | # define OCSP_F_OCSP_MATCH_ISSUERID 109 41 | # define OCSP_F_OCSP_PARSE_URL 114 42 | # define OCSP_F_OCSP_REQUEST_SIGN 110 43 | # define OCSP_F_OCSP_REQUEST_VERIFY 116 44 | # define OCSP_F_OCSP_RESPONSE_GET1_BASIC 111 45 | # define OCSP_F_PARSE_HTTP_LINE1 118 46 | 47 | /* 48 | * OCSP reason codes. 49 | */ 50 | # define OCSP_R_CERTIFICATE_VERIFY_ERROR 101 51 | # define OCSP_R_DIGEST_ERR 102 52 | # define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD 122 53 | # define OCSP_R_ERROR_IN_THISUPDATE_FIELD 123 54 | # define OCSP_R_ERROR_PARSING_URL 121 55 | # define OCSP_R_MISSING_OCSPSIGNING_USAGE 103 56 | # define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE 124 57 | # define OCSP_R_NOT_BASIC_RESPONSE 104 58 | # define OCSP_R_NO_CERTIFICATES_IN_CHAIN 105 59 | # define OCSP_R_NO_RESPONSE_DATA 108 60 | # define OCSP_R_NO_REVOKED_TIME 109 61 | # define OCSP_R_NO_SIGNER_KEY 130 62 | # define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 110 63 | # define OCSP_R_REQUEST_NOT_SIGNED 128 64 | # define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA 111 65 | # define OCSP_R_ROOT_CA_NOT_TRUSTED 112 66 | # define OCSP_R_SERVER_RESPONSE_ERROR 114 67 | # define OCSP_R_SERVER_RESPONSE_PARSE_ERROR 115 68 | # define OCSP_R_SIGNATURE_FAILURE 117 69 | # define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND 118 70 | # define OCSP_R_STATUS_EXPIRED 125 71 | # define OCSP_R_STATUS_NOT_YET_VALID 126 72 | # define OCSP_R_STATUS_TOO_OLD 127 73 | # define OCSP_R_UNKNOWN_MESSAGE_DIGEST 119 74 | # define OCSP_R_UNKNOWN_NID 120 75 | # define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE 129 76 | 77 | # endif 78 | #endif 79 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/opensslconf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * WARNING: do not edit! 3 | * Generated by makefile from include\openssl\opensslconf.h.in 4 | * 5 | * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. 6 | * 7 | * Licensed under the OpenSSL license (the "License"). You may not use 8 | * this file except in compliance with the License. You can obtain a copy 9 | * in the file LICENSE in the source distribution or at 10 | * https://www.openssl.org/source/license.html 11 | */ 12 | 13 | #include 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | #ifdef OPENSSL_ALGORITHM_DEFINES 20 | # error OPENSSL_ALGORITHM_DEFINES no longer supported 21 | #endif 22 | 23 | /* 24 | * OpenSSL was configured with the following options: 25 | */ 26 | 27 | #ifndef OPENSSL_SYS_WIN64A 28 | # define OPENSSL_SYS_WIN64A 1 29 | #endif 30 | #ifndef OPENSSL_NO_MD2 31 | # define OPENSSL_NO_MD2 32 | #endif 33 | #ifndef OPENSSL_NO_RC5 34 | # define OPENSSL_NO_RC5 35 | #endif 36 | #ifndef OPENSSL_THREADS 37 | # define OPENSSL_THREADS 38 | #endif 39 | #ifndef OPENSSL_RAND_SEED_OS 40 | # define OPENSSL_RAND_SEED_OS 41 | #endif 42 | #ifndef OPENSSL_NO_AFALGENG 43 | # define OPENSSL_NO_AFALGENG 44 | #endif 45 | #ifndef OPENSSL_NO_ASAN 46 | # define OPENSSL_NO_ASAN 47 | #endif 48 | #ifndef OPENSSL_NO_CRYPTO_MDEBUG 49 | # define OPENSSL_NO_CRYPTO_MDEBUG 50 | #endif 51 | #ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE 52 | # define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE 53 | #endif 54 | #ifndef OPENSSL_NO_DEVCRYPTOENG 55 | # define OPENSSL_NO_DEVCRYPTOENG 56 | #endif 57 | #ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 58 | # define OPENSSL_NO_EC_NISTP_64_GCC_128 59 | #endif 60 | #ifndef OPENSSL_NO_EGD 61 | # define OPENSSL_NO_EGD 62 | #endif 63 | #ifndef OPENSSL_NO_EXTERNAL_TESTS 64 | # define OPENSSL_NO_EXTERNAL_TESTS 65 | #endif 66 | #ifndef OPENSSL_NO_FUZZ_AFL 67 | # define OPENSSL_NO_FUZZ_AFL 68 | #endif 69 | #ifndef OPENSSL_NO_FUZZ_LIBFUZZER 70 | # define OPENSSL_NO_FUZZ_LIBFUZZER 71 | #endif 72 | #ifndef OPENSSL_NO_HEARTBEATS 73 | # define OPENSSL_NO_HEARTBEATS 74 | #endif 75 | #ifndef OPENSSL_NO_MSAN 76 | # define OPENSSL_NO_MSAN 77 | #endif 78 | #ifndef OPENSSL_NO_SCTP 79 | # define OPENSSL_NO_SCTP 80 | #endif 81 | #ifndef OPENSSL_NO_SSL_TRACE 82 | # define OPENSSL_NO_SSL_TRACE 83 | #endif 84 | #ifndef OPENSSL_NO_SSL3 85 | # define OPENSSL_NO_SSL3 86 | #endif 87 | #ifndef OPENSSL_NO_SSL3_METHOD 88 | # define OPENSSL_NO_SSL3_METHOD 89 | #endif 90 | #ifndef OPENSSL_NO_UBSAN 91 | # define OPENSSL_NO_UBSAN 92 | #endif 93 | #ifndef OPENSSL_NO_UNIT_TEST 94 | # define OPENSSL_NO_UNIT_TEST 95 | #endif 96 | #ifndef OPENSSL_NO_WEAK_SSL_CIPHERS 97 | # define OPENSSL_NO_WEAK_SSL_CIPHERS 98 | #endif 99 | #ifndef OPENSSL_NO_STATIC_ENGINE 100 | # define OPENSSL_NO_STATIC_ENGINE 101 | #endif 102 | 103 | 104 | /* 105 | * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers 106 | * don't like that. This will hopefully silence them. 107 | */ 108 | #define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy; 109 | 110 | /* 111 | * Applications should use -DOPENSSL_API_COMPAT= to suppress the 112 | * declarations of functions deprecated in or before . Otherwise, they 113 | * still won't see them if the library has been built to disable deprecated 114 | * functions. 115 | */ 116 | #ifndef DECLARE_DEPRECATED 117 | # define DECLARE_DEPRECATED(f) f; 118 | # ifdef __GNUC__ 119 | # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) 120 | # undef DECLARE_DEPRECATED 121 | # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); 122 | # endif 123 | # elif defined(__SUNPRO_C) 124 | # if (__SUNPRO_C >= 0x5130) 125 | # undef DECLARE_DEPRECATED 126 | # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); 127 | # endif 128 | # endif 129 | #endif 130 | 131 | #ifndef OPENSSL_FILE 132 | # ifdef OPENSSL_NO_FILENAMES 133 | # define OPENSSL_FILE "" 134 | # define OPENSSL_LINE 0 135 | # else 136 | # define OPENSSL_FILE __FILE__ 137 | # define OPENSSL_LINE __LINE__ 138 | # endif 139 | #endif 140 | 141 | #ifndef OPENSSL_MIN_API 142 | # define OPENSSL_MIN_API 0 143 | #endif 144 | 145 | #if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API 146 | # undef OPENSSL_API_COMPAT 147 | # define OPENSSL_API_COMPAT OPENSSL_MIN_API 148 | #endif 149 | 150 | /* 151 | * Do not deprecate things to be deprecated in version 1.2.0 before the 152 | * OpenSSL version number matches. 153 | */ 154 | #if OPENSSL_VERSION_NUMBER < 0x10200000L 155 | # define DEPRECATEDIN_1_2_0(f) f; 156 | #elif OPENSSL_API_COMPAT < 0x10200000L 157 | # define DEPRECATEDIN_1_2_0(f) DECLARE_DEPRECATED(f) 158 | #else 159 | # define DEPRECATEDIN_1_2_0(f) 160 | #endif 161 | 162 | #if OPENSSL_API_COMPAT < 0x10100000L 163 | # define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f) 164 | #else 165 | # define DEPRECATEDIN_1_1_0(f) 166 | #endif 167 | 168 | #if OPENSSL_API_COMPAT < 0x10000000L 169 | # define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f) 170 | #else 171 | # define DEPRECATEDIN_1_0_0(f) 172 | #endif 173 | 174 | #if OPENSSL_API_COMPAT < 0x00908000L 175 | # define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f) 176 | #else 177 | # define DEPRECATEDIN_0_9_8(f) 178 | #endif 179 | 180 | /* Generate 80386 code? */ 181 | #undef I386_ONLY 182 | 183 | #undef OPENSSL_UNISTD 184 | #define OPENSSL_UNISTD 185 | 186 | #define OPENSSL_EXPORT_VAR_AS_FUNCTION 187 | 188 | /* 189 | * The following are cipher-specific, but are part of the public API. 190 | */ 191 | #if !defined(OPENSSL_SYS_UEFI) 192 | # undef BN_LLONG 193 | /* Only one for the following should be defined */ 194 | # undef SIXTY_FOUR_BIT_LONG 195 | # define SIXTY_FOUR_BIT 196 | # undef THIRTY_TWO_BIT 197 | #endif 198 | 199 | #define RC4_INT unsigned int 200 | 201 | #ifdef __cplusplus 202 | } 203 | #endif 204 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/opensslv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2022 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_OPENSSLV_H 11 | # define HEADER_OPENSSLV_H 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | /*- 18 | * Numeric release version identifier: 19 | * MNNFFPPS: major minor fix patch status 20 | * The status nibble has one of the values 0 for development, 1 to e for betas 21 | * 1 to 14, and f for release. The patch level is exactly that. 22 | * For example: 23 | * 0.9.3-dev 0x00903000 24 | * 0.9.3-beta1 0x00903001 25 | * 0.9.3-beta2-dev 0x00903002 26 | * 0.9.3-beta2 0x00903002 (same as ...beta2-dev) 27 | * 0.9.3 0x0090300f 28 | * 0.9.3a 0x0090301f 29 | * 0.9.4 0x0090400f 30 | * 1.2.3z 0x102031af 31 | * 32 | * For continuity reasons (because 0.9.5 is already out, and is coded 33 | * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level 34 | * part is slightly different, by setting the highest bit. This means 35 | * that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start 36 | * with 0x0090600S... 37 | * 38 | * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.) 39 | * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for 40 | * major minor fix final patch/beta) 41 | */ 42 | # define OPENSSL_VERSION_NUMBER 0x1010113fL 43 | # define OPENSSL_VERSION_TEXT "OpenSSL 1.1.1s 1 Nov 2022" 44 | 45 | /*- 46 | * The macros below are to be used for shared library (.so, .dll, ...) 47 | * versioning. That kind of versioning works a bit differently between 48 | * operating systems. The most usual scheme is to set a major and a minor 49 | * number, and have the runtime loader check that the major number is equal 50 | * to what it was at application link time, while the minor number has to 51 | * be greater or equal to what it was at application link time. With this 52 | * scheme, the version number is usually part of the file name, like this: 53 | * 54 | * libcrypto.so.0.9 55 | * 56 | * Some unixen also make a softlink with the major version number only: 57 | * 58 | * libcrypto.so.0 59 | * 60 | * On Tru64 and IRIX 6.x it works a little bit differently. There, the 61 | * shared library version is stored in the file, and is actually a series 62 | * of versions, separated by colons. The rightmost version present in the 63 | * library when linking an application is stored in the application to be 64 | * matched at run time. When the application is run, a check is done to 65 | * see if the library version stored in the application matches any of the 66 | * versions in the version string of the library itself. 67 | * This version string can be constructed in any way, depending on what 68 | * kind of matching is desired. However, to implement the same scheme as 69 | * the one used in the other unixen, all compatible versions, from lowest 70 | * to highest, should be part of the string. Consecutive builds would 71 | * give the following versions strings: 72 | * 73 | * 3.0 74 | * 3.0:3.1 75 | * 3.0:3.1:3.2 76 | * 4.0 77 | * 4.0:4.1 78 | * 79 | * Notice how version 4 is completely incompatible with version, and 80 | * therefore give the breach you can see. 81 | * 82 | * There may be other schemes as well that I haven't yet discovered. 83 | * 84 | * So, here's the way it works here: first of all, the library version 85 | * number doesn't need at all to match the overall OpenSSL version. 86 | * However, it's nice and more understandable if it actually does. 87 | * The current library version is stored in the macro SHLIB_VERSION_NUMBER, 88 | * which is just a piece of text in the format "M.m.e" (Major, minor, edit). 89 | * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways, 90 | * we need to keep a history of version numbers, which is done in the 91 | * macro SHLIB_VERSION_HISTORY. The numbers are separated by colons and 92 | * should only keep the versions that are binary compatible with the current. 93 | */ 94 | # define SHLIB_VERSION_HISTORY "" 95 | # define SHLIB_VERSION_NUMBER "1.1" 96 | 97 | 98 | #ifdef __cplusplus 99 | } 100 | #endif 101 | #endif /* HEADER_OPENSSLV_H */ 102 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/pem2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_PEM2_H 11 | # define HEADER_PEM2_H 12 | # include 13 | #endif 14 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/pemerr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_PEMERR_H 12 | # define HEADER_PEMERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # ifdef __cplusplus 19 | extern "C" 20 | # endif 21 | int ERR_load_PEM_strings(void); 22 | 23 | /* 24 | * PEM function codes. 25 | */ 26 | # define PEM_F_B2I_DSS 127 27 | # define PEM_F_B2I_PVK_BIO 128 28 | # define PEM_F_B2I_RSA 129 29 | # define PEM_F_CHECK_BITLEN_DSA 130 30 | # define PEM_F_CHECK_BITLEN_RSA 131 31 | # define PEM_F_D2I_PKCS8PRIVATEKEY_BIO 120 32 | # define PEM_F_D2I_PKCS8PRIVATEKEY_FP 121 33 | # define PEM_F_DO_B2I 132 34 | # define PEM_F_DO_B2I_BIO 133 35 | # define PEM_F_DO_BLOB_HEADER 134 36 | # define PEM_F_DO_I2B 146 37 | # define PEM_F_DO_PK8PKEY 126 38 | # define PEM_F_DO_PK8PKEY_FP 125 39 | # define PEM_F_DO_PVK_BODY 135 40 | # define PEM_F_DO_PVK_HEADER 136 41 | # define PEM_F_GET_HEADER_AND_DATA 143 42 | # define PEM_F_GET_NAME 144 43 | # define PEM_F_I2B_PVK 137 44 | # define PEM_F_I2B_PVK_BIO 138 45 | # define PEM_F_LOAD_IV 101 46 | # define PEM_F_PEM_ASN1_READ 102 47 | # define PEM_F_PEM_ASN1_READ_BIO 103 48 | # define PEM_F_PEM_ASN1_WRITE 104 49 | # define PEM_F_PEM_ASN1_WRITE_BIO 105 50 | # define PEM_F_PEM_DEF_CALLBACK 100 51 | # define PEM_F_PEM_DO_HEADER 106 52 | # define PEM_F_PEM_GET_EVP_CIPHER_INFO 107 53 | # define PEM_F_PEM_READ 108 54 | # define PEM_F_PEM_READ_BIO 109 55 | # define PEM_F_PEM_READ_BIO_DHPARAMS 141 56 | # define PEM_F_PEM_READ_BIO_EX 145 57 | # define PEM_F_PEM_READ_BIO_PARAMETERS 140 58 | # define PEM_F_PEM_READ_BIO_PRIVATEKEY 123 59 | # define PEM_F_PEM_READ_DHPARAMS 142 60 | # define PEM_F_PEM_READ_PRIVATEKEY 124 61 | # define PEM_F_PEM_SIGNFINAL 112 62 | # define PEM_F_PEM_WRITE 113 63 | # define PEM_F_PEM_WRITE_BIO 114 64 | # define PEM_F_PEM_WRITE_BIO_PRIVATEKEY_TRADITIONAL 147 65 | # define PEM_F_PEM_WRITE_PRIVATEKEY 139 66 | # define PEM_F_PEM_X509_INFO_READ 115 67 | # define PEM_F_PEM_X509_INFO_READ_BIO 116 68 | # define PEM_F_PEM_X509_INFO_WRITE_BIO 117 69 | 70 | /* 71 | * PEM reason codes. 72 | */ 73 | # define PEM_R_BAD_BASE64_DECODE 100 74 | # define PEM_R_BAD_DECRYPT 101 75 | # define PEM_R_BAD_END_LINE 102 76 | # define PEM_R_BAD_IV_CHARS 103 77 | # define PEM_R_BAD_MAGIC_NUMBER 116 78 | # define PEM_R_BAD_PASSWORD_READ 104 79 | # define PEM_R_BAD_VERSION_NUMBER 117 80 | # define PEM_R_BIO_WRITE_FAILURE 118 81 | # define PEM_R_CIPHER_IS_NULL 127 82 | # define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115 83 | # define PEM_R_EXPECTING_PRIVATE_KEY_BLOB 119 84 | # define PEM_R_EXPECTING_PUBLIC_KEY_BLOB 120 85 | # define PEM_R_HEADER_TOO_LONG 128 86 | # define PEM_R_INCONSISTENT_HEADER 121 87 | # define PEM_R_KEYBLOB_HEADER_PARSE_ERROR 122 88 | # define PEM_R_KEYBLOB_TOO_SHORT 123 89 | # define PEM_R_MISSING_DEK_IV 129 90 | # define PEM_R_NOT_DEK_INFO 105 91 | # define PEM_R_NOT_ENCRYPTED 106 92 | # define PEM_R_NOT_PROC_TYPE 107 93 | # define PEM_R_NO_START_LINE 108 94 | # define PEM_R_PROBLEMS_GETTING_PASSWORD 109 95 | # define PEM_R_PVK_DATA_TOO_SHORT 124 96 | # define PEM_R_PVK_TOO_SHORT 125 97 | # define PEM_R_READ_KEY 111 98 | # define PEM_R_SHORT_HEADER 112 99 | # define PEM_R_UNEXPECTED_DEK_IV 130 100 | # define PEM_R_UNSUPPORTED_CIPHER 113 101 | # define PEM_R_UNSUPPORTED_ENCRYPTION 114 102 | # define PEM_R_UNSUPPORTED_KEY_COMPONENTS 126 103 | # define PEM_R_UNSUPPORTED_PUBLIC_KEY_TYPE 110 104 | 105 | #endif 106 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/pkcs12err.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_PKCS12ERR_H 12 | # define HEADER_PKCS12ERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # ifdef __cplusplus 19 | extern "C" 20 | # endif 21 | int ERR_load_PKCS12_strings(void); 22 | 23 | /* 24 | * PKCS12 function codes. 25 | */ 26 | # define PKCS12_F_OPENSSL_ASC2UNI 121 27 | # define PKCS12_F_OPENSSL_UNI2ASC 124 28 | # define PKCS12_F_OPENSSL_UNI2UTF8 127 29 | # define PKCS12_F_OPENSSL_UTF82UNI 129 30 | # define PKCS12_F_PKCS12_CREATE 105 31 | # define PKCS12_F_PKCS12_GEN_MAC 107 32 | # define PKCS12_F_PKCS12_INIT 109 33 | # define PKCS12_F_PKCS12_ITEM_DECRYPT_D2I 106 34 | # define PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT 108 35 | # define PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG 117 36 | # define PKCS12_F_PKCS12_KEY_GEN_ASC 110 37 | # define PKCS12_F_PKCS12_KEY_GEN_UNI 111 38 | # define PKCS12_F_PKCS12_KEY_GEN_UTF8 116 39 | # define PKCS12_F_PKCS12_NEWPASS 128 40 | # define PKCS12_F_PKCS12_PACK_P7DATA 114 41 | # define PKCS12_F_PKCS12_PACK_P7ENCDATA 115 42 | # define PKCS12_F_PKCS12_PARSE 118 43 | # define PKCS12_F_PKCS12_PBE_CRYPT 119 44 | # define PKCS12_F_PKCS12_PBE_KEYIVGEN 120 45 | # define PKCS12_F_PKCS12_SAFEBAG_CREATE0_P8INF 112 46 | # define PKCS12_F_PKCS12_SAFEBAG_CREATE0_PKCS8 113 47 | # define PKCS12_F_PKCS12_SAFEBAG_CREATE_PKCS8_ENCRYPT 133 48 | # define PKCS12_F_PKCS12_SETUP_MAC 122 49 | # define PKCS12_F_PKCS12_SET_MAC 123 50 | # define PKCS12_F_PKCS12_UNPACK_AUTHSAFES 130 51 | # define PKCS12_F_PKCS12_UNPACK_P7DATA 131 52 | # define PKCS12_F_PKCS12_VERIFY_MAC 126 53 | # define PKCS12_F_PKCS8_ENCRYPT 125 54 | # define PKCS12_F_PKCS8_SET0_PBE 132 55 | 56 | /* 57 | * PKCS12 reason codes. 58 | */ 59 | # define PKCS12_R_CANT_PACK_STRUCTURE 100 60 | # define PKCS12_R_CONTENT_TYPE_NOT_DATA 121 61 | # define PKCS12_R_DECODE_ERROR 101 62 | # define PKCS12_R_ENCODE_ERROR 102 63 | # define PKCS12_R_ENCRYPT_ERROR 103 64 | # define PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE 120 65 | # define PKCS12_R_INVALID_NULL_ARGUMENT 104 66 | # define PKCS12_R_INVALID_NULL_PKCS12_POINTER 105 67 | # define PKCS12_R_IV_GEN_ERROR 106 68 | # define PKCS12_R_KEY_GEN_ERROR 107 69 | # define PKCS12_R_MAC_ABSENT 108 70 | # define PKCS12_R_MAC_GENERATION_ERROR 109 71 | # define PKCS12_R_MAC_SETUP_ERROR 110 72 | # define PKCS12_R_MAC_STRING_SET_ERROR 111 73 | # define PKCS12_R_MAC_VERIFY_FAILURE 113 74 | # define PKCS12_R_PARSE_ERROR 114 75 | # define PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR 115 76 | # define PKCS12_R_PKCS12_CIPHERFINAL_ERROR 116 77 | # define PKCS12_R_PKCS12_PBE_CRYPT_ERROR 117 78 | # define PKCS12_R_UNKNOWN_DIGEST_ALGORITHM 118 79 | # define PKCS12_R_UNSUPPORTED_PKCS12_MODE 119 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/pkcs7err.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_PKCS7ERR_H 12 | # define HEADER_PKCS7ERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # ifdef __cplusplus 19 | extern "C" 20 | # endif 21 | int ERR_load_PKCS7_strings(void); 22 | 23 | /* 24 | * PKCS7 function codes. 25 | */ 26 | # define PKCS7_F_DO_PKCS7_SIGNED_ATTRIB 136 27 | # define PKCS7_F_PKCS7_ADD0_ATTRIB_SIGNING_TIME 135 28 | # define PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP 118 29 | # define PKCS7_F_PKCS7_ADD_CERTIFICATE 100 30 | # define PKCS7_F_PKCS7_ADD_CRL 101 31 | # define PKCS7_F_PKCS7_ADD_RECIPIENT_INFO 102 32 | # define PKCS7_F_PKCS7_ADD_SIGNATURE 131 33 | # define PKCS7_F_PKCS7_ADD_SIGNER 103 34 | # define PKCS7_F_PKCS7_BIO_ADD_DIGEST 125 35 | # define PKCS7_F_PKCS7_COPY_EXISTING_DIGEST 138 36 | # define PKCS7_F_PKCS7_CTRL 104 37 | # define PKCS7_F_PKCS7_DATADECODE 112 38 | # define PKCS7_F_PKCS7_DATAFINAL 128 39 | # define PKCS7_F_PKCS7_DATAINIT 105 40 | # define PKCS7_F_PKCS7_DATAVERIFY 107 41 | # define PKCS7_F_PKCS7_DECRYPT 114 42 | # define PKCS7_F_PKCS7_DECRYPT_RINFO 133 43 | # define PKCS7_F_PKCS7_ENCODE_RINFO 132 44 | # define PKCS7_F_PKCS7_ENCRYPT 115 45 | # define PKCS7_F_PKCS7_FINAL 134 46 | # define PKCS7_F_PKCS7_FIND_DIGEST 127 47 | # define PKCS7_F_PKCS7_GET0_SIGNERS 124 48 | # define PKCS7_F_PKCS7_RECIP_INFO_SET 130 49 | # define PKCS7_F_PKCS7_SET_CIPHER 108 50 | # define PKCS7_F_PKCS7_SET_CONTENT 109 51 | # define PKCS7_F_PKCS7_SET_DIGEST 126 52 | # define PKCS7_F_PKCS7_SET_TYPE 110 53 | # define PKCS7_F_PKCS7_SIGN 116 54 | # define PKCS7_F_PKCS7_SIGNATUREVERIFY 113 55 | # define PKCS7_F_PKCS7_SIGNER_INFO_SET 129 56 | # define PKCS7_F_PKCS7_SIGNER_INFO_SIGN 139 57 | # define PKCS7_F_PKCS7_SIGN_ADD_SIGNER 137 58 | # define PKCS7_F_PKCS7_SIMPLE_SMIMECAP 119 59 | # define PKCS7_F_PKCS7_VERIFY 117 60 | 61 | /* 62 | * PKCS7 reason codes. 63 | */ 64 | # define PKCS7_R_CERTIFICATE_VERIFY_ERROR 117 65 | # define PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 144 66 | # define PKCS7_R_CIPHER_NOT_INITIALIZED 116 67 | # define PKCS7_R_CONTENT_AND_DATA_PRESENT 118 68 | # define PKCS7_R_CTRL_ERROR 152 69 | # define PKCS7_R_DECRYPT_ERROR 119 70 | # define PKCS7_R_DIGEST_FAILURE 101 71 | # define PKCS7_R_ENCRYPTION_CTRL_FAILURE 149 72 | # define PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 150 73 | # define PKCS7_R_ERROR_ADDING_RECIPIENT 120 74 | # define PKCS7_R_ERROR_SETTING_CIPHER 121 75 | # define PKCS7_R_INVALID_NULL_POINTER 143 76 | # define PKCS7_R_INVALID_SIGNED_DATA_TYPE 155 77 | # define PKCS7_R_NO_CONTENT 122 78 | # define PKCS7_R_NO_DEFAULT_DIGEST 151 79 | # define PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND 154 80 | # define PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE 115 81 | # define PKCS7_R_NO_SIGNATURES_ON_DATA 123 82 | # define PKCS7_R_NO_SIGNERS 142 83 | # define PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE 104 84 | # define PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR 124 85 | # define PKCS7_R_PKCS7_ADD_SIGNER_ERROR 153 86 | # define PKCS7_R_PKCS7_DATASIGN 145 87 | # define PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 127 88 | # define PKCS7_R_SIGNATURE_FAILURE 105 89 | # define PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND 128 90 | # define PKCS7_R_SIGNING_CTRL_FAILURE 147 91 | # define PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 148 92 | # define PKCS7_R_SMIME_TEXT_ERROR 129 93 | # define PKCS7_R_UNABLE_TO_FIND_CERTIFICATE 106 94 | # define PKCS7_R_UNABLE_TO_FIND_MEM_BIO 107 95 | # define PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST 108 96 | # define PKCS7_R_UNKNOWN_DIGEST_TYPE 109 97 | # define PKCS7_R_UNKNOWN_OPERATION 110 98 | # define PKCS7_R_UNSUPPORTED_CIPHER_TYPE 111 99 | # define PKCS7_R_UNSUPPORTED_CONTENT_TYPE 112 100 | # define PKCS7_R_WRONG_CONTENT_TYPE 113 101 | # define PKCS7_R_WRONG_PKCS7_TYPE 114 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/rand.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_RAND_H 11 | # define HEADER_RAND_H 12 | 13 | # include 14 | # include 15 | # include 16 | # include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | struct rand_meth_st { 23 | int (*seed) (const void *buf, int num); 24 | int (*bytes) (unsigned char *buf, int num); 25 | void (*cleanup) (void); 26 | int (*add) (const void *buf, int num, double randomness); 27 | int (*pseudorand) (unsigned char *buf, int num); 28 | int (*status) (void); 29 | }; 30 | 31 | int RAND_set_rand_method(const RAND_METHOD *meth); 32 | const RAND_METHOD *RAND_get_rand_method(void); 33 | # ifndef OPENSSL_NO_ENGINE 34 | int RAND_set_rand_engine(ENGINE *engine); 35 | # endif 36 | 37 | RAND_METHOD *RAND_OpenSSL(void); 38 | 39 | # if OPENSSL_API_COMPAT < 0x10100000L 40 | # define RAND_cleanup() while(0) continue 41 | # endif 42 | int RAND_bytes(unsigned char *buf, int num); 43 | int RAND_priv_bytes(unsigned char *buf, int num); 44 | DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num)) 45 | 46 | void RAND_seed(const void *buf, int num); 47 | void RAND_keep_random_devices_open(int keep); 48 | 49 | # if defined(__ANDROID__) && defined(__NDK_FPABI__) 50 | __NDK_FPABI__ /* __attribute__((pcs("aapcs"))) on ARM */ 51 | # endif 52 | void RAND_add(const void *buf, int num, double randomness); 53 | int RAND_load_file(const char *file, long max_bytes); 54 | int RAND_write_file(const char *file); 55 | const char *RAND_file_name(char *file, size_t num); 56 | int RAND_status(void); 57 | 58 | # ifndef OPENSSL_NO_EGD 59 | int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes); 60 | int RAND_egd(const char *path); 61 | int RAND_egd_bytes(const char *path, int bytes); 62 | # endif 63 | 64 | int RAND_poll(void); 65 | 66 | # if defined(_WIN32) && (defined(BASETYPES) || defined(_WINDEF_H)) 67 | /* application has to include in order to use these */ 68 | DEPRECATEDIN_1_1_0(void RAND_screen(void)) 69 | DEPRECATEDIN_1_1_0(int RAND_event(UINT, WPARAM, LPARAM)) 70 | # endif 71 | 72 | 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/rand_drbg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_DRBG_RAND_H 11 | # define HEADER_DRBG_RAND_H 12 | 13 | # include 14 | # include 15 | # include 16 | 17 | /* 18 | * RAND_DRBG flags 19 | * 20 | * Note: if new flags are added, the constant `rand_drbg_used_flags` 21 | * in drbg_lib.c needs to be updated accordingly. 22 | */ 23 | 24 | /* In CTR mode, disable derivation function ctr_df */ 25 | # define RAND_DRBG_FLAG_CTR_NO_DF 0x1 26 | 27 | 28 | # if OPENSSL_API_COMPAT < 0x10200000L 29 | /* This #define was replaced by an internal constant and should not be used. */ 30 | # define RAND_DRBG_USED_FLAGS (RAND_DRBG_FLAG_CTR_NO_DF) 31 | # endif 32 | 33 | /* 34 | * Default security strength (in the sense of [NIST SP 800-90Ar1]) 35 | * 36 | * NIST SP 800-90Ar1 supports the strength of the DRBG being smaller than that 37 | * of the cipher by collecting less entropy. The current DRBG implementation 38 | * does not take RAND_DRBG_STRENGTH into account and sets the strength of the 39 | * DRBG to that of the cipher. 40 | * 41 | * RAND_DRBG_STRENGTH is currently only used for the legacy RAND 42 | * implementation. 43 | * 44 | * Currently supported ciphers are: NID_aes_128_ctr, NID_aes_192_ctr and 45 | * NID_aes_256_ctr 46 | */ 47 | # define RAND_DRBG_STRENGTH 256 48 | /* Default drbg type */ 49 | # define RAND_DRBG_TYPE NID_aes_256_ctr 50 | /* Default drbg flags */ 51 | # define RAND_DRBG_FLAGS 0 52 | 53 | 54 | # ifdef __cplusplus 55 | extern "C" { 56 | # endif 57 | 58 | /* 59 | * Object lifetime functions. 60 | */ 61 | RAND_DRBG *RAND_DRBG_new(int type, unsigned int flags, RAND_DRBG *parent); 62 | RAND_DRBG *RAND_DRBG_secure_new(int type, unsigned int flags, RAND_DRBG *parent); 63 | int RAND_DRBG_set(RAND_DRBG *drbg, int type, unsigned int flags); 64 | int RAND_DRBG_set_defaults(int type, unsigned int flags); 65 | int RAND_DRBG_instantiate(RAND_DRBG *drbg, 66 | const unsigned char *pers, size_t perslen); 67 | int RAND_DRBG_uninstantiate(RAND_DRBG *drbg); 68 | void RAND_DRBG_free(RAND_DRBG *drbg); 69 | 70 | /* 71 | * Object "use" functions. 72 | */ 73 | int RAND_DRBG_reseed(RAND_DRBG *drbg, 74 | const unsigned char *adin, size_t adinlen, 75 | int prediction_resistance); 76 | int RAND_DRBG_generate(RAND_DRBG *drbg, unsigned char *out, size_t outlen, 77 | int prediction_resistance, 78 | const unsigned char *adin, size_t adinlen); 79 | int RAND_DRBG_bytes(RAND_DRBG *drbg, unsigned char *out, size_t outlen); 80 | 81 | int RAND_DRBG_set_reseed_interval(RAND_DRBG *drbg, unsigned int interval); 82 | int RAND_DRBG_set_reseed_time_interval(RAND_DRBG *drbg, time_t interval); 83 | 84 | int RAND_DRBG_set_reseed_defaults( 85 | unsigned int master_reseed_interval, 86 | unsigned int slave_reseed_interval, 87 | time_t master_reseed_time_interval, 88 | time_t slave_reseed_time_interval 89 | ); 90 | 91 | RAND_DRBG *RAND_DRBG_get0_master(void); 92 | RAND_DRBG *RAND_DRBG_get0_public(void); 93 | RAND_DRBG *RAND_DRBG_get0_private(void); 94 | 95 | /* 96 | * EXDATA 97 | */ 98 | # define RAND_DRBG_get_ex_new_index(l, p, newf, dupf, freef) \ 99 | CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_DRBG, l, p, newf, dupf, freef) 100 | int RAND_DRBG_set_ex_data(RAND_DRBG *drbg, int idx, void *arg); 101 | void *RAND_DRBG_get_ex_data(const RAND_DRBG *drbg, int idx); 102 | 103 | /* 104 | * Callback function typedefs 105 | */ 106 | typedef size_t (*RAND_DRBG_get_entropy_fn)(RAND_DRBG *drbg, 107 | unsigned char **pout, 108 | int entropy, size_t min_len, 109 | size_t max_len, 110 | int prediction_resistance); 111 | typedef void (*RAND_DRBG_cleanup_entropy_fn)(RAND_DRBG *ctx, 112 | unsigned char *out, size_t outlen); 113 | typedef size_t (*RAND_DRBG_get_nonce_fn)(RAND_DRBG *drbg, unsigned char **pout, 114 | int entropy, size_t min_len, 115 | size_t max_len); 116 | typedef void (*RAND_DRBG_cleanup_nonce_fn)(RAND_DRBG *drbg, 117 | unsigned char *out, size_t outlen); 118 | 119 | int RAND_DRBG_set_callbacks(RAND_DRBG *drbg, 120 | RAND_DRBG_get_entropy_fn get_entropy, 121 | RAND_DRBG_cleanup_entropy_fn cleanup_entropy, 122 | RAND_DRBG_get_nonce_fn get_nonce, 123 | RAND_DRBG_cleanup_nonce_fn cleanup_nonce); 124 | 125 | 126 | # ifdef __cplusplus 127 | } 128 | # endif 129 | 130 | #endif 131 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/randerr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_RANDERR_H 12 | # define HEADER_RANDERR_H 13 | 14 | # include 15 | 16 | # ifdef __cplusplus 17 | extern "C" 18 | # endif 19 | int ERR_load_RAND_strings(void); 20 | 21 | /* 22 | * RAND function codes. 23 | */ 24 | # define RAND_F_DATA_COLLECT_METHOD 127 25 | # define RAND_F_DRBG_BYTES 101 26 | # define RAND_F_DRBG_GET_ENTROPY 105 27 | # define RAND_F_DRBG_SETUP 117 28 | # define RAND_F_GET_ENTROPY 106 29 | # define RAND_F_RAND_BYTES 100 30 | # define RAND_F_RAND_DRBG_ENABLE_LOCKING 119 31 | # define RAND_F_RAND_DRBG_GENERATE 107 32 | # define RAND_F_RAND_DRBG_GET_ENTROPY 120 33 | # define RAND_F_RAND_DRBG_GET_NONCE 123 34 | # define RAND_F_RAND_DRBG_INSTANTIATE 108 35 | # define RAND_F_RAND_DRBG_NEW 109 36 | # define RAND_F_RAND_DRBG_RESEED 110 37 | # define RAND_F_RAND_DRBG_RESTART 102 38 | # define RAND_F_RAND_DRBG_SET 104 39 | # define RAND_F_RAND_DRBG_SET_DEFAULTS 121 40 | # define RAND_F_RAND_DRBG_UNINSTANTIATE 118 41 | # define RAND_F_RAND_LOAD_FILE 111 42 | # define RAND_F_RAND_POOL_ACQUIRE_ENTROPY 122 43 | # define RAND_F_RAND_POOL_ADD 103 44 | # define RAND_F_RAND_POOL_ADD_BEGIN 113 45 | # define RAND_F_RAND_POOL_ADD_END 114 46 | # define RAND_F_RAND_POOL_ATTACH 124 47 | # define RAND_F_RAND_POOL_BYTES_NEEDED 115 48 | # define RAND_F_RAND_POOL_GROW 125 49 | # define RAND_F_RAND_POOL_NEW 116 50 | # define RAND_F_RAND_PSEUDO_BYTES 126 51 | # define RAND_F_RAND_WRITE_FILE 112 52 | 53 | /* 54 | * RAND reason codes. 55 | */ 56 | # define RAND_R_ADDITIONAL_INPUT_TOO_LONG 102 57 | # define RAND_R_ALREADY_INSTANTIATED 103 58 | # define RAND_R_ARGUMENT_OUT_OF_RANGE 105 59 | # define RAND_R_CANNOT_OPEN_FILE 121 60 | # define RAND_R_DRBG_ALREADY_INITIALIZED 129 61 | # define RAND_R_DRBG_NOT_INITIALISED 104 62 | # define RAND_R_ENTROPY_INPUT_TOO_LONG 106 63 | # define RAND_R_ENTROPY_OUT_OF_RANGE 124 64 | # define RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED 127 65 | # define RAND_R_ERROR_INITIALISING_DRBG 107 66 | # define RAND_R_ERROR_INSTANTIATING_DRBG 108 67 | # define RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT 109 68 | # define RAND_R_ERROR_RETRIEVING_ENTROPY 110 69 | # define RAND_R_ERROR_RETRIEVING_NONCE 111 70 | # define RAND_R_FAILED_TO_CREATE_LOCK 126 71 | # define RAND_R_FUNC_NOT_IMPLEMENTED 101 72 | # define RAND_R_FWRITE_ERROR 123 73 | # define RAND_R_GENERATE_ERROR 112 74 | # define RAND_R_INTERNAL_ERROR 113 75 | # define RAND_R_IN_ERROR_STATE 114 76 | # define RAND_R_NOT_A_REGULAR_FILE 122 77 | # define RAND_R_NOT_INSTANTIATED 115 78 | # define RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED 128 79 | # define RAND_R_PARENT_LOCKING_NOT_ENABLED 130 80 | # define RAND_R_PARENT_STRENGTH_TOO_WEAK 131 81 | # define RAND_R_PERSONALISATION_STRING_TOO_LONG 116 82 | # define RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED 133 83 | # define RAND_R_PRNG_NOT_SEEDED 100 84 | # define RAND_R_RANDOM_POOL_OVERFLOW 125 85 | # define RAND_R_RANDOM_POOL_UNDERFLOW 134 86 | # define RAND_R_REQUEST_TOO_LARGE_FOR_DRBG 117 87 | # define RAND_R_RESEED_ERROR 118 88 | # define RAND_R_SELFTEST_FAILURE 119 89 | # define RAND_R_TOO_LITTLE_NONCE_REQUESTED 135 90 | # define RAND_R_TOO_MUCH_NONCE_REQUESTED 136 91 | # define RAND_R_UNSUPPORTED_DRBG_FLAGS 132 92 | # define RAND_R_UNSUPPORTED_DRBG_TYPE 120 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/rc2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_RC2_H 11 | # define HEADER_RC2_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_RC2 16 | # ifdef __cplusplus 17 | extern "C" { 18 | # endif 19 | 20 | typedef unsigned int RC2_INT; 21 | 22 | # define RC2_ENCRYPT 1 23 | # define RC2_DECRYPT 0 24 | 25 | # define RC2_BLOCK 8 26 | # define RC2_KEY_LENGTH 16 27 | 28 | typedef struct rc2_key_st { 29 | RC2_INT data[64]; 30 | } RC2_KEY; 31 | 32 | void RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits); 33 | void RC2_ecb_encrypt(const unsigned char *in, unsigned char *out, 34 | RC2_KEY *key, int enc); 35 | void RC2_encrypt(unsigned long *data, RC2_KEY *key); 36 | void RC2_decrypt(unsigned long *data, RC2_KEY *key); 37 | void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length, 38 | RC2_KEY *ks, unsigned char *iv, int enc); 39 | void RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out, 40 | long length, RC2_KEY *schedule, unsigned char *ivec, 41 | int *num, int enc); 42 | void RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out, 43 | long length, RC2_KEY *schedule, unsigned char *ivec, 44 | int *num); 45 | 46 | # ifdef __cplusplus 47 | } 48 | # endif 49 | # endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/rc4.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_RC4_H 11 | # define HEADER_RC4_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_RC4 16 | # include 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | typedef struct rc4_key_st { 22 | RC4_INT x, y; 23 | RC4_INT data[256]; 24 | } RC4_KEY; 25 | 26 | const char *RC4_options(void); 27 | void RC4_set_key(RC4_KEY *key, int len, const unsigned char *data); 28 | void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, 29 | unsigned char *outdata); 30 | 31 | # ifdef __cplusplus 32 | } 33 | # endif 34 | # endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/rc5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_RC5_H 11 | # define HEADER_RC5_H 12 | 13 | # include 14 | 15 | # ifndef OPENSSL_NO_RC5 16 | # ifdef __cplusplus 17 | extern "C" { 18 | # endif 19 | 20 | # define RC5_ENCRYPT 1 21 | # define RC5_DECRYPT 0 22 | 23 | # define RC5_32_INT unsigned int 24 | 25 | # define RC5_32_BLOCK 8 26 | # define RC5_32_KEY_LENGTH 16/* This is a default, max is 255 */ 27 | 28 | /* 29 | * This are the only values supported. Tweak the code if you want more The 30 | * most supported modes will be RC5-32/12/16 RC5-32/16/8 31 | */ 32 | # define RC5_8_ROUNDS 8 33 | # define RC5_12_ROUNDS 12 34 | # define RC5_16_ROUNDS 16 35 | 36 | typedef struct rc5_key_st { 37 | /* Number of rounds */ 38 | int rounds; 39 | RC5_32_INT data[2 * (RC5_16_ROUNDS + 1)]; 40 | } RC5_32_KEY; 41 | 42 | void RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data, 43 | int rounds); 44 | void RC5_32_ecb_encrypt(const unsigned char *in, unsigned char *out, 45 | RC5_32_KEY *key, int enc); 46 | void RC5_32_encrypt(unsigned long *data, RC5_32_KEY *key); 47 | void RC5_32_decrypt(unsigned long *data, RC5_32_KEY *key); 48 | void RC5_32_cbc_encrypt(const unsigned char *in, unsigned char *out, 49 | long length, RC5_32_KEY *ks, unsigned char *iv, 50 | int enc); 51 | void RC5_32_cfb64_encrypt(const unsigned char *in, unsigned char *out, 52 | long length, RC5_32_KEY *schedule, 53 | unsigned char *ivec, int *num, int enc); 54 | void RC5_32_ofb64_encrypt(const unsigned char *in, unsigned char *out, 55 | long length, RC5_32_KEY *schedule, 56 | unsigned char *ivec, int *num); 57 | 58 | # ifdef __cplusplus 59 | } 60 | # endif 61 | # endif 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/ripemd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_RIPEMD_H 11 | # define HEADER_RIPEMD_H 12 | 13 | # include 14 | 15 | #ifndef OPENSSL_NO_RMD160 16 | # include 17 | # include 18 | # ifdef __cplusplus 19 | extern "C" { 20 | # endif 21 | 22 | # define RIPEMD160_LONG unsigned int 23 | 24 | # define RIPEMD160_CBLOCK 64 25 | # define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4) 26 | # define RIPEMD160_DIGEST_LENGTH 20 27 | 28 | typedef struct RIPEMD160state_st { 29 | RIPEMD160_LONG A, B, C, D, E; 30 | RIPEMD160_LONG Nl, Nh; 31 | RIPEMD160_LONG data[RIPEMD160_LBLOCK]; 32 | unsigned int num; 33 | } RIPEMD160_CTX; 34 | 35 | int RIPEMD160_Init(RIPEMD160_CTX *c); 36 | int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len); 37 | int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); 38 | unsigned char *RIPEMD160(const unsigned char *d, size_t n, unsigned char *md); 39 | void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b); 40 | 41 | # ifdef __cplusplus 42 | } 43 | # endif 44 | # endif 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/seed.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | /* 11 | * Copyright (c) 2007 KISA(Korea Information Security Agency). All rights reserved. 12 | * 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions 15 | * are met: 16 | * 1. Redistributions of source code must retain the above copyright 17 | * notice, this list of conditions and the following disclaimer. 18 | * 2. Neither the name of author nor the names of its contributors may 19 | * be used to endorse or promote products derived from this software 20 | * without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND 23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 | * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 | * SUCH DAMAGE. 33 | */ 34 | 35 | #ifndef HEADER_SEED_H 36 | # define HEADER_SEED_H 37 | 38 | # include 39 | 40 | # ifndef OPENSSL_NO_SEED 41 | # include 42 | # include 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | /* look whether we need 'long' to get 32 bits */ 49 | # ifdef AES_LONG 50 | # ifndef SEED_LONG 51 | # define SEED_LONG 1 52 | # endif 53 | # endif 54 | 55 | # include 56 | 57 | # define SEED_BLOCK_SIZE 16 58 | # define SEED_KEY_LENGTH 16 59 | 60 | typedef struct seed_key_st { 61 | # ifdef SEED_LONG 62 | unsigned long data[32]; 63 | # else 64 | unsigned int data[32]; 65 | # endif 66 | } SEED_KEY_SCHEDULE; 67 | 68 | void SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH], 69 | SEED_KEY_SCHEDULE *ks); 70 | 71 | void SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE], 72 | unsigned char d[SEED_BLOCK_SIZE], 73 | const SEED_KEY_SCHEDULE *ks); 74 | void SEED_decrypt(const unsigned char s[SEED_BLOCK_SIZE], 75 | unsigned char d[SEED_BLOCK_SIZE], 76 | const SEED_KEY_SCHEDULE *ks); 77 | 78 | void SEED_ecb_encrypt(const unsigned char *in, unsigned char *out, 79 | const SEED_KEY_SCHEDULE *ks, int enc); 80 | void SEED_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t len, 81 | const SEED_KEY_SCHEDULE *ks, 82 | unsigned char ivec[SEED_BLOCK_SIZE], int enc); 83 | void SEED_cfb128_encrypt(const unsigned char *in, unsigned char *out, 84 | size_t len, const SEED_KEY_SCHEDULE *ks, 85 | unsigned char ivec[SEED_BLOCK_SIZE], int *num, 86 | int enc); 87 | void SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out, 88 | size_t len, const SEED_KEY_SCHEDULE *ks, 89 | unsigned char ivec[SEED_BLOCK_SIZE], int *num); 90 | 91 | # ifdef __cplusplus 92 | } 93 | # endif 94 | # endif 95 | 96 | #endif 97 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/sha.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_SHA_H 11 | # define HEADER_SHA_H 12 | 13 | # include 14 | # include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /*- 21 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 22 | * ! SHA_LONG has to be at least 32 bits wide. ! 23 | * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 24 | */ 25 | # define SHA_LONG unsigned int 26 | 27 | # define SHA_LBLOCK 16 28 | # define SHA_CBLOCK (SHA_LBLOCK*4)/* SHA treats input data as a 29 | * contiguous array of 32 bit wide 30 | * big-endian values. */ 31 | # define SHA_LAST_BLOCK (SHA_CBLOCK-8) 32 | # define SHA_DIGEST_LENGTH 20 33 | 34 | typedef struct SHAstate_st { 35 | SHA_LONG h0, h1, h2, h3, h4; 36 | SHA_LONG Nl, Nh; 37 | SHA_LONG data[SHA_LBLOCK]; 38 | unsigned int num; 39 | } SHA_CTX; 40 | 41 | int SHA1_Init(SHA_CTX *c); 42 | int SHA1_Update(SHA_CTX *c, const void *data, size_t len); 43 | int SHA1_Final(unsigned char *md, SHA_CTX *c); 44 | unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md); 45 | void SHA1_Transform(SHA_CTX *c, const unsigned char *data); 46 | 47 | # define SHA256_CBLOCK (SHA_LBLOCK*4)/* SHA-256 treats input data as a 48 | * contiguous array of 32 bit wide 49 | * big-endian values. */ 50 | 51 | typedef struct SHA256state_st { 52 | SHA_LONG h[8]; 53 | SHA_LONG Nl, Nh; 54 | SHA_LONG data[SHA_LBLOCK]; 55 | unsigned int num, md_len; 56 | } SHA256_CTX; 57 | 58 | int SHA224_Init(SHA256_CTX *c); 59 | int SHA224_Update(SHA256_CTX *c, const void *data, size_t len); 60 | int SHA224_Final(unsigned char *md, SHA256_CTX *c); 61 | unsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md); 62 | int SHA256_Init(SHA256_CTX *c); 63 | int SHA256_Update(SHA256_CTX *c, const void *data, size_t len); 64 | int SHA256_Final(unsigned char *md, SHA256_CTX *c); 65 | unsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md); 66 | void SHA256_Transform(SHA256_CTX *c, const unsigned char *data); 67 | 68 | # define SHA224_DIGEST_LENGTH 28 69 | # define SHA256_DIGEST_LENGTH 32 70 | # define SHA384_DIGEST_LENGTH 48 71 | # define SHA512_DIGEST_LENGTH 64 72 | 73 | /* 74 | * Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64 75 | * being exactly 64-bit wide. See Implementation Notes in sha512.c 76 | * for further details. 77 | */ 78 | /* 79 | * SHA-512 treats input data as a 80 | * contiguous array of 64 bit 81 | * wide big-endian values. 82 | */ 83 | # define SHA512_CBLOCK (SHA_LBLOCK*8) 84 | # if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__) 85 | # define SHA_LONG64 unsigned __int64 86 | # define U64(C) C##UI64 87 | # elif defined(__arch64__) 88 | # define SHA_LONG64 unsigned long 89 | # define U64(C) C##UL 90 | # else 91 | # define SHA_LONG64 unsigned long long 92 | # define U64(C) C##ULL 93 | # endif 94 | 95 | typedef struct SHA512state_st { 96 | SHA_LONG64 h[8]; 97 | SHA_LONG64 Nl, Nh; 98 | union { 99 | SHA_LONG64 d[SHA_LBLOCK]; 100 | unsigned char p[SHA512_CBLOCK]; 101 | } u; 102 | unsigned int num, md_len; 103 | } SHA512_CTX; 104 | 105 | int SHA384_Init(SHA512_CTX *c); 106 | int SHA384_Update(SHA512_CTX *c, const void *data, size_t len); 107 | int SHA384_Final(unsigned char *md, SHA512_CTX *c); 108 | unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md); 109 | int SHA512_Init(SHA512_CTX *c); 110 | int SHA512_Update(SHA512_CTX *c, const void *data, size_t len); 111 | int SHA512_Final(unsigned char *md, SHA512_CTX *c); 112 | unsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md); 113 | void SHA512_Transform(SHA512_CTX *c, const unsigned char *data); 114 | 115 | #ifdef __cplusplus 116 | } 117 | #endif 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/srp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2004-2018 The OpenSSL Project Authors. All Rights Reserved. 3 | * Copyright (c) 2004, EdelKey Project. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | * 10 | * Originally written by Christophe Renou and Peter Sylvester, 11 | * for the EdelKey project. 12 | */ 13 | 14 | #ifndef HEADER_SRP_H 15 | # define HEADER_SRP_H 16 | 17 | #include 18 | 19 | #ifndef OPENSSL_NO_SRP 20 | # include 21 | # include 22 | # include 23 | # include 24 | # include 25 | 26 | # ifdef __cplusplus 27 | extern "C" { 28 | # endif 29 | 30 | typedef struct SRP_gN_cache_st { 31 | char *b64_bn; 32 | BIGNUM *bn; 33 | } SRP_gN_cache; 34 | 35 | 36 | DEFINE_STACK_OF(SRP_gN_cache) 37 | 38 | typedef struct SRP_user_pwd_st { 39 | /* Owned by us. */ 40 | char *id; 41 | BIGNUM *s; 42 | BIGNUM *v; 43 | /* Not owned by us. */ 44 | const BIGNUM *g; 45 | const BIGNUM *N; 46 | /* Owned by us. */ 47 | char *info; 48 | } SRP_user_pwd; 49 | 50 | void SRP_user_pwd_free(SRP_user_pwd *user_pwd); 51 | 52 | DEFINE_STACK_OF(SRP_user_pwd) 53 | 54 | typedef struct SRP_VBASE_st { 55 | STACK_OF(SRP_user_pwd) *users_pwd; 56 | STACK_OF(SRP_gN_cache) *gN_cache; 57 | /* to simulate a user */ 58 | char *seed_key; 59 | const BIGNUM *default_g; 60 | const BIGNUM *default_N; 61 | } SRP_VBASE; 62 | 63 | /* 64 | * Internal structure storing N and g pair 65 | */ 66 | typedef struct SRP_gN_st { 67 | char *id; 68 | const BIGNUM *g; 69 | const BIGNUM *N; 70 | } SRP_gN; 71 | 72 | DEFINE_STACK_OF(SRP_gN) 73 | 74 | SRP_VBASE *SRP_VBASE_new(char *seed_key); 75 | void SRP_VBASE_free(SRP_VBASE *vb); 76 | int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file); 77 | 78 | /* This method ignores the configured seed and fails for an unknown user. */ 79 | DEPRECATEDIN_1_1_0(SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username)) 80 | /* NOTE: unlike in SRP_VBASE_get_by_user, caller owns the returned pointer.*/ 81 | SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username); 82 | 83 | char *SRP_create_verifier(const char *user, const char *pass, char **salt, 84 | char **verifier, const char *N, const char *g); 85 | int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, 86 | BIGNUM **verifier, const BIGNUM *N, 87 | const BIGNUM *g); 88 | 89 | # define SRP_NO_ERROR 0 90 | # define SRP_ERR_VBASE_INCOMPLETE_FILE 1 91 | # define SRP_ERR_VBASE_BN_LIB 2 92 | # define SRP_ERR_OPEN_FILE 3 93 | # define SRP_ERR_MEMORY 4 94 | 95 | # define DB_srptype 0 96 | # define DB_srpverifier 1 97 | # define DB_srpsalt 2 98 | # define DB_srpid 3 99 | # define DB_srpgN 4 100 | # define DB_srpinfo 5 101 | # undef DB_NUMBER 102 | # define DB_NUMBER 6 103 | 104 | # define DB_SRP_INDEX 'I' 105 | # define DB_SRP_VALID 'V' 106 | # define DB_SRP_REVOKED 'R' 107 | # define DB_SRP_MODIF 'v' 108 | 109 | /* see srp.c */ 110 | char *SRP_check_known_gN_param(const BIGNUM *g, const BIGNUM *N); 111 | SRP_gN *SRP_get_default_gN(const char *id); 112 | 113 | /* server side .... */ 114 | BIGNUM *SRP_Calc_server_key(const BIGNUM *A, const BIGNUM *v, const BIGNUM *u, 115 | const BIGNUM *b, const BIGNUM *N); 116 | BIGNUM *SRP_Calc_B(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g, 117 | const BIGNUM *v); 118 | int SRP_Verify_A_mod_N(const BIGNUM *A, const BIGNUM *N); 119 | BIGNUM *SRP_Calc_u(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N); 120 | 121 | /* client side .... */ 122 | BIGNUM *SRP_Calc_x(const BIGNUM *s, const char *user, const char *pass); 123 | BIGNUM *SRP_Calc_A(const BIGNUM *a, const BIGNUM *N, const BIGNUM *g); 124 | BIGNUM *SRP_Calc_client_key(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g, 125 | const BIGNUM *x, const BIGNUM *a, const BIGNUM *u); 126 | int SRP_Verify_B_mod_N(const BIGNUM *B, const BIGNUM *N); 127 | 128 | # define SRP_MINIMAL_N 1024 129 | 130 | # ifdef __cplusplus 131 | } 132 | # endif 133 | # endif 134 | 135 | #endif 136 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/srtp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | /* 11 | * DTLS code by Eric Rescorla 12 | * 13 | * Copyright (C) 2006, Network Resonance, Inc. Copyright (C) 2011, RTFM, Inc. 14 | */ 15 | 16 | #ifndef HEADER_D1_SRTP_H 17 | # define HEADER_D1_SRTP_H 18 | 19 | # include 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | # define SRTP_AES128_CM_SHA1_80 0x0001 26 | # define SRTP_AES128_CM_SHA1_32 0x0002 27 | # define SRTP_AES128_F8_SHA1_80 0x0003 28 | # define SRTP_AES128_F8_SHA1_32 0x0004 29 | # define SRTP_NULL_SHA1_80 0x0005 30 | # define SRTP_NULL_SHA1_32 0x0006 31 | 32 | /* AEAD SRTP protection profiles from RFC 7714 */ 33 | # define SRTP_AEAD_AES_128_GCM 0x0007 34 | # define SRTP_AEAD_AES_256_GCM 0x0008 35 | 36 | # ifndef OPENSSL_NO_SRTP 37 | 38 | __owur int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles); 39 | __owur int SSL_set_tlsext_use_srtp(SSL *ssl, const char *profiles); 40 | 41 | __owur STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl); 42 | __owur SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s); 43 | 44 | # endif 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/ssl2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_SSL2_H 11 | # define HEADER_SSL2_H 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | # define SSL2_VERSION 0x0002 18 | 19 | # define SSL2_MT_CLIENT_HELLO 1 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_STACK_H 11 | # define HEADER_STACK_H 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | typedef struct stack_st OPENSSL_STACK; /* Use STACK_OF(...) instead */ 18 | 19 | typedef int (*OPENSSL_sk_compfunc)(const void *, const void *); 20 | typedef void (*OPENSSL_sk_freefunc)(void *); 21 | typedef void *(*OPENSSL_sk_copyfunc)(const void *); 22 | 23 | int OPENSSL_sk_num(const OPENSSL_STACK *); 24 | void *OPENSSL_sk_value(const OPENSSL_STACK *, int); 25 | 26 | void *OPENSSL_sk_set(OPENSSL_STACK *st, int i, const void *data); 27 | 28 | OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc cmp); 29 | OPENSSL_STACK *OPENSSL_sk_new_null(void); 30 | OPENSSL_STACK *OPENSSL_sk_new_reserve(OPENSSL_sk_compfunc c, int n); 31 | int OPENSSL_sk_reserve(OPENSSL_STACK *st, int n); 32 | void OPENSSL_sk_free(OPENSSL_STACK *); 33 | void OPENSSL_sk_pop_free(OPENSSL_STACK *st, void (*func) (void *)); 34 | OPENSSL_STACK *OPENSSL_sk_deep_copy(const OPENSSL_STACK *, 35 | OPENSSL_sk_copyfunc c, 36 | OPENSSL_sk_freefunc f); 37 | int OPENSSL_sk_insert(OPENSSL_STACK *sk, const void *data, int where); 38 | void *OPENSSL_sk_delete(OPENSSL_STACK *st, int loc); 39 | void *OPENSSL_sk_delete_ptr(OPENSSL_STACK *st, const void *p); 40 | int OPENSSL_sk_find(OPENSSL_STACK *st, const void *data); 41 | int OPENSSL_sk_find_ex(OPENSSL_STACK *st, const void *data); 42 | int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data); 43 | int OPENSSL_sk_unshift(OPENSSL_STACK *st, const void *data); 44 | void *OPENSSL_sk_shift(OPENSSL_STACK *st); 45 | void *OPENSSL_sk_pop(OPENSSL_STACK *st); 46 | void OPENSSL_sk_zero(OPENSSL_STACK *st); 47 | OPENSSL_sk_compfunc OPENSSL_sk_set_cmp_func(OPENSSL_STACK *sk, 48 | OPENSSL_sk_compfunc cmp); 49 | OPENSSL_STACK *OPENSSL_sk_dup(const OPENSSL_STACK *st); 50 | void OPENSSL_sk_sort(OPENSSL_STACK *st); 51 | int OPENSSL_sk_is_sorted(const OPENSSL_STACK *st); 52 | 53 | # if OPENSSL_API_COMPAT < 0x10100000L 54 | # define _STACK OPENSSL_STACK 55 | # define sk_num OPENSSL_sk_num 56 | # define sk_value OPENSSL_sk_value 57 | # define sk_set OPENSSL_sk_set 58 | # define sk_new OPENSSL_sk_new 59 | # define sk_new_null OPENSSL_sk_new_null 60 | # define sk_free OPENSSL_sk_free 61 | # define sk_pop_free OPENSSL_sk_pop_free 62 | # define sk_deep_copy OPENSSL_sk_deep_copy 63 | # define sk_insert OPENSSL_sk_insert 64 | # define sk_delete OPENSSL_sk_delete 65 | # define sk_delete_ptr OPENSSL_sk_delete_ptr 66 | # define sk_find OPENSSL_sk_find 67 | # define sk_find_ex OPENSSL_sk_find_ex 68 | # define sk_push OPENSSL_sk_push 69 | # define sk_unshift OPENSSL_sk_unshift 70 | # define sk_shift OPENSSL_sk_shift 71 | # define sk_pop OPENSSL_sk_pop 72 | # define sk_zero OPENSSL_sk_zero 73 | # define sk_set_cmp_func OPENSSL_sk_set_cmp_func 74 | # define sk_dup OPENSSL_sk_dup 75 | # define sk_sort OPENSSL_sk_sort 76 | # define sk_is_sorted OPENSSL_sk_is_sorted 77 | # endif 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/storeerr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_OSSL_STOREERR_H 12 | # define HEADER_OSSL_STOREERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # ifdef __cplusplus 19 | extern "C" 20 | # endif 21 | int ERR_load_OSSL_STORE_strings(void); 22 | 23 | /* 24 | * OSSL_STORE function codes. 25 | */ 26 | # define OSSL_STORE_F_FILE_CTRL 129 27 | # define OSSL_STORE_F_FILE_FIND 138 28 | # define OSSL_STORE_F_FILE_GET_PASS 118 29 | # define OSSL_STORE_F_FILE_LOAD 119 30 | # define OSSL_STORE_F_FILE_LOAD_TRY_DECODE 124 31 | # define OSSL_STORE_F_FILE_NAME_TO_URI 126 32 | # define OSSL_STORE_F_FILE_OPEN 120 33 | # define OSSL_STORE_F_OSSL_STORE_ATTACH_PEM_BIO 127 34 | # define OSSL_STORE_F_OSSL_STORE_EXPECT 130 35 | # define OSSL_STORE_F_OSSL_STORE_FILE_ATTACH_PEM_BIO_INT 128 36 | # define OSSL_STORE_F_OSSL_STORE_FIND 131 37 | # define OSSL_STORE_F_OSSL_STORE_GET0_LOADER_INT 100 38 | # define OSSL_STORE_F_OSSL_STORE_INFO_GET1_CERT 101 39 | # define OSSL_STORE_F_OSSL_STORE_INFO_GET1_CRL 102 40 | # define OSSL_STORE_F_OSSL_STORE_INFO_GET1_NAME 103 41 | # define OSSL_STORE_F_OSSL_STORE_INFO_GET1_NAME_DESCRIPTION 135 42 | # define OSSL_STORE_F_OSSL_STORE_INFO_GET1_PARAMS 104 43 | # define OSSL_STORE_F_OSSL_STORE_INFO_GET1_PKEY 105 44 | # define OSSL_STORE_F_OSSL_STORE_INFO_NEW_CERT 106 45 | # define OSSL_STORE_F_OSSL_STORE_INFO_NEW_CRL 107 46 | # define OSSL_STORE_F_OSSL_STORE_INFO_NEW_EMBEDDED 123 47 | # define OSSL_STORE_F_OSSL_STORE_INFO_NEW_NAME 109 48 | # define OSSL_STORE_F_OSSL_STORE_INFO_NEW_PARAMS 110 49 | # define OSSL_STORE_F_OSSL_STORE_INFO_NEW_PKEY 111 50 | # define OSSL_STORE_F_OSSL_STORE_INFO_SET0_NAME_DESCRIPTION 134 51 | # define OSSL_STORE_F_OSSL_STORE_INIT_ONCE 112 52 | # define OSSL_STORE_F_OSSL_STORE_LOADER_NEW 113 53 | # define OSSL_STORE_F_OSSL_STORE_OPEN 114 54 | # define OSSL_STORE_F_OSSL_STORE_OPEN_INT 115 55 | # define OSSL_STORE_F_OSSL_STORE_REGISTER_LOADER_INT 117 56 | # define OSSL_STORE_F_OSSL_STORE_SEARCH_BY_ALIAS 132 57 | # define OSSL_STORE_F_OSSL_STORE_SEARCH_BY_ISSUER_SERIAL 133 58 | # define OSSL_STORE_F_OSSL_STORE_SEARCH_BY_KEY_FINGERPRINT 136 59 | # define OSSL_STORE_F_OSSL_STORE_SEARCH_BY_NAME 137 60 | # define OSSL_STORE_F_OSSL_STORE_UNREGISTER_LOADER_INT 116 61 | # define OSSL_STORE_F_TRY_DECODE_PARAMS 121 62 | # define OSSL_STORE_F_TRY_DECODE_PKCS12 122 63 | # define OSSL_STORE_F_TRY_DECODE_PKCS8ENCRYPTED 125 64 | 65 | /* 66 | * OSSL_STORE reason codes. 67 | */ 68 | # define OSSL_STORE_R_AMBIGUOUS_CONTENT_TYPE 107 69 | # define OSSL_STORE_R_BAD_PASSWORD_READ 115 70 | # define OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC 113 71 | # define OSSL_STORE_R_FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST 121 72 | # define OSSL_STORE_R_INVALID_SCHEME 106 73 | # define OSSL_STORE_R_IS_NOT_A 112 74 | # define OSSL_STORE_R_LOADER_INCOMPLETE 116 75 | # define OSSL_STORE_R_LOADING_STARTED 117 76 | # define OSSL_STORE_R_NOT_A_CERTIFICATE 100 77 | # define OSSL_STORE_R_NOT_A_CRL 101 78 | # define OSSL_STORE_R_NOT_A_KEY 102 79 | # define OSSL_STORE_R_NOT_A_NAME 103 80 | # define OSSL_STORE_R_NOT_PARAMETERS 104 81 | # define OSSL_STORE_R_PASSPHRASE_CALLBACK_ERROR 114 82 | # define OSSL_STORE_R_PATH_MUST_BE_ABSOLUTE 108 83 | # define OSSL_STORE_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES 119 84 | # define OSSL_STORE_R_UI_PROCESS_INTERRUPTED_OR_CANCELLED 109 85 | # define OSSL_STORE_R_UNREGISTERED_SCHEME 105 86 | # define OSSL_STORE_R_UNSUPPORTED_CONTENT_TYPE 110 87 | # define OSSL_STORE_R_UNSUPPORTED_OPERATION 118 88 | # define OSSL_STORE_R_UNSUPPORTED_SEARCH_TYPE 120 89 | # define OSSL_STORE_R_URI_AUTHORITY_UNSUPPORTED 111 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/symhacks.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_SYMHACKS_H 11 | # define HEADER_SYMHACKS_H 12 | 13 | # include 14 | 15 | /* Case insensitive linking causes problems.... */ 16 | # if defined(OPENSSL_SYS_VMS) 17 | # undef ERR_load_CRYPTO_strings 18 | # define ERR_load_CRYPTO_strings ERR_load_CRYPTOlib_strings 19 | # undef OCSP_crlID_new 20 | # define OCSP_crlID_new OCSP_crlID2_new 21 | 22 | # undef d2i_ECPARAMETERS 23 | # define d2i_ECPARAMETERS d2i_UC_ECPARAMETERS 24 | # undef i2d_ECPARAMETERS 25 | # define i2d_ECPARAMETERS i2d_UC_ECPARAMETERS 26 | # undef d2i_ECPKPARAMETERS 27 | # define d2i_ECPKPARAMETERS d2i_UC_ECPKPARAMETERS 28 | # undef i2d_ECPKPARAMETERS 29 | # define i2d_ECPKPARAMETERS i2d_UC_ECPKPARAMETERS 30 | 31 | /* This one clashes with CMS_data_create */ 32 | # undef cms_Data_create 33 | # define cms_Data_create priv_cms_Data_create 34 | 35 | # endif 36 | 37 | #endif /* ! defined HEADER_VMS_IDHACKS_H */ 38 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/txt_db.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_TXT_DB_H 11 | # define HEADER_TXT_DB_H 12 | 13 | # include 14 | # include 15 | # include 16 | # include 17 | 18 | # define DB_ERROR_OK 0 19 | # define DB_ERROR_MALLOC 1 20 | # define DB_ERROR_INDEX_CLASH 2 21 | # define DB_ERROR_INDEX_OUT_OF_RANGE 3 22 | # define DB_ERROR_NO_INDEX 4 23 | # define DB_ERROR_INSERT_INDEX_CLASH 5 24 | # define DB_ERROR_WRONG_NUM_FIELDS 6 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | typedef OPENSSL_STRING *OPENSSL_PSTRING; 31 | DEFINE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING) 32 | 33 | typedef struct txt_db_st { 34 | int num_fields; 35 | STACK_OF(OPENSSL_PSTRING) *data; 36 | LHASH_OF(OPENSSL_STRING) **index; 37 | int (**qual) (OPENSSL_STRING *); 38 | long error; 39 | long arg1; 40 | long arg2; 41 | OPENSSL_STRING *arg_row; 42 | } TXT_DB; 43 | 44 | TXT_DB *TXT_DB_read(BIO *in, int num); 45 | long TXT_DB_write(BIO *out, TXT_DB *db); 46 | int TXT_DB_create_index(TXT_DB *db, int field, int (*qual) (OPENSSL_STRING *), 47 | OPENSSL_LH_HASHFUNC hash, OPENSSL_LH_COMPFUNC cmp); 48 | void TXT_DB_free(TXT_DB *db); 49 | OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx, 50 | OPENSSL_STRING *value); 51 | int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *value); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/uierr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Generated by util/mkerr.pl DO NOT EDIT 3 | * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. 4 | * 5 | * Licensed under the OpenSSL license (the "License"). You may not use 6 | * this file except in compliance with the License. You can obtain a copy 7 | * in the file LICENSE in the source distribution or at 8 | * https://www.openssl.org/source/license.html 9 | */ 10 | 11 | #ifndef HEADER_UIERR_H 12 | # define HEADER_UIERR_H 13 | 14 | # ifndef HEADER_SYMHACKS_H 15 | # include 16 | # endif 17 | 18 | # ifdef __cplusplus 19 | extern "C" 20 | # endif 21 | int ERR_load_UI_strings(void); 22 | 23 | /* 24 | * UI function codes. 25 | */ 26 | # define UI_F_CLOSE_CONSOLE 115 27 | # define UI_F_ECHO_CONSOLE 116 28 | # define UI_F_GENERAL_ALLOCATE_BOOLEAN 108 29 | # define UI_F_GENERAL_ALLOCATE_PROMPT 109 30 | # define UI_F_NOECHO_CONSOLE 117 31 | # define UI_F_OPEN_CONSOLE 114 32 | # define UI_F_UI_CONSTRUCT_PROMPT 121 33 | # define UI_F_UI_CREATE_METHOD 112 34 | # define UI_F_UI_CTRL 111 35 | # define UI_F_UI_DUP_ERROR_STRING 101 36 | # define UI_F_UI_DUP_INFO_STRING 102 37 | # define UI_F_UI_DUP_INPUT_BOOLEAN 110 38 | # define UI_F_UI_DUP_INPUT_STRING 103 39 | # define UI_F_UI_DUP_USER_DATA 118 40 | # define UI_F_UI_DUP_VERIFY_STRING 106 41 | # define UI_F_UI_GET0_RESULT 107 42 | # define UI_F_UI_GET_RESULT_LENGTH 119 43 | # define UI_F_UI_NEW_METHOD 104 44 | # define UI_F_UI_PROCESS 113 45 | # define UI_F_UI_SET_RESULT 105 46 | # define UI_F_UI_SET_RESULT_EX 120 47 | 48 | /* 49 | * UI reason codes. 50 | */ 51 | # define UI_R_COMMON_OK_AND_CANCEL_CHARACTERS 104 52 | # define UI_R_INDEX_TOO_LARGE 102 53 | # define UI_R_INDEX_TOO_SMALL 103 54 | # define UI_R_NO_RESULT_BUFFER 105 55 | # define UI_R_PROCESSING_ERROR 107 56 | # define UI_R_RESULT_TOO_LARGE 100 57 | # define UI_R_RESULT_TOO_SMALL 101 58 | # define UI_R_SYSASSIGN_ERROR 109 59 | # define UI_R_SYSDASSGN_ERROR 110 60 | # define UI_R_SYSQIOW_ERROR 111 61 | # define UI_R_UNKNOWN_CONTROL_COMMAND 106 62 | # define UI_R_UNKNOWN_TTYGET_ERRNO_VALUE 108 63 | # define UI_R_USER_DATA_DUPLICATION_UNSUPPORTED 112 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /ncmlib/ext/include/openssl/whrlpool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved. 3 | * 4 | * Licensed under the OpenSSL license (the "License"). You may not use 5 | * this file except in compliance with the License. You can obtain a copy 6 | * in the file LICENSE in the source distribution or at 7 | * https://www.openssl.org/source/license.html 8 | */ 9 | 10 | #ifndef HEADER_WHRLPOOL_H 11 | # define HEADER_WHRLPOOL_H 12 | 13 | #include 14 | 15 | # ifndef OPENSSL_NO_WHIRLPOOL 16 | # include 17 | # include 18 | # ifdef __cplusplus 19 | extern "C" { 20 | # endif 21 | 22 | # define WHIRLPOOL_DIGEST_LENGTH (512/8) 23 | # define WHIRLPOOL_BBLOCK 512 24 | # define WHIRLPOOL_COUNTER (256/8) 25 | 26 | typedef struct { 27 | union { 28 | unsigned char c[WHIRLPOOL_DIGEST_LENGTH]; 29 | /* double q is here to ensure 64-bit alignment */ 30 | double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)]; 31 | } H; 32 | unsigned char data[WHIRLPOOL_BBLOCK / 8]; 33 | unsigned int bitoff; 34 | size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)]; 35 | } WHIRLPOOL_CTX; 36 | 37 | int WHIRLPOOL_Init(WHIRLPOOL_CTX *c); 38 | int WHIRLPOOL_Update(WHIRLPOOL_CTX *c, const void *inp, size_t bytes); 39 | void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, const void *inp, size_t bits); 40 | int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c); 41 | unsigned char *WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md); 42 | 43 | # ifdef __cplusplus 44 | } 45 | # endif 46 | # endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /ncmlib/ext/lib/libcrypto_static.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Majjcom/ncmpp/32eac951e632fb68d57a98f0cf6f251fe2c889a0/ncmlib/ext/lib/libcrypto_static.lib -------------------------------------------------------------------------------- /ncmlib/ext/lib/libssl_static.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Majjcom/ncmpp/32eac951e632fb68d57a98f0cf6f251fe2c889a0/ncmlib/ext/lib/libssl_static.lib -------------------------------------------------------------------------------- /ncmlib/include/ncmlib/ncmdump.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace ncm 6 | { 7 | void ncmDump(std::string path, std::string outPath); 8 | } 9 | -------------------------------------------------------------------------------- /ncmlib/ncmlib.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 头文件 20 | 21 | 22 | 头文件 23 | 24 | 25 | 头文件 26 | 27 | 28 | 29 | 30 | 源文件 31 | 32 | 33 | 源文件 34 | 35 | 36 | 源文件 37 | 38 | 39 | -------------------------------------------------------------------------------- /ncmlib/ncmlib.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | true 5 | 6 | -------------------------------------------------------------------------------- /ncmlib/src/base64.h: -------------------------------------------------------------------------------- 1 | // 2 | // base64 encoding and decoding with C++. 3 | // Version: 2.rc.09 (release candidate) 4 | // 5 | 6 | #ifndef BASE64_H_C0CE2A47_D10E_42C9_A27C_C883944E704A 7 | #define BASE64_H_C0CE2A47_D10E_42C9_A27C_C883944E704A 8 | 9 | #include 10 | 11 | #if __cplusplus >= 201703L 12 | #include 13 | #endif // __cplusplus >= 201703L 14 | 15 | std::string base64_encode (std::string const& s, bool url = false); 16 | std::string base64_encode_pem (std::string const& s); 17 | std::string base64_encode_mime(std::string const& s); 18 | 19 | std::string base64_decode(std::string const& s, bool remove_linebreaks = false); 20 | std::string base64_encode(unsigned char const*, size_t len, bool url = false); 21 | 22 | #if __cplusplus >= 201703L 23 | // 24 | // Interface with std::string_view rather than const std::string& 25 | // Requires C++17 26 | // Provided by Yannic Bonenberger (https://github.com/Yannic) 27 | // 28 | std::string base64_encode (std::string_view s, bool url = false); 29 | std::string base64_encode_pem (std::string_view s); 30 | std::string base64_encode_mime(std::string_view s); 31 | 32 | std::string base64_decode(std::string_view s, bool remove_linebreaks = false); 33 | #endif // __cplusplus >= 201703L 34 | 35 | #endif /* BASE64_H_C0CE2A47_D10E_42C9_A27C_C883944E704A */ 36 | -------------------------------------------------------------------------------- /ncmlib/src/pkcs7.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "pkcs7.h" 3 | 4 | unsigned int pkcs7::pad_size(const unsigned char* src_, unsigned int len_) 5 | { 6 | unsigned int padlen = src_[len_ - 1]; 7 | return len_ - padlen; 8 | } 9 | 10 | void pkcs7::unpad(const unsigned char* src_, unsigned int len_, unsigned char* tgt_) 11 | { 12 | unsigned int size = pkcs7::pad_size(src_, len_); 13 | for (unsigned int i = 0; i < size; i++) 14 | { 15 | tgt_[i] = src_[i]; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ncmlib/src/pkcs7.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace pkcs7 4 | { 5 | unsigned int pad_size(const unsigned char* src_, unsigned int len_); 6 | void unpad(const unsigned char* src_, unsigned int len_, unsigned char* tgt_); 7 | } 8 | -------------------------------------------------------------------------------- /ncmlib/src/rapidjson/cursorstreamwrapper.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_CURSORSTREAMWRAPPER_H_ 16 | #define RAPIDJSON_CURSORSTREAMWRAPPER_H_ 17 | 18 | #include "stream.h" 19 | 20 | #if defined(__GNUC__) 21 | RAPIDJSON_DIAG_PUSH 22 | RAPIDJSON_DIAG_OFF(effc++) 23 | #endif 24 | 25 | #if defined(_MSC_VER) && _MSC_VER <= 1800 26 | RAPIDJSON_DIAG_PUSH 27 | RAPIDJSON_DIAG_OFF(4702) // unreachable code 28 | RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated 29 | #endif 30 | 31 | RAPIDJSON_NAMESPACE_BEGIN 32 | 33 | 34 | //! Cursor stream wrapper for counting line and column number if error exists. 35 | /*! 36 | \tparam InputStream Any stream that implements Stream Concept 37 | */ 38 | template > 39 | class CursorStreamWrapper : public GenericStreamWrapper { 40 | public: 41 | typedef typename Encoding::Ch Ch; 42 | 43 | CursorStreamWrapper(InputStream& is): 44 | GenericStreamWrapper(is), line_(1), col_(0) {} 45 | 46 | // counting line and column number 47 | Ch Take() { 48 | Ch ch = this->is_.Take(); 49 | if(ch == '\n') { 50 | line_ ++; 51 | col_ = 0; 52 | } else { 53 | col_ ++; 54 | } 55 | return ch; 56 | } 57 | 58 | //! Get the error line number, if error exists. 59 | size_t GetLine() const { return line_; } 60 | //! Get the error column number, if error exists. 61 | size_t GetColumn() const { return col_; } 62 | 63 | private: 64 | size_t line_; //!< Current Line 65 | size_t col_; //!< Current Column 66 | }; 67 | 68 | #if defined(_MSC_VER) && _MSC_VER <= 1800 69 | RAPIDJSON_DIAG_POP 70 | #endif 71 | 72 | #if defined(__GNUC__) 73 | RAPIDJSON_DIAG_POP 74 | #endif 75 | 76 | RAPIDJSON_NAMESPACE_END 77 | 78 | #endif // RAPIDJSON_CURSORSTREAMWRAPPER_H_ 79 | -------------------------------------------------------------------------------- /ncmlib/src/rapidjson/filereadstream.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_FILEREADSTREAM_H_ 16 | #define RAPIDJSON_FILEREADSTREAM_H_ 17 | 18 | #include "stream.h" 19 | #include 20 | 21 | #ifdef __clang__ 22 | RAPIDJSON_DIAG_PUSH 23 | RAPIDJSON_DIAG_OFF(padded) 24 | RAPIDJSON_DIAG_OFF(unreachable-code) 25 | RAPIDJSON_DIAG_OFF(missing-noreturn) 26 | #endif 27 | 28 | RAPIDJSON_NAMESPACE_BEGIN 29 | 30 | //! File byte stream for input using fread(). 31 | /*! 32 | \note implements Stream concept 33 | */ 34 | class FileReadStream { 35 | public: 36 | typedef char Ch; //!< Character type (byte). 37 | 38 | //! Constructor. 39 | /*! 40 | \param fp File pointer opened for read. 41 | \param buffer user-supplied buffer. 42 | \param bufferSize size of buffer in bytes. Must >=4 bytes. 43 | */ 44 | FileReadStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferSize_(bufferSize), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { 45 | RAPIDJSON_ASSERT(fp_ != 0); 46 | RAPIDJSON_ASSERT(bufferSize >= 4); 47 | Read(); 48 | } 49 | 50 | Ch Peek() const { return *current_; } 51 | Ch Take() { Ch c = *current_; Read(); return c; } 52 | size_t Tell() const { return count_ + static_cast(current_ - buffer_); } 53 | 54 | // Not implemented 55 | void Put(Ch) { RAPIDJSON_ASSERT(false); } 56 | void Flush() { RAPIDJSON_ASSERT(false); } 57 | Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } 58 | size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } 59 | 60 | // For encoding detection only. 61 | const Ch* Peek4() const { 62 | return (current_ + 4 - !eof_ <= bufferLast_) ? current_ : 0; 63 | } 64 | 65 | private: 66 | void Read() { 67 | if (current_ < bufferLast_) 68 | ++current_; 69 | else if (!eof_) { 70 | count_ += readCount_; 71 | readCount_ = std::fread(buffer_, 1, bufferSize_, fp_); 72 | bufferLast_ = buffer_ + readCount_ - 1; 73 | current_ = buffer_; 74 | 75 | if (readCount_ < bufferSize_) { 76 | buffer_[readCount_] = '\0'; 77 | ++bufferLast_; 78 | eof_ = true; 79 | } 80 | } 81 | } 82 | 83 | std::FILE* fp_; 84 | Ch *buffer_; 85 | size_t bufferSize_; 86 | Ch *bufferLast_; 87 | Ch *current_; 88 | size_t readCount_; 89 | size_t count_; //!< Number of characters read 90 | bool eof_; 91 | }; 92 | 93 | RAPIDJSON_NAMESPACE_END 94 | 95 | #ifdef __clang__ 96 | RAPIDJSON_DIAG_POP 97 | #endif 98 | 99 | #endif // RAPIDJSON_FILESTREAM_H_ 100 | -------------------------------------------------------------------------------- /ncmlib/src/rapidjson/filewritestream.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_FILEWRITESTREAM_H_ 16 | #define RAPIDJSON_FILEWRITESTREAM_H_ 17 | 18 | #include "stream.h" 19 | #include 20 | 21 | #ifdef __clang__ 22 | RAPIDJSON_DIAG_PUSH 23 | RAPIDJSON_DIAG_OFF(unreachable-code) 24 | #endif 25 | 26 | RAPIDJSON_NAMESPACE_BEGIN 27 | 28 | //! Wrapper of C file stream for output using fwrite(). 29 | /*! 30 | \note implements Stream concept 31 | */ 32 | class FileWriteStream { 33 | public: 34 | typedef char Ch; //!< Character type. Only support char. 35 | 36 | FileWriteStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferEnd_(buffer + bufferSize), current_(buffer_) { 37 | RAPIDJSON_ASSERT(fp_ != 0); 38 | } 39 | 40 | void Put(char c) { 41 | if (current_ >= bufferEnd_) 42 | Flush(); 43 | 44 | *current_++ = c; 45 | } 46 | 47 | void PutN(char c, size_t n) { 48 | size_t avail = static_cast(bufferEnd_ - current_); 49 | while (n > avail) { 50 | std::memset(current_, c, avail); 51 | current_ += avail; 52 | Flush(); 53 | n -= avail; 54 | avail = static_cast(bufferEnd_ - current_); 55 | } 56 | 57 | if (n > 0) { 58 | std::memset(current_, c, n); 59 | current_ += n; 60 | } 61 | } 62 | 63 | void Flush() { 64 | if (current_ != buffer_) { 65 | size_t result = std::fwrite(buffer_, 1, static_cast(current_ - buffer_), fp_); 66 | if (result < static_cast(current_ - buffer_)) { 67 | // failure deliberately ignored at this time 68 | // added to avoid warn_unused_result build errors 69 | } 70 | current_ = buffer_; 71 | } 72 | } 73 | 74 | // Not implemented 75 | char Peek() const { RAPIDJSON_ASSERT(false); return 0; } 76 | char Take() { RAPIDJSON_ASSERT(false); return 0; } 77 | size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } 78 | char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } 79 | size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; } 80 | 81 | private: 82 | // Prohibit copy constructor & assignment operator. 83 | FileWriteStream(const FileWriteStream&); 84 | FileWriteStream& operator=(const FileWriteStream&); 85 | 86 | std::FILE* fp_; 87 | char *buffer_; 88 | char *bufferEnd_; 89 | char *current_; 90 | }; 91 | 92 | //! Implement specialized version of PutN() with memset() for better performance. 93 | template<> 94 | inline void PutN(FileWriteStream& stream, char c, size_t n) { 95 | stream.PutN(c, n); 96 | } 97 | 98 | RAPIDJSON_NAMESPACE_END 99 | 100 | #ifdef __clang__ 101 | RAPIDJSON_DIAG_POP 102 | #endif 103 | 104 | #endif // RAPIDJSON_FILESTREAM_H_ 105 | -------------------------------------------------------------------------------- /ncmlib/src/rapidjson/fwd.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_FWD_H_ 16 | #define RAPIDJSON_FWD_H_ 17 | 18 | #include "rapidjson.h" 19 | 20 | RAPIDJSON_NAMESPACE_BEGIN 21 | 22 | // encodings.h 23 | 24 | template struct UTF8; 25 | template struct UTF16; 26 | template struct UTF16BE; 27 | template struct UTF16LE; 28 | template struct UTF32; 29 | template struct UTF32BE; 30 | template struct UTF32LE; 31 | template struct ASCII; 32 | template struct AutoUTF; 33 | 34 | template 35 | struct Transcoder; 36 | 37 | // allocators.h 38 | 39 | class CrtAllocator; 40 | 41 | template 42 | class MemoryPoolAllocator; 43 | 44 | // stream.h 45 | 46 | template 47 | struct GenericStringStream; 48 | 49 | typedef GenericStringStream > StringStream; 50 | 51 | template 52 | struct GenericInsituStringStream; 53 | 54 | typedef GenericInsituStringStream > InsituStringStream; 55 | 56 | // stringbuffer.h 57 | 58 | template 59 | class GenericStringBuffer; 60 | 61 | typedef GenericStringBuffer, CrtAllocator> StringBuffer; 62 | 63 | // filereadstream.h 64 | 65 | class FileReadStream; 66 | 67 | // filewritestream.h 68 | 69 | class FileWriteStream; 70 | 71 | // memorybuffer.h 72 | 73 | template 74 | struct GenericMemoryBuffer; 75 | 76 | typedef GenericMemoryBuffer MemoryBuffer; 77 | 78 | // memorystream.h 79 | 80 | struct MemoryStream; 81 | 82 | // reader.h 83 | 84 | template 85 | struct BaseReaderHandler; 86 | 87 | template 88 | class GenericReader; 89 | 90 | typedef GenericReader, UTF8, CrtAllocator> Reader; 91 | 92 | // writer.h 93 | 94 | template 95 | class Writer; 96 | 97 | // prettywriter.h 98 | 99 | template 100 | class PrettyWriter; 101 | 102 | // document.h 103 | 104 | template 105 | class GenericMember; 106 | 107 | template 108 | class GenericMemberIterator; 109 | 110 | template 111 | struct GenericStringRef; 112 | 113 | template 114 | class GenericValue; 115 | 116 | typedef GenericValue, MemoryPoolAllocator > Value; 117 | 118 | template 119 | class GenericDocument; 120 | 121 | typedef GenericDocument, MemoryPoolAllocator, CrtAllocator> Document; 122 | 123 | // pointer.h 124 | 125 | template 126 | class GenericPointer; 127 | 128 | typedef GenericPointer Pointer; 129 | 130 | // schema.h 131 | 132 | template 133 | class IGenericRemoteSchemaDocumentProvider; 134 | 135 | template 136 | class GenericSchemaDocument; 137 | 138 | typedef GenericSchemaDocument SchemaDocument; 139 | typedef IGenericRemoteSchemaDocumentProvider IRemoteSchemaDocumentProvider; 140 | 141 | template < 142 | typename SchemaDocumentType, 143 | typename OutputHandler, 144 | typename StateAllocator> 145 | class GenericSchemaValidator; 146 | 147 | typedef GenericSchemaValidator, void>, CrtAllocator> SchemaValidator; 148 | 149 | RAPIDJSON_NAMESPACE_END 150 | 151 | #endif // RAPIDJSON_RAPIDJSONFWD_H_ 152 | -------------------------------------------------------------------------------- /ncmlib/src/rapidjson/internal/clzll.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_CLZLL_H_ 16 | #define RAPIDJSON_CLZLL_H_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | #if defined(_MSC_VER) && !defined(UNDER_CE) 21 | #include 22 | #if defined(_WIN64) 23 | #pragma intrinsic(_BitScanReverse64) 24 | #else 25 | #pragma intrinsic(_BitScanReverse) 26 | #endif 27 | #endif 28 | 29 | RAPIDJSON_NAMESPACE_BEGIN 30 | namespace internal { 31 | 32 | inline uint32_t clzll(uint64_t x) { 33 | // Passing 0 to __builtin_clzll is UB in GCC and results in an 34 | // infinite loop in the software implementation. 35 | RAPIDJSON_ASSERT(x != 0); 36 | 37 | #if defined(_MSC_VER) && !defined(UNDER_CE) 38 | unsigned long r = 0; 39 | #if defined(_WIN64) 40 | _BitScanReverse64(&r, x); 41 | #else 42 | // Scan the high 32 bits. 43 | if (_BitScanReverse(&r, static_cast(x >> 32))) 44 | return 63 - (r + 32); 45 | 46 | // Scan the low 32 bits. 47 | _BitScanReverse(&r, static_cast(x & 0xFFFFFFFF)); 48 | #endif // _WIN64 49 | 50 | return 63 - r; 51 | #elif (defined(__GNUC__) && __GNUC__ >= 4) || RAPIDJSON_HAS_BUILTIN(__builtin_clzll) 52 | // __builtin_clzll wrapper 53 | return static_cast(__builtin_clzll(x)); 54 | #else 55 | // naive version 56 | uint32_t r = 0; 57 | while (!(x & (static_cast(1) << 63))) { 58 | x <<= 1; 59 | ++r; 60 | } 61 | 62 | return r; 63 | #endif // _MSC_VER 64 | } 65 | 66 | #define RAPIDJSON_CLZLL RAPIDJSON_NAMESPACE::internal::clzll 67 | 68 | } // namespace internal 69 | RAPIDJSON_NAMESPACE_END 70 | 71 | #endif // RAPIDJSON_CLZLL_H_ 72 | -------------------------------------------------------------------------------- /ncmlib/src/rapidjson/internal/ieee754.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_IEEE754_ 16 | #define RAPIDJSON_IEEE754_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | RAPIDJSON_NAMESPACE_BEGIN 21 | namespace internal { 22 | 23 | class Double { 24 | public: 25 | Double() {} 26 | Double(double d) : d_(d) {} 27 | Double(uint64_t u) : u_(u) {} 28 | 29 | double Value() const { return d_; } 30 | uint64_t Uint64Value() const { return u_; } 31 | 32 | double NextPositiveDouble() const { 33 | RAPIDJSON_ASSERT(!Sign()); 34 | return Double(u_ + 1).Value(); 35 | } 36 | 37 | bool Sign() const { return (u_ & kSignMask) != 0; } 38 | uint64_t Significand() const { return u_ & kSignificandMask; } 39 | int Exponent() const { return static_cast(((u_ & kExponentMask) >> kSignificandSize) - kExponentBias); } 40 | 41 | bool IsNan() const { return (u_ & kExponentMask) == kExponentMask && Significand() != 0; } 42 | bool IsInf() const { return (u_ & kExponentMask) == kExponentMask && Significand() == 0; } 43 | bool IsNanOrInf() const { return (u_ & kExponentMask) == kExponentMask; } 44 | bool IsNormal() const { return (u_ & kExponentMask) != 0 || Significand() == 0; } 45 | bool IsZero() const { return (u_ & (kExponentMask | kSignificandMask)) == 0; } 46 | 47 | uint64_t IntegerSignificand() const { return IsNormal() ? Significand() | kHiddenBit : Significand(); } 48 | int IntegerExponent() const { return (IsNormal() ? Exponent() : kDenormalExponent) - kSignificandSize; } 49 | uint64_t ToBias() const { return (u_ & kSignMask) ? ~u_ + 1 : u_ | kSignMask; } 50 | 51 | static int EffectiveSignificandSize(int order) { 52 | if (order >= -1021) 53 | return 53; 54 | else if (order <= -1074) 55 | return 0; 56 | else 57 | return order + 1074; 58 | } 59 | 60 | private: 61 | static const int kSignificandSize = 52; 62 | static const int kExponentBias = 0x3FF; 63 | static const int kDenormalExponent = 1 - kExponentBias; 64 | static const uint64_t kSignMask = RAPIDJSON_UINT64_C2(0x80000000, 0x00000000); 65 | static const uint64_t kExponentMask = RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000); 66 | static const uint64_t kSignificandMask = RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF); 67 | static const uint64_t kHiddenBit = RAPIDJSON_UINT64_C2(0x00100000, 0x00000000); 68 | 69 | union { 70 | double d_; 71 | uint64_t u_; 72 | }; 73 | }; 74 | 75 | } // namespace internal 76 | RAPIDJSON_NAMESPACE_END 77 | 78 | #endif // RAPIDJSON_IEEE754_ 79 | -------------------------------------------------------------------------------- /ncmlib/src/rapidjson/internal/pow10.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_POW10_ 16 | #define RAPIDJSON_POW10_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | RAPIDJSON_NAMESPACE_BEGIN 21 | namespace internal { 22 | 23 | //! Computes integer powers of 10 in double (10.0^n). 24 | /*! This function uses lookup table for fast and accurate results. 25 | \param n non-negative exponent. Must <= 308. 26 | \return 10.0^n 27 | */ 28 | inline double Pow10(int n) { 29 | static const double e[] = { // 1e-0...1e308: 309 * 8 bytes = 2472 bytes 30 | 1e+0, 31 | 1e+1, 1e+2, 1e+3, 1e+4, 1e+5, 1e+6, 1e+7, 1e+8, 1e+9, 1e+10, 1e+11, 1e+12, 1e+13, 1e+14, 1e+15, 1e+16, 1e+17, 1e+18, 1e+19, 1e+20, 32 | 1e+21, 1e+22, 1e+23, 1e+24, 1e+25, 1e+26, 1e+27, 1e+28, 1e+29, 1e+30, 1e+31, 1e+32, 1e+33, 1e+34, 1e+35, 1e+36, 1e+37, 1e+38, 1e+39, 1e+40, 33 | 1e+41, 1e+42, 1e+43, 1e+44, 1e+45, 1e+46, 1e+47, 1e+48, 1e+49, 1e+50, 1e+51, 1e+52, 1e+53, 1e+54, 1e+55, 1e+56, 1e+57, 1e+58, 1e+59, 1e+60, 34 | 1e+61, 1e+62, 1e+63, 1e+64, 1e+65, 1e+66, 1e+67, 1e+68, 1e+69, 1e+70, 1e+71, 1e+72, 1e+73, 1e+74, 1e+75, 1e+76, 1e+77, 1e+78, 1e+79, 1e+80, 35 | 1e+81, 1e+82, 1e+83, 1e+84, 1e+85, 1e+86, 1e+87, 1e+88, 1e+89, 1e+90, 1e+91, 1e+92, 1e+93, 1e+94, 1e+95, 1e+96, 1e+97, 1e+98, 1e+99, 1e+100, 36 | 1e+101,1e+102,1e+103,1e+104,1e+105,1e+106,1e+107,1e+108,1e+109,1e+110,1e+111,1e+112,1e+113,1e+114,1e+115,1e+116,1e+117,1e+118,1e+119,1e+120, 37 | 1e+121,1e+122,1e+123,1e+124,1e+125,1e+126,1e+127,1e+128,1e+129,1e+130,1e+131,1e+132,1e+133,1e+134,1e+135,1e+136,1e+137,1e+138,1e+139,1e+140, 38 | 1e+141,1e+142,1e+143,1e+144,1e+145,1e+146,1e+147,1e+148,1e+149,1e+150,1e+151,1e+152,1e+153,1e+154,1e+155,1e+156,1e+157,1e+158,1e+159,1e+160, 39 | 1e+161,1e+162,1e+163,1e+164,1e+165,1e+166,1e+167,1e+168,1e+169,1e+170,1e+171,1e+172,1e+173,1e+174,1e+175,1e+176,1e+177,1e+178,1e+179,1e+180, 40 | 1e+181,1e+182,1e+183,1e+184,1e+185,1e+186,1e+187,1e+188,1e+189,1e+190,1e+191,1e+192,1e+193,1e+194,1e+195,1e+196,1e+197,1e+198,1e+199,1e+200, 41 | 1e+201,1e+202,1e+203,1e+204,1e+205,1e+206,1e+207,1e+208,1e+209,1e+210,1e+211,1e+212,1e+213,1e+214,1e+215,1e+216,1e+217,1e+218,1e+219,1e+220, 42 | 1e+221,1e+222,1e+223,1e+224,1e+225,1e+226,1e+227,1e+228,1e+229,1e+230,1e+231,1e+232,1e+233,1e+234,1e+235,1e+236,1e+237,1e+238,1e+239,1e+240, 43 | 1e+241,1e+242,1e+243,1e+244,1e+245,1e+246,1e+247,1e+248,1e+249,1e+250,1e+251,1e+252,1e+253,1e+254,1e+255,1e+256,1e+257,1e+258,1e+259,1e+260, 44 | 1e+261,1e+262,1e+263,1e+264,1e+265,1e+266,1e+267,1e+268,1e+269,1e+270,1e+271,1e+272,1e+273,1e+274,1e+275,1e+276,1e+277,1e+278,1e+279,1e+280, 45 | 1e+281,1e+282,1e+283,1e+284,1e+285,1e+286,1e+287,1e+288,1e+289,1e+290,1e+291,1e+292,1e+293,1e+294,1e+295,1e+296,1e+297,1e+298,1e+299,1e+300, 46 | 1e+301,1e+302,1e+303,1e+304,1e+305,1e+306,1e+307,1e+308 47 | }; 48 | RAPIDJSON_ASSERT(n >= 0 && n <= 308); 49 | return e[n]; 50 | } 51 | 52 | } // namespace internal 53 | RAPIDJSON_NAMESPACE_END 54 | 55 | #endif // RAPIDJSON_POW10_ 56 | -------------------------------------------------------------------------------- /ncmlib/src/rapidjson/internal/strfunc.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_INTERNAL_STRFUNC_H_ 16 | #define RAPIDJSON_INTERNAL_STRFUNC_H_ 17 | 18 | #include "../stream.h" 19 | #include 20 | 21 | RAPIDJSON_NAMESPACE_BEGIN 22 | namespace internal { 23 | 24 | //! Custom strlen() which works on different character types. 25 | /*! \tparam Ch Character type (e.g. char, wchar_t, short) 26 | \param s Null-terminated input string. 27 | \return Number of characters in the string. 28 | \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints. 29 | */ 30 | template 31 | inline SizeType StrLen(const Ch* s) { 32 | RAPIDJSON_ASSERT(s != 0); 33 | const Ch* p = s; 34 | while (*p) ++p; 35 | return SizeType(p - s); 36 | } 37 | 38 | template <> 39 | inline SizeType StrLen(const char* s) { 40 | return SizeType(std::strlen(s)); 41 | } 42 | 43 | template <> 44 | inline SizeType StrLen(const wchar_t* s) { 45 | return SizeType(std::wcslen(s)); 46 | } 47 | 48 | //! Custom strcmpn() which works on different character types. 49 | /*! \tparam Ch Character type (e.g. char, wchar_t, short) 50 | \param s1 Null-terminated input string. 51 | \param s2 Null-terminated input string. 52 | \return 0 if equal 53 | */ 54 | template 55 | inline int StrCmp(const Ch* s1, const Ch* s2) { 56 | RAPIDJSON_ASSERT(s1 != 0); 57 | RAPIDJSON_ASSERT(s2 != 0); 58 | while(*s1 && (*s1 == *s2)) { s1++; s2++; } 59 | return static_cast(*s1) < static_cast(*s2) ? -1 : static_cast(*s1) > static_cast(*s2); 60 | } 61 | 62 | //! Returns number of code points in a encoded string. 63 | template 64 | bool CountStringCodePoint(const typename Encoding::Ch* s, SizeType length, SizeType* outCount) { 65 | RAPIDJSON_ASSERT(s != 0); 66 | RAPIDJSON_ASSERT(outCount != 0); 67 | GenericStringStream is(s); 68 | const typename Encoding::Ch* end = s + length; 69 | SizeType count = 0; 70 | while (is.src_ < end) { 71 | unsigned codepoint; 72 | if (!Encoding::Decode(is, &codepoint)) 73 | return false; 74 | count++; 75 | } 76 | *outCount = count; 77 | return true; 78 | } 79 | 80 | } // namespace internal 81 | RAPIDJSON_NAMESPACE_END 82 | 83 | #endif // RAPIDJSON_INTERNAL_STRFUNC_H_ 84 | -------------------------------------------------------------------------------- /ncmlib/src/rapidjson/internal/swap.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_INTERNAL_SWAP_H_ 16 | #define RAPIDJSON_INTERNAL_SWAP_H_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | #if defined(__clang__) 21 | RAPIDJSON_DIAG_PUSH 22 | RAPIDJSON_DIAG_OFF(c++98-compat) 23 | #endif 24 | 25 | RAPIDJSON_NAMESPACE_BEGIN 26 | namespace internal { 27 | 28 | //! Custom swap() to avoid dependency on C++ header 29 | /*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only. 30 | \note This has the same semantics as std::swap(). 31 | */ 32 | template 33 | inline void Swap(T& a, T& b) RAPIDJSON_NOEXCEPT { 34 | T tmp = a; 35 | a = b; 36 | b = tmp; 37 | } 38 | 39 | } // namespace internal 40 | RAPIDJSON_NAMESPACE_END 41 | 42 | #if defined(__clang__) 43 | RAPIDJSON_DIAG_POP 44 | #endif 45 | 46 | #endif // RAPIDJSON_INTERNAL_SWAP_H_ 47 | -------------------------------------------------------------------------------- /ncmlib/src/rapidjson/istreamwrapper.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_ISTREAMWRAPPER_H_ 16 | #define RAPIDJSON_ISTREAMWRAPPER_H_ 17 | 18 | #include "stream.h" 19 | #include 20 | #include 21 | 22 | #ifdef __clang__ 23 | RAPIDJSON_DIAG_PUSH 24 | RAPIDJSON_DIAG_OFF(padded) 25 | #elif defined(_MSC_VER) 26 | RAPIDJSON_DIAG_PUSH 27 | RAPIDJSON_DIAG_OFF(4351) // new behavior: elements of array 'array' will be default initialized 28 | #endif 29 | 30 | RAPIDJSON_NAMESPACE_BEGIN 31 | 32 | //! Wrapper of \c std::basic_istream into RapidJSON's Stream concept. 33 | /*! 34 | The classes can be wrapped including but not limited to: 35 | 36 | - \c std::istringstream 37 | - \c std::stringstream 38 | - \c std::wistringstream 39 | - \c std::wstringstream 40 | - \c std::ifstream 41 | - \c std::fstream 42 | - \c std::wifstream 43 | - \c std::wfstream 44 | 45 | \tparam StreamType Class derived from \c std::basic_istream. 46 | */ 47 | 48 | template 49 | class BasicIStreamWrapper { 50 | public: 51 | typedef typename StreamType::char_type Ch; 52 | 53 | //! Constructor. 54 | /*! 55 | \param stream stream opened for read. 56 | */ 57 | BasicIStreamWrapper(StreamType &stream) : stream_(stream), buffer_(peekBuffer_), bufferSize_(4), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { 58 | Read(); 59 | } 60 | 61 | //! Constructor. 62 | /*! 63 | \param stream stream opened for read. 64 | \param buffer user-supplied buffer. 65 | \param bufferSize size of buffer in bytes. Must >=4 bytes. 66 | */ 67 | BasicIStreamWrapper(StreamType &stream, char* buffer, size_t bufferSize) : stream_(stream), buffer_(buffer), bufferSize_(bufferSize), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { 68 | RAPIDJSON_ASSERT(bufferSize >= 4); 69 | Read(); 70 | } 71 | 72 | Ch Peek() const { return *current_; } 73 | Ch Take() { Ch c = *current_; Read(); return c; } 74 | size_t Tell() const { return count_ + static_cast(current_ - buffer_); } 75 | 76 | // Not implemented 77 | void Put(Ch) { RAPIDJSON_ASSERT(false); } 78 | void Flush() { RAPIDJSON_ASSERT(false); } 79 | Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } 80 | size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } 81 | 82 | // For encoding detection only. 83 | const Ch* Peek4() const { 84 | return (current_ + 4 - !eof_ <= bufferLast_) ? current_ : 0; 85 | } 86 | 87 | private: 88 | BasicIStreamWrapper(); 89 | BasicIStreamWrapper(const BasicIStreamWrapper&); 90 | BasicIStreamWrapper& operator=(const BasicIStreamWrapper&); 91 | 92 | void Read() { 93 | if (current_ < bufferLast_) 94 | ++current_; 95 | else if (!eof_) { 96 | count_ += readCount_; 97 | readCount_ = bufferSize_; 98 | bufferLast_ = buffer_ + readCount_ - 1; 99 | current_ = buffer_; 100 | 101 | if (!stream_.read(buffer_, static_cast(bufferSize_))) { 102 | readCount_ = static_cast(stream_.gcount()); 103 | *(bufferLast_ = buffer_ + readCount_) = '\0'; 104 | eof_ = true; 105 | } 106 | } 107 | } 108 | 109 | StreamType &stream_; 110 | Ch peekBuffer_[4], *buffer_; 111 | size_t bufferSize_; 112 | Ch *bufferLast_; 113 | Ch *current_; 114 | size_t readCount_; 115 | size_t count_; //!< Number of characters read 116 | bool eof_; 117 | }; 118 | 119 | typedef BasicIStreamWrapper IStreamWrapper; 120 | typedef BasicIStreamWrapper WIStreamWrapper; 121 | 122 | #if defined(__clang__) || defined(_MSC_VER) 123 | RAPIDJSON_DIAG_POP 124 | #endif 125 | 126 | RAPIDJSON_NAMESPACE_END 127 | 128 | #endif // RAPIDJSON_ISTREAMWRAPPER_H_ 129 | -------------------------------------------------------------------------------- /ncmlib/src/rapidjson/memorybuffer.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_MEMORYBUFFER_H_ 16 | #define RAPIDJSON_MEMORYBUFFER_H_ 17 | 18 | #include "stream.h" 19 | #include "internal/stack.h" 20 | 21 | RAPIDJSON_NAMESPACE_BEGIN 22 | 23 | //! Represents an in-memory output byte stream. 24 | /*! 25 | This class is mainly for being wrapped by EncodedOutputStream or AutoUTFOutputStream. 26 | 27 | It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file. 28 | 29 | Differences between MemoryBuffer and StringBuffer: 30 | 1. StringBuffer has Encoding but MemoryBuffer is only a byte buffer. 31 | 2. StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator. 32 | 33 | \tparam Allocator type for allocating memory buffer. 34 | \note implements Stream concept 35 | */ 36 | template 37 | struct GenericMemoryBuffer { 38 | typedef char Ch; // byte 39 | 40 | GenericMemoryBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} 41 | 42 | void Put(Ch c) { *stack_.template Push() = c; } 43 | void Flush() {} 44 | 45 | void Clear() { stack_.Clear(); } 46 | void ShrinkToFit() { stack_.ShrinkToFit(); } 47 | Ch* Push(size_t count) { return stack_.template Push(count); } 48 | void Pop(size_t count) { stack_.template Pop(count); } 49 | 50 | const Ch* GetBuffer() const { 51 | return stack_.template Bottom(); 52 | } 53 | 54 | size_t GetSize() const { return stack_.GetSize(); } 55 | 56 | static const size_t kDefaultCapacity = 256; 57 | mutable internal::Stack stack_; 58 | }; 59 | 60 | typedef GenericMemoryBuffer<> MemoryBuffer; 61 | 62 | //! Implement specialized version of PutN() with memset() for better performance. 63 | template<> 64 | inline void PutN(MemoryBuffer& memoryBuffer, char c, size_t n) { 65 | std::memset(memoryBuffer.stack_.Push(n), c, n * sizeof(c)); 66 | } 67 | 68 | RAPIDJSON_NAMESPACE_END 69 | 70 | #endif // RAPIDJSON_MEMORYBUFFER_H_ 71 | -------------------------------------------------------------------------------- /ncmlib/src/rapidjson/memorystream.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_MEMORYSTREAM_H_ 16 | #define RAPIDJSON_MEMORYSTREAM_H_ 17 | 18 | #include "stream.h" 19 | 20 | #ifdef __clang__ 21 | RAPIDJSON_DIAG_PUSH 22 | RAPIDJSON_DIAG_OFF(unreachable-code) 23 | RAPIDJSON_DIAG_OFF(missing-noreturn) 24 | #endif 25 | 26 | RAPIDJSON_NAMESPACE_BEGIN 27 | 28 | //! Represents an in-memory input byte stream. 29 | /*! 30 | This class is mainly for being wrapped by EncodedInputStream or AutoUTFInputStream. 31 | 32 | It is similar to FileReadBuffer but the source is an in-memory buffer instead of a file. 33 | 34 | Differences between MemoryStream and StringStream: 35 | 1. StringStream has encoding but MemoryStream is a byte stream. 36 | 2. MemoryStream needs size of the source buffer and the buffer don't need to be null terminated. StringStream assume null-terminated string as source. 37 | 3. MemoryStream supports Peek4() for encoding detection. StringStream is specified with an encoding so it should not have Peek4(). 38 | \note implements Stream concept 39 | */ 40 | struct MemoryStream { 41 | typedef char Ch; // byte 42 | 43 | MemoryStream(const Ch *src, size_t size) : src_(src), begin_(src), end_(src + size), size_(size) {} 44 | 45 | Ch Peek() const { return RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_; } 46 | Ch Take() { return RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_++; } 47 | size_t Tell() const { return static_cast(src_ - begin_); } 48 | 49 | Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } 50 | void Put(Ch) { RAPIDJSON_ASSERT(false); } 51 | void Flush() { RAPIDJSON_ASSERT(false); } 52 | size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } 53 | 54 | // For encoding detection only. 55 | const Ch* Peek4() const { 56 | return Tell() + 4 <= size_ ? src_ : 0; 57 | } 58 | 59 | const Ch* src_; //!< Current read position. 60 | const Ch* begin_; //!< Original head of the string. 61 | const Ch* end_; //!< End of stream. 62 | size_t size_; //!< Size of the stream. 63 | }; 64 | 65 | RAPIDJSON_NAMESPACE_END 66 | 67 | #ifdef __clang__ 68 | RAPIDJSON_DIAG_POP 69 | #endif 70 | 71 | #endif // RAPIDJSON_MEMORYBUFFER_H_ 72 | -------------------------------------------------------------------------------- /ncmlib/src/rapidjson/ostreamwrapper.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_OSTREAMWRAPPER_H_ 16 | #define RAPIDJSON_OSTREAMWRAPPER_H_ 17 | 18 | #include "stream.h" 19 | #include 20 | 21 | #ifdef __clang__ 22 | RAPIDJSON_DIAG_PUSH 23 | RAPIDJSON_DIAG_OFF(padded) 24 | #endif 25 | 26 | RAPIDJSON_NAMESPACE_BEGIN 27 | 28 | //! Wrapper of \c std::basic_ostream into RapidJSON's Stream concept. 29 | /*! 30 | The classes can be wrapped including but not limited to: 31 | 32 | - \c std::ostringstream 33 | - \c std::stringstream 34 | - \c std::wpstringstream 35 | - \c std::wstringstream 36 | - \c std::ifstream 37 | - \c std::fstream 38 | - \c std::wofstream 39 | - \c std::wfstream 40 | 41 | \tparam StreamType Class derived from \c std::basic_ostream. 42 | */ 43 | 44 | template 45 | class BasicOStreamWrapper { 46 | public: 47 | typedef typename StreamType::char_type Ch; 48 | BasicOStreamWrapper(StreamType& stream) : stream_(stream) {} 49 | 50 | void Put(Ch c) { 51 | stream_.put(c); 52 | } 53 | 54 | void Flush() { 55 | stream_.flush(); 56 | } 57 | 58 | // Not implemented 59 | char Peek() const { RAPIDJSON_ASSERT(false); return 0; } 60 | char Take() { RAPIDJSON_ASSERT(false); return 0; } 61 | size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } 62 | char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } 63 | size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; } 64 | 65 | private: 66 | BasicOStreamWrapper(const BasicOStreamWrapper&); 67 | BasicOStreamWrapper& operator=(const BasicOStreamWrapper&); 68 | 69 | StreamType& stream_; 70 | }; 71 | 72 | typedef BasicOStreamWrapper OStreamWrapper; 73 | typedef BasicOStreamWrapper WOStreamWrapper; 74 | 75 | #ifdef __clang__ 76 | RAPIDJSON_DIAG_POP 77 | #endif 78 | 79 | RAPIDJSON_NAMESPACE_END 80 | 81 | #endif // RAPIDJSON_OSTREAMWRAPPER_H_ 82 | -------------------------------------------------------------------------------- /ncmlib/src/rapidjson/stringbuffer.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_STRINGBUFFER_H_ 16 | #define RAPIDJSON_STRINGBUFFER_H_ 17 | 18 | #include "stream.h" 19 | #include "internal/stack.h" 20 | 21 | #if RAPIDJSON_HAS_CXX11_RVALUE_REFS 22 | #include // std::move 23 | #endif 24 | 25 | #include "internal/stack.h" 26 | 27 | #if defined(__clang__) 28 | RAPIDJSON_DIAG_PUSH 29 | RAPIDJSON_DIAG_OFF(c++98-compat) 30 | #endif 31 | 32 | RAPIDJSON_NAMESPACE_BEGIN 33 | 34 | //! Represents an in-memory output stream. 35 | /*! 36 | \tparam Encoding Encoding of the stream. 37 | \tparam Allocator type for allocating memory buffer. 38 | \note implements Stream concept 39 | */ 40 | template 41 | class GenericStringBuffer { 42 | public: 43 | typedef typename Encoding::Ch Ch; 44 | 45 | GenericStringBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} 46 | 47 | #if RAPIDJSON_HAS_CXX11_RVALUE_REFS 48 | GenericStringBuffer(GenericStringBuffer&& rhs) : stack_(std::move(rhs.stack_)) {} 49 | GenericStringBuffer& operator=(GenericStringBuffer&& rhs) { 50 | if (&rhs != this) 51 | stack_ = std::move(rhs.stack_); 52 | return *this; 53 | } 54 | #endif 55 | 56 | void Put(Ch c) { *stack_.template Push() = c; } 57 | void PutUnsafe(Ch c) { *stack_.template PushUnsafe() = c; } 58 | void Flush() {} 59 | 60 | void Clear() { stack_.Clear(); } 61 | void ShrinkToFit() { 62 | // Push and pop a null terminator. This is safe. 63 | *stack_.template Push() = '\0'; 64 | stack_.ShrinkToFit(); 65 | stack_.template Pop(1); 66 | } 67 | 68 | void Reserve(size_t count) { stack_.template Reserve(count); } 69 | Ch* Push(size_t count) { return stack_.template Push(count); } 70 | Ch* PushUnsafe(size_t count) { return stack_.template PushUnsafe(count); } 71 | void Pop(size_t count) { stack_.template Pop(count); } 72 | 73 | const Ch* GetString() const { 74 | // Push and pop a null terminator. This is safe. 75 | *stack_.template Push() = '\0'; 76 | stack_.template Pop(1); 77 | 78 | return stack_.template Bottom(); 79 | } 80 | 81 | //! Get the size of string in bytes in the string buffer. 82 | size_t GetSize() const { return stack_.GetSize(); } 83 | 84 | //! Get the length of string in Ch in the string buffer. 85 | size_t GetLength() const { return stack_.GetSize() / sizeof(Ch); } 86 | 87 | static const size_t kDefaultCapacity = 256; 88 | mutable internal::Stack stack_; 89 | 90 | private: 91 | // Prohibit copy constructor & assignment operator. 92 | GenericStringBuffer(const GenericStringBuffer&); 93 | GenericStringBuffer& operator=(const GenericStringBuffer&); 94 | }; 95 | 96 | //! String buffer with UTF8 encoding 97 | typedef GenericStringBuffer > StringBuffer; 98 | 99 | template 100 | inline void PutReserve(GenericStringBuffer& stream, size_t count) { 101 | stream.Reserve(count); 102 | } 103 | 104 | template 105 | inline void PutUnsafe(GenericStringBuffer& stream, typename Encoding::Ch c) { 106 | stream.PutUnsafe(c); 107 | } 108 | 109 | //! Implement specialized version of PutN() with memset() for better performance. 110 | template<> 111 | inline void PutN(GenericStringBuffer >& stream, char c, size_t n) { 112 | std::memset(stream.stack_.Push(n), c, n * sizeof(c)); 113 | } 114 | 115 | RAPIDJSON_NAMESPACE_END 116 | 117 | #if defined(__clang__) 118 | RAPIDJSON_DIAG_POP 119 | #endif 120 | 121 | #endif // RAPIDJSON_STRINGBUFFER_H_ 122 | -------------------------------------------------------------------------------- /ncmpp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.4.33213.308 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ncmpp", "ncmpp\ncmpp.vcxproj", "{D598F19A-219F-416E-80D3-34DDA0DD423E}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {389B1DB8-4E59-4F8E-8C41-0C433CB9E8AA} = {389B1DB8-4E59-4F8E-8C41-0C433CB9E8AA} 9 | EndProjectSection 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ncmlib", "ncmlib\ncmlib.vcxproj", "{389B1DB8-4E59-4F8E-8C41-0C433CB9E8AA}" 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|x64 = Debug|x64 16 | Debug|x86 = Debug|x86 17 | Release|x64 = Release|x64 18 | Release|x86 = Release|x86 19 | EndGlobalSection 20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 21 | {D598F19A-219F-416E-80D3-34DDA0DD423E}.Debug|x64.ActiveCfg = Debug|x64 22 | {D598F19A-219F-416E-80D3-34DDA0DD423E}.Debug|x64.Build.0 = Debug|x64 23 | {D598F19A-219F-416E-80D3-34DDA0DD423E}.Debug|x86.ActiveCfg = Debug|Win32 24 | {D598F19A-219F-416E-80D3-34DDA0DD423E}.Debug|x86.Build.0 = Debug|Win32 25 | {D598F19A-219F-416E-80D3-34DDA0DD423E}.Release|x64.ActiveCfg = Release|x64 26 | {D598F19A-219F-416E-80D3-34DDA0DD423E}.Release|x64.Build.0 = Release|x64 27 | {D598F19A-219F-416E-80D3-34DDA0DD423E}.Release|x86.ActiveCfg = Release|Win32 28 | {D598F19A-219F-416E-80D3-34DDA0DD423E}.Release|x86.Build.0 = Release|Win32 29 | {389B1DB8-4E59-4F8E-8C41-0C433CB9E8AA}.Debug|x64.ActiveCfg = Debug|x64 30 | {389B1DB8-4E59-4F8E-8C41-0C433CB9E8AA}.Debug|x64.Build.0 = Debug|x64 31 | {389B1DB8-4E59-4F8E-8C41-0C433CB9E8AA}.Debug|x86.ActiveCfg = Debug|Win32 32 | {389B1DB8-4E59-4F8E-8C41-0C433CB9E8AA}.Debug|x86.Build.0 = Debug|Win32 33 | {389B1DB8-4E59-4F8E-8C41-0C433CB9E8AA}.Release|x64.ActiveCfg = Release|x64 34 | {389B1DB8-4E59-4F8E-8C41-0C433CB9E8AA}.Release|x64.Build.0 = Release|x64 35 | {389B1DB8-4E59-4F8E-8C41-0C433CB9E8AA}.Release|x86.ActiveCfg = Release|Win32 36 | {389B1DB8-4E59-4F8E-8C41-0C433CB9E8AA}.Release|x86.Build.0 = Release|Win32 37 | EndGlobalSection 38 | GlobalSection(SolutionProperties) = preSolution 39 | HideSolutionNode = FALSE 40 | EndGlobalSection 41 | GlobalSection(ExtensibilityGlobals) = postSolution 42 | SolutionGuid = {94640342-44BC-4276-9151-9AAD6060FD7C} 43 | EndGlobalSection 44 | EndGlobal 45 | -------------------------------------------------------------------------------- /ncmpp/ncmpp.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | 23 | 24 | 头文件 25 | 26 | 27 | 头文件 28 | 29 | 30 | -------------------------------------------------------------------------------- /ncmpp/ncmpp.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | true 5 | 6 | 7 | WindowsLocalDebugger 8 | 9 | 10 | WindowsLocalDebugger 11 | 12 | 13 | WindowsLocalDebugger 14 | 15 | 16 | WindowsLocalDebugger 17 | 18 | -------------------------------------------------------------------------------- /ncmpp/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ncmlib/ncmdump.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "cmdline.h" 9 | #include "pool.h" 10 | 11 | using namespace std; 12 | 13 | std::mutex logMtx; 14 | template void log(Args &&...args) { 15 | std::lock_guard _a(logMtx); 16 | ((std::cout << args), ...); 17 | std::cout << endl; 18 | } 19 | 20 | std::unordered_set unlocked_files; 21 | int totalPieces = 0; 22 | 23 | int main(int argc, char* argv[]) 24 | { 25 | cmdline::parser cmd; 26 | cmd.set_program_name("ncmpp"); 27 | cmd.add("threads", 't', 28 | "Max count of unlock threads.", 29 | false, std::thread::hardware_concurrency() 30 | ); 31 | cmd.add("showtime", 's', 32 | "Shows how long it took to unlock everything." 33 | ); 34 | 35 | bool success = cmd.parse(argc, argv); 36 | if (!success) 37 | { 38 | log("\033[31m", cmd.error(), "\033[0m"); 39 | log(cmd.usage()); 40 | return 1; 41 | } 42 | 43 | unsigned int c_thread = cmd.get("threads"); 44 | bool s_time = cmd.exist("showtime"); 45 | 46 | log("Start with ", c_thread," threads.\n"); 47 | 48 | ::system("chcp>nul 2>nul 65001"); 49 | 50 | if (!filesystem::exists("unlock")) 51 | { 52 | filesystem::create_directory("unlock"); 53 | } 54 | else 55 | { 56 | for (auto& i : filesystem::directory_iterator("./unlock")) 57 | { 58 | if (i.is_directory()) 59 | { 60 | continue; 61 | } 62 | unlocked_files.emplace(i.path().stem().u8string()); 63 | } 64 | } 65 | 66 | auto start = std::chrono::steady_clock::now(); 67 | 68 | { 69 | thread_pool pool(c_thread); 70 | for (auto& i : filesystem::directory_iterator(".")) 71 | { 72 | if (i.is_directory() || 73 | i.path().extension() != ".ncm" 74 | ) { 75 | continue; 76 | } 77 | pool.enqueue( 78 | [](const filesystem::path& path) 79 | { 80 | if (unlocked_files.find(path.stem().u8string()) == 81 | unlocked_files.end()) { 82 | ncm::ncmDump(path.u8string(), "unlock"); 83 | log("\033[36mUnlocked:\t", path.filename().u8string(), "\033[0m"); 84 | ++totalPieces; 85 | } 86 | else 87 | { 88 | log("\033[33mSkipped:\t", path.filename().u8string(), "\033[0m"); 89 | } 90 | }, 91 | i.path()); 92 | } 93 | } 94 | 95 | auto end = std::chrono::steady_clock::now(); 96 | log("\n\033[32mFinished.\033[0m"); 97 | log("Unlocked ", totalPieces, " pieces of music."); 98 | 99 | if (s_time) 100 | { 101 | log("Time elapsed: ", 102 | std::chrono::duration_cast(end - start) 103 | .count() / 1000.0, 104 | "s"); 105 | } 106 | 107 | ::system("pause"); 108 | return 0; 109 | } 110 | -------------------------------------------------------------------------------- /ncmpp/src/pool.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | class thread_pool { 9 | 10 | std::vector threads; 11 | std::mutex mtx; 12 | std::condition_variable cv; 13 | std::queue> tasks; 14 | bool stop = false; 15 | 16 | public: 17 | thread_pool(unsigned int n) { 18 | if (n == 0) { 19 | n = 2; 20 | } 21 | for (auto i = 0u; i < n; ++i) { 22 | threads.emplace_back([this] { 23 | while (true) { 24 | std::function task; 25 | { 26 | std::unique_lock lock(mtx); 27 | cv.wait(lock, [this] { return stop || !tasks.empty(); }); 28 | if (stop && tasks.empty()) { 29 | return; 30 | } 31 | task = std::move(tasks.front()); 32 | tasks.pop(); 33 | } 34 | task(); 35 | } 36 | }); 37 | } 38 | } 39 | 40 | ~thread_pool() { 41 | { 42 | std::unique_lock lock(mtx); 43 | stop = true; 44 | } 45 | cv.notify_all(); 46 | for (auto& i : threads) { 47 | i.join(); 48 | } 49 | } 50 | 51 | template auto enqueue(F&& f, Args &&...args) { 52 | using return_type = std::invoke_result_t; 53 | auto task = std::make_shared>( 54 | std::bind(std::forward(f), std::forward(args)...)); 55 | auto ret = task->get_future(); 56 | { 57 | std::unique_lock lock(mtx); 58 | tasks.emplace([task] { (*task)(); }); 59 | } 60 | cv.notify_one(); 61 | return ret; 62 | } 63 | }; 64 | --------------------------------------------------------------------------------