Gav Wood
11 years ago
101 changed files with 9096 additions and 1318 deletions
@ -1,68 +0,0 @@ |
|||
|
|||
Microsoft Visual Studio Solution File, Format Version 12.00 |
|||
# Visual Studio Express 2013 for Windows Desktop |
|||
VisualStudioVersion = 12.0.21005.1 |
|||
MinimumVisualStudioVersion = 10.0.40219.1 |
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibEthereum", "libethereum\LibEthereum.vcxproj", "{7050C7CF-7551-48BE-8E57-92235906C13A}" |
|||
EndProject |
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestMining", "test\TestMining.vcxproj", "{02DC8A9B-DEF7-403B-8AE3-EF9680937D96}" |
|||
EndProject |
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test", "test\Test.vcxproj", "{3F3E389B-88DE-41D5-A73B-4F6036E18B36}" |
|||
EndProject |
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cryptlib", "..\cryptopp562\cryptlib.vcxproj", "{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}" |
|||
EndProject |
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Ethereum", "eth\Ethereum.vcxproj", "{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}" |
|||
EndProject |
|||
Global |
|||
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
|||
Debug|Win32 = Debug|Win32 |
|||
Debug|x64 = Debug|x64 |
|||
Release|Win32 = Release|Win32 |
|||
Release|x64 = Release|x64 |
|||
EndGlobalSection |
|||
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
|||
{7050C7CF-7551-48BE-8E57-92235906C13A}.Debug|Win32.ActiveCfg = Debug|Win32 |
|||
{7050C7CF-7551-48BE-8E57-92235906C13A}.Debug|Win32.Build.0 = Debug|Win32 |
|||
{7050C7CF-7551-48BE-8E57-92235906C13A}.Debug|x64.ActiveCfg = Debug|x64 |
|||
{7050C7CF-7551-48BE-8E57-92235906C13A}.Debug|x64.Build.0 = Debug|x64 |
|||
{7050C7CF-7551-48BE-8E57-92235906C13A}.Release|Win32.ActiveCfg = Release|Win32 |
|||
{7050C7CF-7551-48BE-8E57-92235906C13A}.Release|Win32.Build.0 = Release|Win32 |
|||
{7050C7CF-7551-48BE-8E57-92235906C13A}.Release|x64.ActiveCfg = Release|x64 |
|||
{7050C7CF-7551-48BE-8E57-92235906C13A}.Release|x64.Build.0 = Release|x64 |
|||
{02DC8A9B-DEF7-403B-8AE3-EF9680937D96}.Debug|Win32.ActiveCfg = Debug|Win32 |
|||
{02DC8A9B-DEF7-403B-8AE3-EF9680937D96}.Debug|Win32.Build.0 = Debug|Win32 |
|||
{02DC8A9B-DEF7-403B-8AE3-EF9680937D96}.Debug|x64.ActiveCfg = Debug|x64 |
|||
{02DC8A9B-DEF7-403B-8AE3-EF9680937D96}.Debug|x64.Build.0 = Debug|x64 |
|||
{02DC8A9B-DEF7-403B-8AE3-EF9680937D96}.Release|Win32.ActiveCfg = Release|Win32 |
|||
{02DC8A9B-DEF7-403B-8AE3-EF9680937D96}.Release|Win32.Build.0 = Release|Win32 |
|||
{02DC8A9B-DEF7-403B-8AE3-EF9680937D96}.Release|x64.ActiveCfg = Release|x64 |
|||
{02DC8A9B-DEF7-403B-8AE3-EF9680937D96}.Release|x64.Build.0 = Release|x64 |
|||
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Debug|Win32.ActiveCfg = Debug|Win32 |
|||
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Debug|Win32.Build.0 = Debug|Win32 |
|||
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Debug|x64.ActiveCfg = Debug|x64 |
|||
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Debug|x64.Build.0 = Debug|x64 |
|||
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Release|Win32.ActiveCfg = Release|Win32 |
|||
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Release|Win32.Build.0 = Release|Win32 |
|||
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Release|x64.ActiveCfg = Release|x64 |
|||
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Release|x64.Build.0 = Release|x64 |
|||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug|Win32.ActiveCfg = Debug|Win32 |
|||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug|Win32.Build.0 = Debug|Win32 |
|||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug|x64.ActiveCfg = Debug|x64 |
|||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug|x64.Build.0 = Debug|x64 |
|||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Release|Win32.ActiveCfg = Release|Win32 |
|||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Release|Win32.Build.0 = Release|Win32 |
|||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Release|x64.ActiveCfg = Release|x64 |
|||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Release|x64.Build.0 = Release|x64 |
|||
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Debug|Win32.ActiveCfg = Debug|Win32 |
|||
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Debug|Win32.Build.0 = Debug|Win32 |
|||
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Debug|x64.ActiveCfg = Debug|x64 |
|||
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Debug|x64.Build.0 = Debug|x64 |
|||
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Release|Win32.ActiveCfg = Release|Win32 |
|||
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Release|Win32.Build.0 = Release|Win32 |
|||
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Release|x64.ActiveCfg = Release|x64 |
|||
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Release|x64.Build.0 = Release|x64 |
|||
EndGlobalSection |
|||
GlobalSection(SolutionProperties) = preSolution |
|||
HideSolutionNode = FALSE |
|||
EndGlobalSection |
|||
EndGlobal |
@ -1,21 +1,27 @@ |
|||
# cpp-ethereum |
|||
## Ethereum C++ Client. |
|||
|
|||
Ethereum C++ Client. |
|||
By Gav Wood, 2014. |
|||
|
|||
Gav Wood, 2014. |
|||
Based on a design by Vitalik Buterin. |
|||
|
|||
## Building |
|||
Contributors, builders and testers include Eric Lombrozo (cross-compilation), Tim Hughes (MSVC compilation & Dagger testing), Alex Leverington (Clang & Mac building), Marko Simovic (CI) and several others. |
|||
|
|||
### Building |
|||
|
|||
See [Build Instructions](https://github.com/ethereum/cpp-ethereum/wiki/Build-Instructions) and [Compatibility Info and Build Tips](https://github.com/ethereum/cpp-ethereum/wiki/Compatibility-Info-and-Build-Tips). |
|||
|
|||
## Yet To Do |
|||
### Testing |
|||
|
|||
To run the tests, make sure you clone the tests repository from github.com/ethereum to tests is a sibling to cpp-ethereum-build. |
|||
|
|||
### Yet To Do |
|||
|
|||
See [TODO](TODO) |
|||
|
|||
## License |
|||
### License |
|||
|
|||
See [LICENSE](LICENSE) |
|||
|
|||
## Contributing |
|||
### Contributing |
|||
|
|||
Please read [CodingStandards.txt](CodingStandards.txt) thoroughly before making alterations to the code base. Please do *NOT* use an editor that automatically reformats whitespace away from astylerc or the formatting guidelines as described in [CodingStandards.txt](CodingStandards.txt). |
|||
|
@ -0,0 +1,10 @@ |
|||
SET(JSON_SPIRIT_SRCS |
|||
json_spirit_reader.cpp |
|||
json_spirit_value.cpp |
|||
json_spirit_writer.cpp) |
|||
|
|||
FIND_PACKAGE(Boost 1.34 REQUIRED) |
|||
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR}) |
|||
|
|||
ADD_LIBRARY(json_spirit STATIC ${JSON_SPIRIT_SRCS}) |
|||
|
@ -0,0 +1,18 @@ |
|||
#ifndef JSON_SPIRIT |
|||
#define JSON_SPIRIT |
|||
|
|||
// Copyright John W. Wilkinson 2007 - 2009.
|
|||
// Distributed under the MIT License, see accompanying file LICENSE.txt
|
|||
|
|||
// json spirit version 4.03
|
|||
|
|||
#if defined(_MSC_VER) && (_MSC_VER >= 1020) |
|||
# pragma once |
|||
#endif |
|||
|
|||
#include "json_spirit_value.h" |
|||
#include "json_spirit_reader.h" |
|||
#include "json_spirit_writer.h" |
|||
#include "json_spirit_utils.h" |
|||
|
|||
#endif |
@ -0,0 +1,209 @@ |
|||
<?xml version="1.0" encoding="Windows-1252"?> |
|||
<VisualStudioProject |
|||
ProjectType="Visual C++" |
|||
Version="8.00" |
|||
Name="json_spirit_lib" |
|||
ProjectGUID="{BE262A86-CC26-4B25-A877-883ED2688CEC}" |
|||
RootNamespace="json_spirit" |
|||
Keyword="Win32Proj" |
|||
> |
|||
<Platforms> |
|||
<Platform |
|||
Name="Win32" |
|||
/> |
|||
</Platforms> |
|||
<ToolFiles> |
|||
</ToolFiles> |
|||
<Configurations> |
|||
<Configuration |
|||
Name="Debug|Win32" |
|||
OutputDirectory="$(SolutionDir)$(ConfigurationName)" |
|||
IntermediateDirectory="$(ConfigurationName)" |
|||
ConfigurationType="4" |
|||
CharacterSet="1" |
|||
> |
|||
<Tool |
|||
Name="VCPreBuildEventTool" |
|||
/> |
|||
<Tool |
|||
Name="VCCustomBuildTool" |
|||
/> |
|||
<Tool |
|||
Name="VCXMLDataGeneratorTool" |
|||
/> |
|||
<Tool |
|||
Name="VCWebServiceProxyGeneratorTool" |
|||
/> |
|||
<Tool |
|||
Name="VCMIDLTool" |
|||
/> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
AdditionalOptions="
" |
|||
Optimization="0" |
|||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB" |
|||
MinimalRebuild="true" |
|||
BasicRuntimeChecks="3" |
|||
RuntimeLibrary="3" |
|||
DisableLanguageExtensions="false" |
|||
UsePrecompiledHeader="0" |
|||
WarningLevel="3" |
|||
Detect64BitPortabilityProblems="true" |
|||
DebugInformationFormat="4" |
|||
/> |
|||
<Tool |
|||
Name="VCManagedResourceCompilerTool" |
|||
/> |
|||
<Tool |
|||
Name="VCResourceCompilerTool" |
|||
/> |
|||
<Tool |
|||
Name="VCPreLinkEventTool" |
|||
/> |
|||
<Tool |
|||
Name="VCLibrarianTool" |
|||
/> |
|||
<Tool |
|||
Name="VCALinkTool" |
|||
/> |
|||
<Tool |
|||
Name="VCXDCMakeTool" |
|||
/> |
|||
<Tool |
|||
Name="VCBscMakeTool" |
|||
/> |
|||
<Tool |
|||
Name="VCFxCopTool" |
|||
/> |
|||
<Tool |
|||
Name="VCPostBuildEventTool" |
|||
/> |
|||
</Configuration> |
|||
<Configuration |
|||
Name="Release|Win32" |
|||
OutputDirectory="$(SolutionDir)$(ConfigurationName)" |
|||
IntermediateDirectory="$(ConfigurationName)" |
|||
ConfigurationType="4" |
|||
CharacterSet="1" |
|||
WholeProgramOptimization="1" |
|||
> |
|||
<Tool |
|||
Name="VCPreBuildEventTool" |
|||
/> |
|||
<Tool |
|||
Name="VCCustomBuildTool" |
|||
/> |
|||
<Tool |
|||
Name="VCXMLDataGeneratorTool" |
|||
/> |
|||
<Tool |
|||
Name="VCWebServiceProxyGeneratorTool" |
|||
/> |
|||
<Tool |
|||
Name="VCMIDLTool" |
|||
/> |
|||
<Tool |
|||
Name="VCCLCompilerTool" |
|||
Optimization="2" |
|||
EnableIntrinsicFunctions="false" |
|||
FavorSizeOrSpeed="0" |
|||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB" |
|||
RuntimeLibrary="2" |
|||
BufferSecurityCheck="false" |
|||
UsePrecompiledHeader="0" |
|||
WarningLevel="3" |
|||
Detect64BitPortabilityProblems="true" |
|||
DebugInformationFormat="3" |
|||
/> |
|||
<Tool |
|||
Name="VCManagedResourceCompilerTool" |
|||
/> |
|||
<Tool |
|||
Name="VCResourceCompilerTool" |
|||
/> |
|||
<Tool |
|||
Name="VCPreLinkEventTool" |
|||
/> |
|||
<Tool |
|||
Name="VCLibrarianTool" |
|||
/> |
|||
<Tool |
|||
Name="VCALinkTool" |
|||
/> |
|||
<Tool |
|||
Name="VCXDCMakeTool" |
|||
/> |
|||
<Tool |
|||
Name="VCBscMakeTool" |
|||
/> |
|||
<Tool |
|||
Name="VCFxCopTool" |
|||
/> |
|||
<Tool |
|||
Name="VCPostBuildEventTool" |
|||
/> |
|||
</Configuration> |
|||
</Configurations> |
|||
<References> |
|||
</References> |
|||
<Files> |
|||
<Filter |
|||
Name="Source Files" |
|||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" |
|||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}" |
|||
> |
|||
<File |
|||
RelativePath=".\json_spirit_reader.cpp" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath=".\json_spirit_writer.cpp" |
|||
> |
|||
</File> |
|||
</Filter> |
|||
<Filter |
|||
Name="Header Files" |
|||
Filter="h;hpp;hxx;hm;inl;inc;xsd" |
|||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}" |
|||
> |
|||
<File |
|||
RelativePath=".\json_spirit.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath=".\json_spirit_error_position.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath=".\json_spirit_reader.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath=".\json_spirit_reader_template.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath=".\json_spirit_stream_reader.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath=".\json_spirit_utils.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath=".\json_spirit_value.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath=".\json_spirit_writer.h" |
|||
> |
|||
</File> |
|||
<File |
|||
RelativePath=".\json_spirit_writer_template.h" |
|||
> |
|||
</File> |
|||
</Filter> |
|||
</Files> |
|||
<Globals> |
|||
</Globals> |
|||
</VisualStudioProject> |
@ -0,0 +1,54 @@ |
|||
#ifndef JSON_SPIRIT_ERROR_POSITION |
|||
#define JSON_SPIRIT_ERROR_POSITION |
|||
|
|||
// Copyright John W. Wilkinson 2007 - 2009.
|
|||
// Distributed under the MIT License, see accompanying file LICENSE.txt
|
|||
|
|||
// json spirit version 4.03
|
|||
|
|||
#if defined(_MSC_VER) && (_MSC_VER >= 1020) |
|||
# pragma once |
|||
#endif |
|||
|
|||
#include <string> |
|||
|
|||
namespace json_spirit |
|||
{ |
|||
// An Error_position exception is thrown by the "read_or_throw" functions below on finding an error.
|
|||
// Note the "read_or_throw" functions are around 3 times slower than the standard functions "read"
|
|||
// functions that return a bool.
|
|||
//
|
|||
struct Error_position |
|||
{ |
|||
Error_position(); |
|||
Error_position( unsigned int line, unsigned int column, const std::string& reason ); |
|||
bool operator==( const Error_position& lhs ) const; |
|||
unsigned int line_; |
|||
unsigned int column_; |
|||
std::string reason_; |
|||
}; |
|||
|
|||
inline Error_position::Error_position() |
|||
: line_( 0 ) |
|||
, column_( 0 ) |
|||
{ |
|||
} |
|||
|
|||
inline Error_position::Error_position( unsigned int line, unsigned int column, const std::string& reason ) |
|||
: line_( line ) |
|||
, column_( column ) |
|||
, reason_( reason ) |
|||
{ |
|||
} |
|||
|
|||
inline bool Error_position::operator==( const Error_position& lhs ) const |
|||
{ |
|||
if( this == &lhs ) return true; |
|||
|
|||
return ( reason_ == lhs.reason_ ) && |
|||
( line_ == lhs.line_ ) && |
|||
( column_ == lhs.column_ ); |
|||
} |
|||
} |
|||
|
|||
#endif |
@ -0,0 +1,137 @@ |
|||
// Copyright John W. Wilkinson 2007 - 2009.
|
|||
// Distributed under the MIT License, see accompanying file LICENSE.txt
|
|||
|
|||
// json spirit version 4.03
|
|||
|
|||
#include "json_spirit_reader.h" |
|||
#include "json_spirit_reader_template.h" |
|||
|
|||
using namespace json_spirit; |
|||
|
|||
bool json_spirit::read( const std::string& s, Value& value ) |
|||
{ |
|||
return read_string( s, value ); |
|||
} |
|||
|
|||
void json_spirit::read_or_throw( const std::string& s, Value& value ) |
|||
{ |
|||
read_string_or_throw( s, value ); |
|||
} |
|||
|
|||
bool json_spirit::read( std::istream& is, Value& value ) |
|||
{ |
|||
return read_stream( is, value ); |
|||
} |
|||
|
|||
void json_spirit::read_or_throw( std::istream& is, Value& value ) |
|||
{ |
|||
read_stream_or_throw( is, value ); |
|||
} |
|||
|
|||
bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, Value& value ) |
|||
{ |
|||
return read_range( begin, end, value ); |
|||
} |
|||
|
|||
void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, Value& value ) |
|||
{ |
|||
begin = read_range_or_throw( begin, end, value ); |
|||
} |
|||
|
|||
#ifndef BOOST_NO_STD_WSTRING |
|||
|
|||
bool json_spirit::read( const std::wstring& s, wValue& value ) |
|||
{ |
|||
return read_string( s, value ); |
|||
} |
|||
|
|||
void json_spirit::read_or_throw( const std::wstring& s, wValue& value ) |
|||
{ |
|||
read_string_or_throw( s, value ); |
|||
} |
|||
|
|||
bool json_spirit::read( std::wistream& is, wValue& value ) |
|||
{ |
|||
return read_stream( is, value ); |
|||
} |
|||
|
|||
void json_spirit::read_or_throw( std::wistream& is, wValue& value ) |
|||
{ |
|||
read_stream_or_throw( is, value ); |
|||
} |
|||
|
|||
bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value ) |
|||
{ |
|||
return read_range( begin, end, value ); |
|||
} |
|||
|
|||
void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value ) |
|||
{ |
|||
begin = read_range_or_throw( begin, end, value ); |
|||
} |
|||
|
|||
#endif |
|||
|
|||
bool json_spirit::read( const std::string& s, mValue& value ) |
|||
{ |
|||
return read_string( s, value ); |
|||
} |
|||
|
|||
void json_spirit::read_or_throw( const std::string& s, mValue& value ) |
|||
{ |
|||
read_string_or_throw( s, value ); |
|||
} |
|||
|
|||
bool json_spirit::read( std::istream& is, mValue& value ) |
|||
{ |
|||
return read_stream( is, value ); |
|||
} |
|||
|
|||
void json_spirit::read_or_throw( std::istream& is, mValue& value ) |
|||
{ |
|||
read_stream_or_throw( is, value ); |
|||
} |
|||
|
|||
bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value ) |
|||
{ |
|||
return read_range( begin, end, value ); |
|||
} |
|||
|
|||
void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value ) |
|||
{ |
|||
begin = read_range_or_throw( begin, end, value ); |
|||
} |
|||
|
|||
#ifndef BOOST_NO_STD_WSTRING |
|||
|
|||
bool json_spirit::read( const std::wstring& s, wmValue& value ) |
|||
{ |
|||
return read_string( s, value ); |
|||
} |
|||
|
|||
void json_spirit::read_or_throw( const std::wstring& s, wmValue& value ) |
|||
{ |
|||
read_string_or_throw( s, value ); |
|||
} |
|||
|
|||
bool json_spirit::read( std::wistream& is, wmValue& value ) |
|||
{ |
|||
return read_stream( is, value ); |
|||
} |
|||
|
|||
void json_spirit::read_or_throw( std::wistream& is, wmValue& value ) |
|||
{ |
|||
read_stream_or_throw( is, value ); |
|||
} |
|||
|
|||
bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value ) |
|||
{ |
|||
return read_range( begin, end, value ); |
|||
} |
|||
|
|||
void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value ) |
|||
{ |
|||
begin = read_range_or_throw( begin, end, value ); |
|||
} |
|||
|
|||
#endif |
@ -0,0 +1,62 @@ |
|||
#ifndef JSON_SPIRIT_READER |
|||
#define JSON_SPIRIT_READER |
|||
|
|||
// Copyright John W. Wilkinson 2007 - 2009.
|
|||
// Distributed under the MIT License, see accompanying file LICENSE.txt
|
|||
|
|||
// json spirit version 4.03
|
|||
|
|||
#if defined(_MSC_VER) && (_MSC_VER >= 1020) |
|||
# pragma once |
|||
#endif |
|||
|
|||
#include "json_spirit_value.h" |
|||
#include "json_spirit_error_position.h" |
|||
#include <iostream> |
|||
|
|||
namespace json_spirit |
|||
{ |
|||
// functions to reads a JSON values
|
|||
|
|||
bool read( const std::string& s, Value& value ); |
|||
bool read( std::istream& is, Value& value ); |
|||
bool read( std::string::const_iterator& begin, std::string::const_iterator end, Value& value ); |
|||
|
|||
void read_or_throw( const std::string& s, Value& value ); |
|||
void read_or_throw( std::istream& is, Value& value ); |
|||
void read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, Value& value ); |
|||
|
|||
#ifndef BOOST_NO_STD_WSTRING |
|||
|
|||
bool read( const std::wstring& s, wValue& value ); |
|||
bool read( std::wistream& is, wValue& value ); |
|||
bool read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value ); |
|||
|
|||
void read_or_throw( const std::wstring& s, wValue& value ); |
|||
void read_or_throw( std::wistream& is, wValue& value ); |
|||
void read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value ); |
|||
|
|||
#endif |
|||
|
|||
bool read( const std::string& s, mValue& value ); |
|||
bool read( std::istream& is, mValue& value ); |
|||
bool read( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value ); |
|||
|
|||
void read_or_throw( const std::string& s, mValue& value ); |
|||
void read_or_throw( std::istream& is, mValue& value ); |
|||
void read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value ); |
|||
|
|||
#ifndef BOOST_NO_STD_WSTRING |
|||
|
|||
bool read( const std::wstring& s, wmValue& value ); |
|||
bool read( std::wistream& is, wmValue& value ); |
|||
bool read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value ); |
|||
|
|||
void read_or_throw( const std::wstring& s, wmValue& value ); |
|||
void read_or_throw( std::wistream& is, wmValue& value ); |
|||
void read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value ); |
|||
|
|||
#endif |
|||
} |
|||
|
|||
#endif |
@ -0,0 +1,612 @@ |
|||
#ifndef JSON_SPIRIT_READER_TEMPLATE |
|||
#define JSON_SPIRIT_READER_TEMPLATE |
|||
|
|||
// Copyright John W. Wilkinson 2007 - 2009.
|
|||
// Distributed under the MIT License, see accompanying file LICENSE.txt
|
|||
|
|||
// json spirit version 4.03
|
|||
|
|||
#include "json_spirit_value.h" |
|||
#include "json_spirit_error_position.h" |
|||
|
|||
//#define BOOST_SPIRIT_THREADSAFE // uncomment for multithreaded use, requires linking to boost.thread
|
|||
|
|||
#include <boost/bind.hpp> |
|||
#include <boost/function.hpp> |
|||
#include <boost/version.hpp> |
|||
|
|||
#if BOOST_VERSION >= 103800 |
|||
#include <boost/spirit/include/classic_core.hpp> |
|||
#include <boost/spirit/include/classic_confix.hpp> |
|||
#include <boost/spirit/include/classic_escape_char.hpp> |
|||
#include <boost/spirit/include/classic_multi_pass.hpp> |
|||
#include <boost/spirit/include/classic_position_iterator.hpp> |
|||
#define spirit_namespace boost::spirit::classic |
|||
#else |
|||
#include <boost/spirit/core.hpp> |
|||
#include <boost/spirit/utility/confix.hpp> |
|||
#include <boost/spirit/utility/escape_char.hpp> |
|||
#include <boost/spirit/iterator/multi_pass.hpp> |
|||
#include <boost/spirit/iterator/position_iterator.hpp> |
|||
#define spirit_namespace boost::spirit |
|||
#endif |
|||
|
|||
namespace json_spirit |
|||
{ |
|||
const spirit_namespace::int_parser < boost::int64_t > int64_p = spirit_namespace::int_parser < boost::int64_t >(); |
|||
const spirit_namespace::uint_parser< boost::uint64_t > uint64_p = spirit_namespace::uint_parser< boost::uint64_t >(); |
|||
|
|||
template< class Iter_type > |
|||
bool is_eq( Iter_type first, Iter_type last, const char* c_str ) |
|||
{ |
|||
for( Iter_type i = first; i != last; ++i, ++c_str ) |
|||
{ |
|||
if( *c_str == 0 ) return false; |
|||
|
|||
if( *i != *c_str ) return false; |
|||
} |
|||
|
|||
return true; |
|||
} |
|||
|
|||
template< class Char_type > |
|||
Char_type hex_to_num( const Char_type c ) |
|||
{ |
|||
if( ( c >= '0' ) && ( c <= '9' ) ) return c - '0'; |
|||
if( ( c >= 'a' ) && ( c <= 'f' ) ) return c - 'a' + 10; |
|||
if( ( c >= 'A' ) && ( c <= 'F' ) ) return c - 'A' + 10; |
|||
return 0; |
|||
} |
|||
|
|||
template< class Char_type, class Iter_type > |
|||
Char_type hex_str_to_char( Iter_type& begin ) |
|||
{ |
|||
const Char_type c1( *( ++begin ) ); |
|||
const Char_type c2( *( ++begin ) ); |
|||
|
|||
return ( hex_to_num( c1 ) << 4 ) + hex_to_num( c2 ); |
|||
} |
|||
|
|||
template< class Char_type, class Iter_type > |
|||
Char_type unicode_str_to_char( Iter_type& begin ) |
|||
{ |
|||
const Char_type c1( *( ++begin ) ); |
|||
const Char_type c2( *( ++begin ) ); |
|||
const Char_type c3( *( ++begin ) ); |
|||
const Char_type c4( *( ++begin ) ); |
|||
|
|||
return ( hex_to_num( c1 ) << 12 ) + |
|||
( hex_to_num( c2 ) << 8 ) + |
|||
( hex_to_num( c3 ) << 4 ) + |
|||
hex_to_num( c4 ); |
|||
} |
|||
|
|||
template< class String_type > |
|||
void append_esc_char_and_incr_iter( String_type& s, |
|||
typename String_type::const_iterator& begin, |
|||
typename String_type::const_iterator end ) |
|||
{ |
|||
typedef typename String_type::value_type Char_type; |
|||
|
|||
const Char_type c2( *begin ); |
|||
|
|||
switch( c2 ) |
|||
{ |
|||
case 't': s += '\t'; break; |
|||
case 'b': s += '\b'; break; |
|||
case 'f': s += '\f'; break; |
|||
case 'n': s += '\n'; break; |
|||
case 'r': s += '\r'; break; |
|||
case '\\': s += '\\'; break; |
|||
case '/': s += '/'; break; |
|||
case '"': s += '"'; break; |
|||
case 'x': |
|||
{ |
|||
if( end - begin >= 3 ) // expecting "xHH..."
|
|||
{ |
|||
s += hex_str_to_char< Char_type >( begin ); |
|||
} |
|||
break; |
|||
} |
|||
case 'u': |
|||
{ |
|||
if( end - begin >= 5 ) // expecting "uHHHH..."
|
|||
{ |
|||
s += unicode_str_to_char< Char_type >( begin ); |
|||
} |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
|
|||
template< class String_type > |
|||
String_type substitute_esc_chars( typename String_type::const_iterator begin, |
|||
typename String_type::const_iterator end ) |
|||
{ |
|||
typedef typename String_type::const_iterator Iter_type; |
|||
|
|||
if( end - begin < 2 ) return String_type( begin, end ); |
|||
|
|||
String_type result; |
|||
|
|||
result.reserve( end - begin ); |
|||
|
|||
const Iter_type end_minus_1( end - 1 ); |
|||
|
|||
Iter_type substr_start = begin; |
|||
Iter_type i = begin; |
|||
|
|||
for( ; i < end_minus_1; ++i ) |
|||
{ |
|||
if( *i == '\\' ) |
|||
{ |
|||
result.append( substr_start, i ); |
|||
|
|||
++i; // skip the '\'
|
|||
|
|||
append_esc_char_and_incr_iter( result, i, end ); |
|||
|
|||
substr_start = i + 1; |
|||
} |
|||
} |
|||
|
|||
result.append( substr_start, end ); |
|||
|
|||
return result; |
|||
} |
|||
|
|||
template< class String_type > |
|||
String_type get_str_( typename String_type::const_iterator begin, |
|||
typename String_type::const_iterator end ) |
|||
{ |
|||
assert( end - begin >= 2 ); |
|||
|
|||
typedef typename String_type::const_iterator Iter_type; |
|||
|
|||
Iter_type str_without_quotes( ++begin ); |
|||
Iter_type end_without_quotes( --end ); |
|||
|
|||
return substitute_esc_chars< String_type >( str_without_quotes, end_without_quotes ); |
|||
} |
|||
|
|||
inline std::string get_str( std::string::const_iterator begin, std::string::const_iterator end ) |
|||
{ |
|||
return get_str_< std::string >( begin, end ); |
|||
} |
|||
|
|||
inline std::wstring get_str( std::wstring::const_iterator begin, std::wstring::const_iterator end ) |
|||
{ |
|||
return get_str_< std::wstring >( begin, end ); |
|||
} |
|||
|
|||
template< class String_type, class Iter_type > |
|||
String_type get_str( Iter_type begin, Iter_type end ) |
|||
{ |
|||
const String_type tmp( begin, end ); // convert multipass iterators to string iterators
|
|||
|
|||
return get_str( tmp.begin(), tmp.end() ); |
|||
} |
|||
|
|||
// this class's methods get called by the spirit parse resulting
|
|||
// in the creation of a JSON object or array
|
|||
//
|
|||
// NB Iter_type could be a std::string iterator, wstring iterator, a position iterator or a multipass iterator
|
|||
//
|
|||
template< class Value_type, class Iter_type > |
|||
class Semantic_actions |
|||
{ |
|||
public: |
|||
|
|||
typedef typename Value_type::Config_type Config_type; |
|||
typedef typename Config_type::String_type String_type; |
|||
typedef typename Config_type::Object_type Object_type; |
|||
typedef typename Config_type::Array_type Array_type; |
|||
typedef typename String_type::value_type Char_type; |
|||
|
|||
Semantic_actions( Value_type& value ) |
|||
: value_( value ) |
|||
, current_p_( 0 ) |
|||
{ |
|||
} |
|||
|
|||
void begin_obj( Char_type c ) |
|||
{ |
|||
assert( c == '{' ); |
|||
|
|||
begin_compound< Object_type >(); |
|||
} |
|||
|
|||
void end_obj( Char_type c ) |
|||
{ |
|||
assert( c == '}' ); |
|||
|
|||
end_compound(); |
|||
} |
|||
|
|||
void begin_array( Char_type c ) |
|||
{ |
|||
assert( c == '[' ); |
|||
|
|||
begin_compound< Array_type >(); |
|||
} |
|||
|
|||
void end_array( Char_type c ) |
|||
{ |
|||
assert( c == ']' ); |
|||
|
|||
end_compound(); |
|||
} |
|||
|
|||
void new_name( Iter_type begin, Iter_type end ) |
|||
{ |
|||
assert( current_p_->type() == obj_type ); |
|||
|
|||
name_ = get_str< String_type >( begin, end ); |
|||
} |
|||
|
|||
void new_str( Iter_type begin, Iter_type end ) |
|||
{ |
|||
add_to_current( get_str< String_type >( begin, end ) ); |
|||
} |
|||
|
|||
void new_true( Iter_type begin, Iter_type end ) |
|||
{ |
|||
assert( is_eq( begin, end, "true" ) ); |
|||
|
|||
add_to_current( true ); |
|||
} |
|||
|
|||
void new_false( Iter_type begin, Iter_type end ) |
|||
{ |
|||
assert( is_eq( begin, end, "false" ) ); |
|||
|
|||
add_to_current( false ); |
|||
} |
|||
|
|||
void new_null( Iter_type begin, Iter_type end ) |
|||
{ |
|||
assert( is_eq( begin, end, "null" ) ); |
|||
|
|||
add_to_current( Value_type() ); |
|||
} |
|||
|
|||
void new_int( boost::int64_t i ) |
|||
{ |
|||
add_to_current( i ); |
|||
} |
|||
|
|||
void new_uint64( boost::uint64_t ui ) |
|||
{ |
|||
add_to_current( ui ); |
|||
} |
|||
|
|||
void new_real( double d ) |
|||
{ |
|||
add_to_current( d ); |
|||
} |
|||
|
|||
private: |
|||
|
|||
Semantic_actions& operator=( const Semantic_actions& ); |
|||
// to prevent "assignment operator could not be generated" warning
|
|||
|
|||
Value_type* add_first( const Value_type& value ) |
|||
{ |
|||
assert( current_p_ == 0 ); |
|||
|
|||
value_ = value; |
|||
current_p_ = &value_; |
|||
return current_p_; |
|||
} |
|||
|
|||
template< class Array_or_obj > |
|||
void begin_compound() |
|||
{ |
|||
if( current_p_ == 0 ) |
|||
{ |
|||
add_first( Array_or_obj() ); |
|||
} |
|||
else |
|||
{ |
|||
stack_.push_back( current_p_ ); |
|||
|
|||
Array_or_obj new_array_or_obj; // avoid copy by building new array or object in place
|
|||
|
|||
current_p_ = add_to_current( new_array_or_obj ); |
|||
} |
|||
} |
|||
|
|||
void end_compound() |
|||
{ |
|||
if( current_p_ != &value_ ) |
|||
{ |
|||
current_p_ = stack_.back(); |
|||
|
|||
stack_.pop_back(); |
|||
} |
|||
} |
|||
|
|||
Value_type* add_to_current( const Value_type& value ) |
|||
{ |
|||
if( current_p_ == 0 ) |
|||
{ |
|||
return add_first( value ); |
|||
} |
|||
else if( current_p_->type() == array_type ) |
|||
{ |
|||
current_p_->get_array().push_back( value ); |
|||
|
|||
return ¤t_p_->get_array().back(); |
|||
} |
|||
|
|||
assert( current_p_->type() == obj_type ); |
|||
|
|||
return &Config_type::add( current_p_->get_obj(), name_, value ); |
|||
} |
|||
|
|||
Value_type& value_; // this is the object or array that is being created
|
|||
Value_type* current_p_; // the child object or array that is currently being constructed
|
|||
|
|||
std::vector< Value_type* > stack_; // previous child objects and arrays
|
|||
|
|||
String_type name_; // of current name/value pair
|
|||
}; |
|||
|
|||
template< typename Iter_type > |
|||
void throw_error( spirit_namespace::position_iterator< Iter_type > i, const std::string& reason ) |
|||
{ |
|||
throw Error_position( i.get_position().line, i.get_position().column, reason ); |
|||
} |
|||
|
|||
template< typename Iter_type > |
|||
void throw_error( Iter_type i, const std::string& reason ) |
|||
{ |
|||
throw reason; |
|||
} |
|||
|
|||
// the spirit grammer
|
|||
//
|
|||
template< class Value_type, class Iter_type > |
|||
class Json_grammer : public spirit_namespace::grammar< Json_grammer< Value_type, Iter_type > > |
|||
{ |
|||
public: |
|||
|
|||
typedef Semantic_actions< Value_type, Iter_type > Semantic_actions_t; |
|||
|
|||
Json_grammer( Semantic_actions_t& semantic_actions ) |
|||
: actions_( semantic_actions ) |
|||
{ |
|||
} |
|||
|
|||
static void throw_not_value( Iter_type begin, Iter_type end ) |
|||
{ |
|||
throw_error( begin, "not a value" ); |
|||
} |
|||
|
|||
static void throw_not_array( Iter_type begin, Iter_type end ) |
|||
{ |
|||
throw_error( begin, "not an array" ); |
|||
} |
|||
|
|||
static void throw_not_object( Iter_type begin, Iter_type end ) |
|||
{ |
|||
throw_error( begin, "not an object" ); |
|||
} |
|||
|
|||
static void throw_not_pair( Iter_type begin, Iter_type end ) |
|||
{ |
|||
throw_error( begin, "not a pair" ); |
|||
} |
|||
|
|||
static void throw_not_colon( Iter_type begin, Iter_type end ) |
|||
{ |
|||
throw_error( begin, "no colon in pair" ); |
|||
} |
|||
|
|||
static void throw_not_string( Iter_type begin, Iter_type end ) |
|||
{ |
|||
throw_error( begin, "not a string" ); |
|||
} |
|||
|
|||
template< typename ScannerT > |
|||
class definition |
|||
{ |
|||
public: |
|||
|
|||
definition( const Json_grammer& self ) |
|||
{ |
|||
using namespace spirit_namespace; |
|||
|
|||
typedef typename Value_type::String_type::value_type Char_type; |
|||
|
|||
// first we convert the semantic action class methods to functors with the
|
|||
// parameter signature expected by spirit
|
|||
|
|||
typedef boost::function< void( Char_type ) > Char_action; |
|||
typedef boost::function< void( Iter_type, Iter_type ) > Str_action; |
|||
typedef boost::function< void( double ) > Real_action; |
|||
typedef boost::function< void( boost::int64_t ) > Int_action; |
|||
typedef boost::function< void( boost::uint64_t ) > Uint64_action; |
|||
|
|||
Char_action begin_obj ( boost::bind( &Semantic_actions_t::begin_obj, &self.actions_, _1 ) ); |
|||
Char_action end_obj ( boost::bind( &Semantic_actions_t::end_obj, &self.actions_, _1 ) ); |
|||
Char_action begin_array( boost::bind( &Semantic_actions_t::begin_array, &self.actions_, _1 ) ); |
|||
Char_action end_array ( boost::bind( &Semantic_actions_t::end_array, &self.actions_, _1 ) ); |
|||
Str_action new_name ( boost::bind( &Semantic_actions_t::new_name, &self.actions_, _1, _2 ) ); |
|||
Str_action new_str ( boost::bind( &Semantic_actions_t::new_str, &self.actions_, _1, _2 ) ); |
|||
Str_action new_true ( boost::bind( &Semantic_actions_t::new_true, &self.actions_, _1, _2 ) ); |
|||
Str_action new_false ( boost::bind( &Semantic_actions_t::new_false, &self.actions_, _1, _2 ) ); |
|||
Str_action new_null ( boost::bind( &Semantic_actions_t::new_null, &self.actions_, _1, _2 ) ); |
|||
Real_action new_real ( boost::bind( &Semantic_actions_t::new_real, &self.actions_, _1 ) ); |
|||
Int_action new_int ( boost::bind( &Semantic_actions_t::new_int, &self.actions_, _1 ) ); |
|||
Uint64_action new_uint64 ( boost::bind( &Semantic_actions_t::new_uint64, &self.actions_, _1 ) ); |
|||
|
|||
// actual grammer
|
|||
|
|||
json_ |
|||
= value_ | eps_p[ &throw_not_value ] |
|||
; |
|||
|
|||
value_ |
|||
= string_[ new_str ] |
|||
| number_ |
|||
| object_ |
|||
| array_ |
|||
| str_p( "true" ) [ new_true ] |
|||
| str_p( "false" )[ new_false ] |
|||
| str_p( "null" ) [ new_null ] |
|||
; |
|||
|
|||
object_ |
|||
= ch_p('{')[ begin_obj ] |
|||
>> !members_ |
|||
>> ( ch_p('}')[ end_obj ] | eps_p[ &throw_not_object ] ) |
|||
; |
|||
|
|||
members_ |
|||
= pair_ >> *( ',' >> pair_ ) |
|||
; |
|||
|
|||
pair_ |
|||
= string_[ new_name ] |
|||
>> ( ':' | eps_p[ &throw_not_colon ] ) |
|||
>> ( value_ | eps_p[ &throw_not_value ] ) |
|||
; |
|||
|
|||
array_ |
|||
= ch_p('[')[ begin_array ] |
|||
>> !elements_ |
|||
>> ( ch_p(']')[ end_array ] | eps_p[ &throw_not_array ] ) |
|||
; |
|||
|
|||
elements_ |
|||
= value_ >> *( ',' >> value_ ) |
|||
; |
|||
|
|||
string_ |
|||
= lexeme_d // this causes white space inside a string to be retained
|
|||
[ |
|||
confix_p |
|||
( |
|||
'"', |
|||
*lex_escape_ch_p, |
|||
'"' |
|||
) |
|||
] |
|||
; |
|||
|
|||
number_ |
|||
= strict_real_p[ new_real ] |
|||
| int64_p [ new_int ] |
|||
| uint64_p [ new_uint64 ] |
|||
; |
|||
} |
|||
|
|||
spirit_namespace::rule< ScannerT > json_, object_, members_, pair_, array_, elements_, value_, string_, number_; |
|||
|
|||
const spirit_namespace::rule< ScannerT >& start() const { return json_; } |
|||
}; |
|||
|
|||
private: |
|||
|
|||
Json_grammer& operator=( const Json_grammer& ); // to prevent "assignment operator could not be generated" warning
|
|||
|
|||
Semantic_actions_t& actions_; |
|||
}; |
|||
|
|||
template< class Iter_type, class Value_type > |
|||
Iter_type read_range_or_throw( Iter_type begin, Iter_type end, Value_type& value ) |
|||
{ |
|||
Semantic_actions< Value_type, Iter_type > semantic_actions( value ); |
|||
|
|||
const spirit_namespace::parse_info< Iter_type > info = |
|||
spirit_namespace::parse( begin, end, |
|||
Json_grammer< Value_type, Iter_type >( semantic_actions ), |
|||
spirit_namespace::space_p ); |
|||
|
|||
if( !info.hit ) |
|||
{ |
|||
assert( false ); // in theory exception should already have been thrown
|
|||
throw_error( info.stop, "error" ); |
|||
} |
|||
|
|||
return info.stop; |
|||
} |
|||
|
|||
template< class Iter_type, class Value_type > |
|||
void add_posn_iter_and_read_range_or_throw( Iter_type begin, Iter_type end, Value_type& value ) |
|||
{ |
|||
typedef spirit_namespace::position_iterator< Iter_type > Posn_iter_t; |
|||
|
|||
const Posn_iter_t posn_begin( begin, end ); |
|||
const Posn_iter_t posn_end( end, end ); |
|||
|
|||
read_range_or_throw( posn_begin, posn_end, value ); |
|||
} |
|||
|
|||
template< class Iter_type, class Value_type > |
|||
bool read_range( Iter_type& begin, Iter_type end, Value_type& value ) |
|||
{ |
|||
try |
|||
{ |
|||
begin = read_range_or_throw( begin, end, value ); |
|||
|
|||
return true; |
|||
} |
|||
catch( ... ) |
|||
{ |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
template< class String_type, class Value_type > |
|||
void read_string_or_throw( const String_type& s, Value_type& value ) |
|||
{ |
|||
add_posn_iter_and_read_range_or_throw( s.begin(), s.end(), value ); |
|||
} |
|||
|
|||
template< class String_type, class Value_type > |
|||
bool read_string( const String_type& s, Value_type& value ) |
|||
{ |
|||
typename String_type::const_iterator begin = s.begin(); |
|||
|
|||
return read_range( begin, s.end(), value ); |
|||
} |
|||
|
|||
template< class Istream_type > |
|||
struct Multi_pass_iters |
|||
{ |
|||
typedef typename Istream_type::char_type Char_type; |
|||
typedef std::istream_iterator< Char_type, Char_type > istream_iter; |
|||
typedef spirit_namespace::multi_pass< istream_iter > Mp_iter; |
|||
|
|||
Multi_pass_iters( Istream_type& is ) |
|||
{ |
|||
is.unsetf( std::ios::skipws ); |
|||
|
|||
begin_ = spirit_namespace::make_multi_pass( istream_iter( is ) ); |
|||
end_ = spirit_namespace::make_multi_pass( istream_iter() ); |
|||
} |
|||
|
|||
Mp_iter begin_; |
|||
Mp_iter end_; |
|||
}; |
|||
|
|||
template< class Istream_type, class Value_type > |
|||
bool read_stream( Istream_type& is, Value_type& value ) |
|||
{ |
|||
Multi_pass_iters< Istream_type > mp_iters( is ); |
|||
|
|||
return read_range( mp_iters.begin_, mp_iters.end_, value ); |
|||
} |
|||
|
|||
template< class Istream_type, class Value_type > |
|||
void read_stream_or_throw( Istream_type& is, Value_type& value ) |
|||
{ |
|||
const Multi_pass_iters< Istream_type > mp_iters( is ); |
|||
|
|||
add_posn_iter_and_read_range_or_throw( mp_iters.begin_, mp_iters.end_, value ); |
|||
} |
|||
} |
|||
|
|||
#endif |
@ -0,0 +1,70 @@ |
|||
#ifndef JSON_SPIRIT_READ_STREAM |
|||
#define JSON_SPIRIT_READ_STREAM |
|||
|
|||
// Copyright John W. Wilkinson 2007 - 2009.
|
|||
// Distributed under the MIT License, see accompanying file LICENSE.txt
|
|||
|
|||
// json spirit version 4.03
|
|||
|
|||
#if defined(_MSC_VER) && (_MSC_VER >= 1020) |
|||
# pragma once |
|||
#endif |
|||
|
|||
#include "json_spirit_reader_template.h" |
|||
|
|||
namespace json_spirit |
|||
{ |
|||
// these classes allows you to read multiple top level contiguous values from a stream,
|
|||
// the normal stream read functions have a bug that prevent multiple top level values
|
|||
// from being read unless they are separated by spaces
|
|||
|
|||
template< class Istream_type, class Value_type > |
|||
class Stream_reader |
|||
{ |
|||
public: |
|||
|
|||
Stream_reader( Istream_type& is ) |
|||
: iters_( is ) |
|||
{ |
|||
} |
|||
|
|||
bool read_next( Value_type& value ) |
|||
{ |
|||
return read_range( iters_.begin_, iters_.end_, value ); |
|||
} |
|||
|
|||
private: |
|||
|
|||
typedef Multi_pass_iters< Istream_type > Mp_iters; |
|||
|
|||
Mp_iters iters_; |
|||
}; |
|||
|
|||
template< class Istream_type, class Value_type > |
|||
class Stream_reader_thrower |
|||
{ |
|||
public: |
|||
|
|||
Stream_reader_thrower( Istream_type& is ) |
|||
: iters_( is ) |
|||
, posn_begin_( iters_.begin_, iters_.end_ ) |
|||
, posn_end_( iters_.end_, iters_.end_ ) |
|||
{ |
|||
} |
|||
|
|||
void read_next( Value_type& value ) |
|||
{ |
|||
posn_begin_ = read_range_or_throw( posn_begin_, posn_end_, value ); |
|||
} |
|||
|
|||
private: |
|||
|
|||
typedef Multi_pass_iters< Istream_type > Mp_iters; |
|||
typedef spirit_namespace::position_iterator< typename Mp_iters::Mp_iter > Posn_iter_t; |
|||
|
|||
Mp_iters iters_; |
|||
Posn_iter_t posn_begin_, posn_end_; |
|||
}; |
|||
} |
|||
|
|||
#endif |
@ -0,0 +1,61 @@ |
|||
#ifndef JSON_SPIRIT_UTILS |
|||
#define JSON_SPIRIT_UTILS |
|||
|
|||
// Copyright John W. Wilkinson 2007 - 2009.
|
|||
// Distributed under the MIT License, see accompanying file LICENSE.txt
|
|||
|
|||
// json spirit version 4.03
|
|||
|
|||
#if defined(_MSC_VER) && (_MSC_VER >= 1020) |
|||
# pragma once |
|||
#endif |
|||
|
|||
#include "json_spirit_value.h" |
|||
#include <map> |
|||
|
|||
namespace json_spirit |
|||
{ |
|||
template< class Obj_t, class Map_t > |
|||
void obj_to_map( const Obj_t& obj, Map_t& mp_obj ) |
|||
{ |
|||
mp_obj.clear(); |
|||
|
|||
for( typename Obj_t::const_iterator i = obj.begin(); i != obj.end(); ++i ) |
|||
{ |
|||
mp_obj[ i->name_ ] = i->value_; |
|||
} |
|||
} |
|||
|
|||
template< class Obj_t, class Map_t > |
|||
void map_to_obj( const Map_t& mp_obj, Obj_t& obj ) |
|||
{ |
|||
obj.clear(); |
|||
|
|||
for( typename Map_t::const_iterator i = mp_obj.begin(); i != mp_obj.end(); ++i ) |
|||
{ |
|||
obj.push_back( typename Obj_t::value_type( i->first, i->second ) ); |
|||
} |
|||
} |
|||
|
|||
typedef std::map< std::string, Value > Mapped_obj; |
|||
|
|||
#ifndef BOOST_NO_STD_WSTRING |
|||
typedef std::map< std::wstring, wValue > wMapped_obj; |
|||
#endif |
|||
|
|||
template< class Object_type, class String_type > |
|||
const typename Object_type::value_type::Value_type& find_value( const Object_type& obj, const String_type& name ) |
|||
{ |
|||
for( typename Object_type::const_iterator i = obj.begin(); i != obj.end(); ++i ) |
|||
{ |
|||
if( i->name_ == name ) |
|||
{ |
|||
return i->value_; |
|||
} |
|||
} |
|||
|
|||
return Object_type::value_type::Value_type::null; |
|||
} |
|||
} |
|||
|
|||
#endif |
@ -0,0 +1,8 @@ |
|||
/* Copyright (c) 2007 John W Wilkinson
|
|||
|
|||
This source code can be used for any purpose as long as |
|||
this comment is retained. */ |
|||
|
|||
// json spirit version 2.00
|
|||
|
|||
#include "json_spirit_value.h" |
@ -0,0 +1,532 @@ |
|||
#ifndef JSON_SPIRIT_VALUE |
|||
#define JSON_SPIRIT_VALUE |
|||
|
|||
// Copyright John W. Wilkinson 2007 - 2009.
|
|||
// Distributed under the MIT License, see accompanying file LICENSE.txt
|
|||
|
|||
// json spirit version 4.03
|
|||
|
|||
#if defined(_MSC_VER) && (_MSC_VER >= 1020) |
|||
# pragma once |
|||
#endif |
|||
|
|||
#include <vector> |
|||
#include <map> |
|||
#include <string> |
|||
#include <cassert> |
|||
#include <sstream> |
|||
#include <stdexcept> |
|||
#include <boost/config.hpp> |
|||
#include <boost/cstdint.hpp> |
|||
#include <boost/shared_ptr.hpp> |
|||
#include <boost/variant.hpp> |
|||
|
|||
namespace json_spirit |
|||
{ |
|||
enum Value_type{ obj_type, array_type, str_type, bool_type, int_type, real_type, null_type }; |
|||
|
|||
template< class Config > // Config determines whether the value uses std::string or std::wstring and
|
|||
// whether JSON Objects are represented as vectors or maps
|
|||
class Value_impl |
|||
{ |
|||
public: |
|||
|
|||
typedef Config Config_type; |
|||
typedef typename Config::String_type String_type; |
|||
typedef typename Config::Object_type Object; |
|||
typedef typename Config::Array_type Array; |
|||
typedef typename String_type::const_pointer Const_str_ptr; // eg const char*
|
|||
|
|||
Value_impl(); // creates null value
|
|||
Value_impl( Const_str_ptr value ); |
|||
Value_impl( const String_type& value ); |
|||
Value_impl( const Object& value ); |
|||
Value_impl( const Array& value ); |
|||
Value_impl( bool value ); |
|||
Value_impl( int value ); |
|||
Value_impl( boost::int64_t value ); |
|||
Value_impl( boost::uint64_t value ); |
|||
Value_impl( double value ); |
|||
|
|||
Value_impl( const Value_impl& other ); |
|||
|
|||
bool operator==( const Value_impl& lhs ) const; |
|||
|
|||
Value_impl& operator=( const Value_impl& lhs ); |
|||
|
|||
Value_type type() const; |
|||
|
|||
bool is_uint64() const; |
|||
bool is_null() const; |
|||
|
|||
const String_type& get_str() const; |
|||
const Object& get_obj() const; |
|||
const Array& get_array() const; |
|||
bool get_bool() const; |
|||
int get_int() const; |
|||
boost::int64_t get_int64() const; |
|||
boost::uint64_t get_uint64() const; |
|||
double get_real() const; |
|||
|
|||
Object& get_obj(); |
|||
Array& get_array(); |
|||
|
|||
template< typename T > T get_value() const; // example usage: int i = value.get_value< int >();
|
|||
// or double d = value.get_value< double >();
|
|||
|
|||
static const Value_impl null; |
|||
|
|||
private: |
|||
|
|||
void check_type( const Value_type vtype ) const; |
|||
|
|||
typedef boost::variant< String_type, |
|||
boost::recursive_wrapper< Object >, boost::recursive_wrapper< Array >, |
|||
bool, boost::int64_t, double > Variant; |
|||
|
|||
Value_type type_; |
|||
Variant v_; |
|||
bool is_uint64_; |
|||
}; |
|||
|
|||
// vector objects
|
|||
|
|||
template< class Config > |
|||
struct Pair_impl |
|||
{ |
|||
typedef typename Config::String_type String_type; |
|||
typedef typename Config::Value_type Value_type; |
|||
|
|||
Pair_impl( const String_type& name, const Value_type& value ); |
|||
|
|||
bool operator==( const Pair_impl& lhs ) const; |
|||
|
|||
String_type name_; |
|||
Value_type value_; |
|||
}; |
|||
|
|||
template< class String > |
|||
struct Config_vector |
|||
{ |
|||
typedef String String_type; |
|||
typedef Value_impl< Config_vector > Value_type; |
|||
typedef Pair_impl < Config_vector > Pair_type; |
|||
typedef std::vector< Value_type > Array_type; |
|||
typedef std::vector< Pair_type > Object_type; |
|||
|
|||
static Value_type& add( Object_type& obj, const String_type& name, const Value_type& value ) |
|||
{ |
|||
obj.push_back( Pair_type( name , value ) ); |
|||
|
|||
return obj.back().value_; |
|||
} |
|||
|
|||
static String_type get_name( const Pair_type& pair ) |
|||
{ |
|||
return pair.name_; |
|||
} |
|||
|
|||
static Value_type get_value( const Pair_type& pair ) |
|||
{ |
|||
return pair.value_; |
|||
} |
|||
}; |
|||
|
|||
// typedefs for ASCII
|
|||
|
|||
typedef Config_vector< std::string > Config; |
|||
|
|||
typedef Config::Value_type Value; |
|||
typedef Config::Pair_type Pair; |
|||
typedef Config::Object_type Object; |
|||
typedef Config::Array_type Array; |
|||
|
|||
// typedefs for Unicode
|
|||
|
|||
#ifndef BOOST_NO_STD_WSTRING |
|||
|
|||
typedef Config_vector< std::wstring > wConfig; |
|||
|
|||
typedef wConfig::Value_type wValue; |
|||
typedef wConfig::Pair_type wPair; |
|||
typedef wConfig::Object_type wObject; |
|||
typedef wConfig::Array_type wArray; |
|||
#endif |
|||
|
|||
// map objects
|
|||
|
|||
template< class String > |
|||
struct Config_map |
|||
{ |
|||
typedef String String_type; |
|||
typedef Value_impl< Config_map > Value_type; |
|||
typedef std::vector< Value_type > Array_type; |
|||
typedef std::map< String_type, Value_type > Object_type; |
|||
typedef typename Object_type::value_type Pair_type; |
|||
|
|||
static Value_type& add( Object_type& obj, const String_type& name, const Value_type& value ) |
|||
{ |
|||
return obj[ name ] = value; |
|||
} |
|||
|
|||
static String_type get_name( const Pair_type& pair ) |
|||
{ |
|||
return pair.first; |
|||
} |
|||
|
|||
static Value_type get_value( const Pair_type& pair ) |
|||
{ |
|||
return pair.second; |
|||
} |
|||
}; |
|||
|
|||
// typedefs for ASCII
|
|||
|
|||
typedef Config_map< std::string > mConfig; |
|||
|
|||
typedef mConfig::Value_type mValue; |
|||
typedef mConfig::Object_type mObject; |
|||
typedef mConfig::Array_type mArray; |
|||
|
|||
// typedefs for Unicode
|
|||
|
|||
#ifndef BOOST_NO_STD_WSTRING |
|||
|
|||
typedef Config_map< std::wstring > wmConfig; |
|||
|
|||
typedef wmConfig::Value_type wmValue; |
|||
typedef wmConfig::Object_type wmObject; |
|||
typedef wmConfig::Array_type wmArray; |
|||
|
|||
#endif |
|||
|
|||
///////////////////////////////////////////////////////////////////////////////////////////////
|
|||
//
|
|||
// implementation
|
|||
|
|||
template< class Config > |
|||
const Value_impl< Config > Value_impl< Config >::null; |
|||
|
|||
template< class Config > |
|||
Value_impl< Config >::Value_impl() |
|||
: type_( null_type ) |
|||
, is_uint64_( false ) |
|||
{ |
|||
} |
|||
|
|||
template< class Config > |
|||
Value_impl< Config >::Value_impl( const Const_str_ptr value ) |
|||
: type_( str_type ) |
|||
, v_( String_type( value ) ) |
|||
, is_uint64_( false ) |
|||
{ |
|||
} |
|||
|
|||
template< class Config > |
|||
Value_impl< Config >::Value_impl( const String_type& value ) |
|||
: type_( str_type ) |
|||
, v_( value ) |
|||
, is_uint64_( false ) |
|||
{ |
|||
} |
|||
|
|||
template< class Config > |
|||
Value_impl< Config >::Value_impl( const Object& value ) |
|||
: type_( obj_type ) |
|||
, v_( value ) |
|||
, is_uint64_( false ) |
|||
{ |
|||
} |
|||
|
|||
template< class Config > |
|||
Value_impl< Config >::Value_impl( const Array& value ) |
|||
: type_( array_type ) |
|||
, v_( value ) |
|||
, is_uint64_( false ) |
|||
{ |
|||
} |
|||
|
|||
template< class Config > |
|||
Value_impl< Config >::Value_impl( bool value ) |
|||
: type_( bool_type ) |
|||
, v_( value ) |
|||
, is_uint64_( false ) |
|||
{ |
|||
} |
|||
|
|||
template< class Config > |
|||
Value_impl< Config >::Value_impl( int value ) |
|||
: type_( int_type ) |
|||
, v_( static_cast< boost::int64_t >( value ) ) |
|||
, is_uint64_( false ) |
|||
{ |
|||
} |
|||
|
|||
template< class Config > |
|||
Value_impl< Config >::Value_impl( boost::int64_t value ) |
|||
: type_( int_type ) |
|||
, v_( value ) |
|||
, is_uint64_( false ) |
|||
{ |
|||
} |
|||
|
|||
template< class Config > |
|||
Value_impl< Config >::Value_impl( boost::uint64_t value ) |
|||
: type_( int_type ) |
|||
, v_( static_cast< boost::int64_t >( value ) ) |
|||
, is_uint64_( true ) |
|||
{ |
|||
} |
|||
|
|||
template< class Config > |
|||
Value_impl< Config >::Value_impl( double value ) |
|||
: type_( real_type ) |
|||
, v_( value ) |
|||
, is_uint64_( false ) |
|||
{ |
|||
} |
|||
|
|||
template< class Config > |
|||
Value_impl< Config >::Value_impl( const Value_impl< Config >& other ) |
|||
: type_( other.type() ) |
|||
, v_( other.v_ ) |
|||
, is_uint64_( other.is_uint64_ ) |
|||
{ |
|||
} |
|||
|
|||
template< class Config > |
|||
Value_impl< Config >& Value_impl< Config >::operator=( const Value_impl& lhs ) |
|||
{ |
|||
Value_impl tmp( lhs ); |
|||
|
|||
std::swap( type_, tmp.type_ ); |
|||
std::swap( v_, tmp.v_ ); |
|||
std::swap( is_uint64_, tmp.is_uint64_ ); |
|||
|
|||
return *this; |
|||
} |
|||
|
|||
template< class Config > |
|||
bool Value_impl< Config >::operator==( const Value_impl& lhs ) const |
|||
{ |
|||
if( this == &lhs ) return true; |
|||
|
|||
if( type() != lhs.type() ) return false; |
|||
|
|||
return v_ == lhs.v_; |
|||
} |
|||
|
|||
template< class Config > |
|||
Value_type Value_impl< Config >::type() const |
|||
{ |
|||
return type_; |
|||
} |
|||
|
|||
template< class Config > |
|||
bool Value_impl< Config >::is_uint64() const |
|||
{ |
|||
return is_uint64_; |
|||
} |
|||
|
|||
template< class Config > |
|||
bool Value_impl< Config >::is_null() const |
|||
{ |
|||
return type() == null_type; |
|||
} |
|||
|
|||
template< class Config > |
|||
void Value_impl< Config >::check_type( const Value_type vtype ) const |
|||
{ |
|||
if( type() != vtype ) |
|||
{ |
|||
std::ostringstream os; |
|||
|
|||
os << "value type is " << type() << " not " << vtype; |
|||
|
|||
throw std::runtime_error( os.str() ); |
|||
} |
|||
} |
|||
|
|||
template< class Config > |
|||
const typename Config::String_type& Value_impl< Config >::get_str() const |
|||
{ |
|||
check_type( str_type ); |
|||
|
|||
return *boost::get< String_type >( &v_ ); |
|||
} |
|||
|
|||
template< class Config > |
|||
const typename Value_impl< Config >::Object& Value_impl< Config >::get_obj() const |
|||
{ |
|||
check_type( obj_type ); |
|||
|
|||
return *boost::get< Object >( &v_ ); |
|||
} |
|||
|
|||
template< class Config > |
|||
const typename Value_impl< Config >::Array& Value_impl< Config >::get_array() const |
|||
{ |
|||
check_type( array_type ); |
|||
|
|||
return *boost::get< Array >( &v_ ); |
|||
} |
|||
|
|||
template< class Config > |
|||
bool Value_impl< Config >::get_bool() const |
|||
{ |
|||
check_type( bool_type ); |
|||
|
|||
return boost::get< bool >( v_ ); |
|||
} |
|||
|
|||
template< class Config > |
|||
int Value_impl< Config >::get_int() const |
|||
{ |
|||
check_type( int_type ); |
|||
|
|||
return static_cast< int >( get_int64() ); |
|||
} |
|||
|
|||
template< class Config > |
|||
boost::int64_t Value_impl< Config >::get_int64() const |
|||
{ |
|||
check_type( int_type ); |
|||
|
|||
return boost::get< boost::int64_t >( v_ ); |
|||
} |
|||
|
|||
template< class Config > |
|||
boost::uint64_t Value_impl< Config >::get_uint64() const |
|||
{ |
|||
check_type( int_type ); |
|||
|
|||
return static_cast< boost::uint64_t >( get_int64() ); |
|||
} |
|||
|
|||
template< class Config > |
|||
double Value_impl< Config >::get_real() const |
|||
{ |
|||
if( type() == int_type ) |
|||
{ |
|||
return is_uint64() ? static_cast< double >( get_uint64() ) |
|||
: static_cast< double >( get_int64() ); |
|||
} |
|||
|
|||
check_type( real_type ); |
|||
|
|||
return boost::get< double >( v_ ); |
|||
} |
|||
|
|||
template< class Config > |
|||
typename Value_impl< Config >::Object& Value_impl< Config >::get_obj() |
|||
{ |
|||
check_type( obj_type ); |
|||
|
|||
return *boost::get< Object >( &v_ ); |
|||
} |
|||
|
|||
template< class Config > |
|||
typename Value_impl< Config >::Array& Value_impl< Config >::get_array() |
|||
{ |
|||
check_type( array_type ); |
|||
|
|||
return *boost::get< Array >( &v_ ); |
|||
} |
|||
|
|||
template< class Config > |
|||
Pair_impl< Config >::Pair_impl( const String_type& name, const Value_type& value ) |
|||
: name_( name ) |
|||
, value_( value ) |
|||
{ |
|||
} |
|||
|
|||
template< class Config > |
|||
bool Pair_impl< Config >::operator==( const Pair_impl< Config >& lhs ) const |
|||
{ |
|||
if( this == &lhs ) return true; |
|||
|
|||
return ( name_ == lhs.name_ ) && ( value_ == lhs.value_ ); |
|||
} |
|||
|
|||
// converts a C string, ie. 8 bit char array, to a string object
|
|||
//
|
|||
template < class String_type > |
|||
String_type to_str( const char* c_str ) |
|||
{ |
|||
String_type result; |
|||
|
|||
for( const char* p = c_str; *p != 0; ++p ) |
|||
{ |
|||
result += *p; |
|||
} |
|||
|
|||
return result; |
|||
} |
|||
|
|||
//
|
|||
|
|||
namespace internal_ |
|||
{ |
|||
template< typename T > |
|||
struct Type_to_type |
|||
{ |
|||
}; |
|||
|
|||
template< class Value > |
|||
int get_value( const Value& value, Type_to_type< int > ) |
|||
{ |
|||
return value.get_int(); |
|||
} |
|||
|
|||
template< class Value > |
|||
boost::int64_t get_value( const Value& value, Type_to_type< boost::int64_t > ) |
|||
{ |
|||
return value.get_int64(); |
|||
} |
|||
|
|||
template< class Value > |
|||
boost::uint64_t get_value( const Value& value, Type_to_type< boost::uint64_t > ) |
|||
{ |
|||
return value.get_uint64(); |
|||
} |
|||
|
|||
template< class Value > |
|||
double get_value( const Value& value, Type_to_type< double > ) |
|||
{ |
|||
return value.get_real(); |
|||
} |
|||
|
|||
template< class Value > |
|||
typename Value::String_type get_value( const Value& value, Type_to_type< typename Value::String_type > ) |
|||
{ |
|||
return value.get_str(); |
|||
} |
|||
|
|||
template< class Value > |
|||
typename Value::Array get_value( const Value& value, Type_to_type< typename Value::Array > ) |
|||
{ |
|||
return value.get_array(); |
|||
} |
|||
|
|||
template< class Value > |
|||
typename Value::Object get_value( const Value& value, Type_to_type< typename Value::Object > ) |
|||
{ |
|||
return value.get_obj(); |
|||
} |
|||
|
|||
template< class Value > |
|||
bool get_value( const Value& value, Type_to_type< bool > ) |
|||
{ |
|||
return value.get_bool(); |
|||
} |
|||
} |
|||
|
|||
template< class Config > |
|||
template< typename T > |
|||
T Value_impl< Config >::get_value() const |
|||
{ |
|||
return internal_::get_value( *this, internal_::Type_to_type< T >() ); |
|||
} |
|||
} |
|||
|
|||
#endif |
@ -0,0 +1,95 @@ |
|||
// Copyright John W. Wilkinson 2007 - 2009.
|
|||
// Distributed under the MIT License, see accompanying file LICENSE.txt
|
|||
|
|||
// json spirit version 4.03
|
|||
|
|||
#include "json_spirit_writer.h" |
|||
#include "json_spirit_writer_template.h" |
|||
|
|||
void json_spirit::write( const Value& value, std::ostream& os ) |
|||
{ |
|||
write_stream( value, os, false ); |
|||
} |
|||
|
|||
void json_spirit::write_formatted( const Value& value, std::ostream& os ) |
|||
{ |
|||
write_stream( value, os, true ); |
|||
} |
|||
|
|||
std::string json_spirit::write( const Value& value ) |
|||
{ |
|||
return write_string( value, false ); |
|||
} |
|||
|
|||
std::string json_spirit::write_formatted( const Value& value ) |
|||
{ |
|||
return write_string( value, true ); |
|||
} |
|||
|
|||
#ifndef BOOST_NO_STD_WSTRING |
|||
|
|||
void json_spirit::write( const wValue& value, std::wostream& os ) |
|||
{ |
|||
write_stream( value, os, false ); |
|||
} |
|||
|
|||
void json_spirit::write_formatted( const wValue& value, std::wostream& os ) |
|||
{ |
|||
write_stream( value, os, true ); |
|||
} |
|||
|
|||
std::wstring json_spirit::write( const wValue& value ) |
|||
{ |
|||
return write_string( value, false ); |
|||
} |
|||
|
|||
std::wstring json_spirit::write_formatted( const wValue& value ) |
|||
{ |
|||
return write_string( value, true ); |
|||
} |
|||
|
|||
#endif |
|||
|
|||
void json_spirit::write( const mValue& value, std::ostream& os ) |
|||
{ |
|||
write_stream( value, os, false ); |
|||
} |
|||
|
|||
void json_spirit::write_formatted( const mValue& value, std::ostream& os ) |
|||
{ |
|||
write_stream( value, os, true ); |
|||
} |
|||
|
|||
std::string json_spirit::write( const mValue& value ) |
|||
{ |
|||
return write_string( value, false ); |
|||
} |
|||
|
|||
std::string json_spirit::write_formatted( const mValue& value ) |
|||
{ |
|||
return write_string( value, true ); |
|||
} |
|||
|
|||
#ifndef BOOST_NO_STD_WSTRING |
|||
|
|||
void json_spirit::write( const wmValue& value, std::wostream& os ) |
|||
{ |
|||
write_stream( value, os, false ); |
|||
} |
|||
|
|||
void json_spirit::write_formatted( const wmValue& value, std::wostream& os ) |
|||
{ |
|||
write_stream( value, os, true ); |
|||
} |
|||
|
|||
std::wstring json_spirit::write( const wmValue& value ) |
|||
{ |
|||
return write_string( value, false ); |
|||
} |
|||
|
|||
std::wstring json_spirit::write_formatted( const wmValue& value ) |
|||
{ |
|||
return write_string( value, true ); |
|||
} |
|||
|
|||
#endif |
@ -0,0 +1,50 @@ |
|||
#ifndef JSON_SPIRIT_WRITER |
|||
#define JSON_SPIRIT_WRITER |
|||
|
|||
// Copyright John W. Wilkinson 2007 - 2009.
|
|||
// Distributed under the MIT License, see accompanying file LICENSE.txt
|
|||
|
|||
// json spirit version 4.03
|
|||
|
|||
#if defined(_MSC_VER) && (_MSC_VER >= 1020) |
|||
# pragma once |
|||
#endif |
|||
|
|||
#include "json_spirit_value.h" |
|||
#include <iostream> |
|||
|
|||
namespace json_spirit |
|||
{ |
|||
// functions to convert JSON Values to text,
|
|||
// the "formatted" versions add whitespace to format the output nicely
|
|||
|
|||
void write ( const Value& value, std::ostream& os ); |
|||
void write_formatted( const Value& value, std::ostream& os ); |
|||
std::string write ( const Value& value ); |
|||
std::string write_formatted( const Value& value ); |
|||
|
|||
#ifndef BOOST_NO_STD_WSTRING |
|||
|
|||
void write ( const wValue& value, std::wostream& os ); |
|||
void write_formatted( const wValue& value, std::wostream& os ); |
|||
std::wstring write ( const wValue& value ); |
|||
std::wstring write_formatted( const wValue& value ); |
|||
|
|||
#endif |
|||
|
|||
void write ( const mValue& value, std::ostream& os ); |
|||
void write_formatted( const mValue& value, std::ostream& os ); |
|||
std::string write ( const mValue& value ); |
|||
std::string write_formatted( const mValue& value ); |
|||
|
|||
#ifndef BOOST_NO_STD_WSTRING |
|||
|
|||
void write ( const wmValue& value, std::wostream& os ); |
|||
void write_formatted( const wmValue& value, std::wostream& os ); |
|||
std::wstring write ( const wmValue& value ); |
|||
std::wstring write_formatted( const wmValue& value ); |
|||
|
|||
#endif |
|||
} |
|||
|
|||
#endif |
@ -0,0 +1,248 @@ |
|||
#ifndef JSON_SPIRIT_WRITER_TEMPLATE |
|||
#define JSON_SPIRIT_WRITER_TEMPLATE |
|||
|
|||
// Copyright John W. Wilkinson 2007 - 2009.
|
|||
// Distributed under the MIT License, see accompanying file LICENSE.txt
|
|||
|
|||
// json spirit version 4.03
|
|||
|
|||
#include "json_spirit_value.h" |
|||
|
|||
#include <cassert> |
|||
#include <sstream> |
|||
#include <iomanip> |
|||
|
|||
namespace json_spirit |
|||
{ |
|||
inline char to_hex_char( unsigned int c ) |
|||
{ |
|||
assert( c <= 0xF ); |
|||
|
|||
const char ch = static_cast< char >( c ); |
|||
|
|||
if( ch < 10 ) return '0' + ch; |
|||
|
|||
return 'A' - 10 + ch; |
|||
} |
|||
|
|||
#pragma GCC diagnostic push |
|||
#pragma GCC diagnostic ignored "-Wunused-local-typedefs") |
|||
template< class String_type > |
|||
String_type non_printable_to_string( unsigned int c ) |
|||
{ |
|||
typedef typename String_type::value_type Char_type; |
|||
|
|||
String_type result( 6, '\\' ); |
|||
|
|||
result[1] = 'u'; |
|||
|
|||
result[ 5 ] = to_hex_char( c & 0x000F ); c >>= 4; |
|||
result[ 4 ] = to_hex_char( c & 0x000F ); c >>= 4; |
|||
result[ 3 ] = to_hex_char( c & 0x000F ); c >>= 4; |
|||
result[ 2 ] = to_hex_char( c & 0x000F ); |
|||
|
|||
return result; |
|||
} |
|||
#pragma GCC diagnostic pop |
|||
|
|||
template< typename Char_type, class String_type > |
|||
bool add_esc_char( Char_type c, String_type& s ) |
|||
{ |
|||
switch( c ) |
|||
{ |
|||
case '"': s += to_str< String_type >( "\\\"" ); return true; |
|||
case '\\': s += to_str< String_type >( "\\\\" ); return true; |
|||
case '\b': s += to_str< String_type >( "\\b" ); return true; |
|||
case '\f': s += to_str< String_type >( "\\f" ); return true; |
|||
case '\n': s += to_str< String_type >( "\\n" ); return true; |
|||
case '\r': s += to_str< String_type >( "\\r" ); return true; |
|||
case '\t': s += to_str< String_type >( "\\t" ); return true; |
|||
} |
|||
|
|||
return false; |
|||
} |
|||
|
|||
template< class String_type > |
|||
String_type add_esc_chars( const String_type& s ) |
|||
{ |
|||
typedef typename String_type::const_iterator Iter_type; |
|||
typedef typename String_type::value_type Char_type; |
|||
|
|||
String_type result; |
|||
|
|||
const Iter_type end( s.end() ); |
|||
|
|||
for( Iter_type i = s.begin(); i != end; ++i ) |
|||
{ |
|||
const Char_type c( *i ); |
|||
|
|||
if( add_esc_char( c, result ) ) continue; |
|||
|
|||
const wint_t unsigned_c( ( c >= 0 ) ? c : 256 + c ); |
|||
|
|||
if( iswprint( unsigned_c ) ) |
|||
{ |
|||
result += c; |
|||
} |
|||
else |
|||
{ |
|||
result += non_printable_to_string< String_type >( unsigned_c ); |
|||
} |
|||
} |
|||
|
|||
return result; |
|||
} |
|||
|
|||
// this class generates the JSON text,
|
|||
// it keeps track of the indentation level etc.
|
|||
//
|
|||
template< class Value_type, class Ostream_type > |
|||
class Generator |
|||
{ |
|||
typedef typename Value_type::Config_type Config_type; |
|||
typedef typename Config_type::String_type String_type; |
|||
typedef typename Config_type::Object_type Object_type; |
|||
typedef typename Config_type::Array_type Array_type; |
|||
typedef typename String_type::value_type Char_type; |
|||
typedef typename Object_type::value_type Obj_member_type; |
|||
|
|||
public: |
|||
|
|||
Generator( const Value_type& value, Ostream_type& os, bool pretty ) |
|||
: os_( os ) |
|||
, indentation_level_( 0 ) |
|||
, pretty_( pretty ) |
|||
{ |
|||
output( value ); |
|||
} |
|||
|
|||
private: |
|||
|
|||
void output( const Value_type& value ) |
|||
{ |
|||
switch( value.type() ) |
|||
{ |
|||
case obj_type: output( value.get_obj() ); break; |
|||
case array_type: output( value.get_array() ); break; |
|||
case str_type: output( value.get_str() ); break; |
|||
case bool_type: output( value.get_bool() ); break; |
|||
case int_type: output_int( value ); break; |
|||
case real_type: os_ << std::showpoint << std::setprecision( 16 ) |
|||
<< value.get_real(); break; |
|||
case null_type: os_ << "null"; break; |
|||
default: assert( false ); |
|||
} |
|||
} |
|||
|
|||
void output( const Object_type& obj ) |
|||
{ |
|||
output_array_or_obj( obj, '{', '}' ); |
|||
} |
|||
|
|||
void output( const Array_type& arr ) |
|||
{ |
|||
output_array_or_obj( arr, '[', ']' ); |
|||
} |
|||
|
|||
void output( const Obj_member_type& member ) |
|||
{ |
|||
output( Config_type::get_name( member ) ); space(); |
|||
os_ << ':'; space(); |
|||
output( Config_type::get_value( member ) ); |
|||
} |
|||
|
|||
void output_int( const Value_type& value ) |
|||
{ |
|||
if( value.is_uint64() ) |
|||
{ |
|||
os_ << value.get_uint64(); |
|||
} |
|||
else |
|||
{ |
|||
os_ << value.get_int64(); |
|||
} |
|||
} |
|||
|
|||
void output( const String_type& s ) |
|||
{ |
|||
os_ << '"' << add_esc_chars( s ) << '"'; |
|||
} |
|||
|
|||
void output( bool b ) |
|||
{ |
|||
os_ << to_str< String_type >( b ? "true" : "false" ); |
|||
} |
|||
|
|||
template< class T > |
|||
void output_array_or_obj( const T& t, Char_type start_char, Char_type end_char ) |
|||
{ |
|||
os_ << start_char; new_line(); |
|||
|
|||
++indentation_level_; |
|||
|
|||
for( typename T::const_iterator i = t.begin(); i != t.end(); ++i ) |
|||
{ |
|||
indent(); output( *i ); |
|||
|
|||
typename T::const_iterator next = i; |
|||
|
|||
if( ++next != t.end()) |
|||
{ |
|||
os_ << ','; |
|||
} |
|||
|
|||
new_line(); |
|||
} |
|||
|
|||
--indentation_level_; |
|||
|
|||
indent(); os_ << end_char; |
|||
} |
|||
|
|||
void indent() |
|||
{ |
|||
if( !pretty_ ) return; |
|||
|
|||
for( int i = 0; i < indentation_level_; ++i ) |
|||
{ |
|||
os_ << " "; |
|||
} |
|||
} |
|||
|
|||
void space() |
|||
{ |
|||
if( pretty_ ) os_ << ' '; |
|||
} |
|||
|
|||
void new_line() |
|||
{ |
|||
if( pretty_ ) os_ << '\n'; |
|||
} |
|||
|
|||
Generator& operator=( const Generator& ); // to prevent "assignment operator could not be generated" warning
|
|||
|
|||
Ostream_type& os_; |
|||
int indentation_level_; |
|||
bool pretty_; |
|||
}; |
|||
|
|||
template< class Value_type, class Ostream_type > |
|||
void write_stream( const Value_type& value, Ostream_type& os, bool pretty ) |
|||
{ |
|||
Generator< Value_type, Ostream_type >( value, os, pretty ); |
|||
} |
|||
|
|||
template< class Value_type > |
|||
typename Value_type::String_type write_string( const Value_type& value, bool pretty ) |
|||
{ |
|||
typedef typename Value_type::String_type::value_type Char_type; |
|||
|
|||
std::basic_ostringstream< Char_type > os; |
|||
|
|||
write_stream( value, os, pretty ); |
|||
|
|||
return os.str(); |
|||
} |
|||
} |
|||
|
|||
#endif |
@ -0,0 +1,76 @@ |
|||
/*
|
|||
This file is part of cpp-ethereum. |
|||
|
|||
cpp-ethereum is free software: you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation, either version 3 of the License, or |
|||
(at your option) any later version. |
|||
|
|||
cpp-ethereum is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License |
|||
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
/** @file ExtVMFace.h
|
|||
* @author Gav Wood <i@gavwood.com> |
|||
* @date 2014 |
|||
*/ |
|||
|
|||
#pragma once |
|||
|
|||
#include "Common.h" |
|||
#include "FeeStructure.h" |
|||
#include "BlockInfo.h" |
|||
|
|||
namespace eth |
|||
{ |
|||
|
|||
struct Transaction; |
|||
|
|||
class ExtVMFace |
|||
{ |
|||
public: |
|||
ExtVMFace() {} |
|||
|
|||
ExtVMFace(FeeStructure const& _fees, BlockInfo const& _previousBlock, BlockInfo const& _currentBlock, uint _currentNumber): |
|||
fees(_fees), |
|||
previousBlock(_previousBlock), |
|||
currentBlock(_currentBlock), |
|||
currentNumber(_currentNumber) |
|||
{} |
|||
|
|||
ExtVMFace(Address _myAddress, Address _txSender, u256 _txValue, u256s const& _txData, FeeStructure const& _fees, BlockInfo const& _previousBlock, BlockInfo const& _currentBlock, uint _currentNumber): |
|||
myAddress(_myAddress), |
|||
txSender(_txSender), |
|||
txValue(_txValue), |
|||
txData(_txData), |
|||
fees(_fees), |
|||
previousBlock(_previousBlock), |
|||
currentBlock(_currentBlock), |
|||
currentNumber(_currentNumber) |
|||
{} |
|||
|
|||
u256 store(u256 _n) { return 0; } |
|||
void setStore(u256 _n, u256 _v) {} |
|||
void mktx(Transaction& _t) {} |
|||
u256 balance(Address _a) { return 0; } |
|||
void payFee(bigint _fee) {} |
|||
u256 txCount(Address _a) { return 0; } |
|||
u256 extro(Address _a, u256 _pos) { return 0; } |
|||
u256 extroPrice(Address _a) { return 0; } |
|||
void suicide(Address _a) {} |
|||
|
|||
Address myAddress; |
|||
Address txSender; |
|||
u256 txValue; |
|||
u256s txData; |
|||
FeeStructure fees; |
|||
BlockInfo previousBlock; ///< The current block's information.
|
|||
BlockInfo currentBlock; ///< The current block's information.
|
|||
uint currentNumber; |
|||
}; |
|||
|
|||
} |
@ -0,0 +1,49 @@ |
|||
/*
|
|||
This file is part of cpp-ethereum. |
|||
|
|||
cpp-ethereum is free software: you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation, either version 3 of the License, or |
|||
(at your option) any later version. |
|||
|
|||
cpp-ethereum is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License |
|||
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
/** @file FeeStructure.cpp
|
|||
* @author Gav Wood <i@gavwood.com> |
|||
* @date 2014 |
|||
*/ |
|||
|
|||
#include "FeeStructure.h" |
|||
|
|||
using namespace std; |
|||
using namespace eth; |
|||
|
|||
u256 const c_stepFee = 1; |
|||
u256 const c_dataFee = 20; |
|||
u256 const c_memoryFee = 5; |
|||
u256 const c_extroFee = 40; |
|||
u256 const c_cryptoFee = 20; |
|||
u256 const c_newContractFee = 100; |
|||
u256 const c_txFee = 100; |
|||
|
|||
void FeeStructure::setMultiplier(u256 _x) |
|||
{ |
|||
m_stepFee = c_stepFee * _x; |
|||
m_dataFee = c_dataFee * _x; |
|||
m_memoryFee = c_memoryFee * _x; |
|||
m_extroFee = c_extroFee * _x; |
|||
m_cryptoFee = c_cryptoFee * _x; |
|||
m_newContractFee = c_newContractFee * _x; |
|||
m_txFee = c_txFee * _x; |
|||
} |
|||
|
|||
u256 FeeStructure::multiplier() const |
|||
{ |
|||
return m_stepFee / c_stepFee; |
|||
} |
@ -0,0 +1,43 @@ |
|||
/*
|
|||
This file is part of cpp-ethereum. |
|||
|
|||
cpp-ethereum is free software: you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation, either version 3 of the License, or |
|||
(at your option) any later version. |
|||
|
|||
cpp-ethereum is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License |
|||
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
/** @file FeeStructure.h
|
|||
* @author Gav Wood <i@gavwood.com> |
|||
* @date 2014 |
|||
*/ |
|||
|
|||
#pragma once |
|||
|
|||
#include "Common.h" |
|||
|
|||
namespace eth |
|||
{ |
|||
|
|||
struct FeeStructure |
|||
{ |
|||
/// The fee structure. Values yet to be agreed on...
|
|||
void setMultiplier(u256 _x); ///< The current block multiplier.
|
|||
u256 multiplier() const; |
|||
u256 m_stepFee; |
|||
u256 m_dataFee; |
|||
u256 m_memoryFee; |
|||
u256 m_extroFee; |
|||
u256 m_cryptoFee; |
|||
u256 m_newContractFee; |
|||
u256 m_txFee; |
|||
}; |
|||
|
|||
} |
@ -0,0 +1,577 @@ |
|||
/*
|
|||
This file is part of cpp-ethereum. |
|||
|
|||
cpp-ethereum is free software: you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation, either version 3 of the License, or |
|||
(at your option) any later version. |
|||
|
|||
cpp-ethereum is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License |
|||
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
/** @file Instruction.cpp
|
|||
* @author Gav Wood <i@gavwood.com> |
|||
* @date 2014 |
|||
*/ |
|||
|
|||
#include "Instruction.h" |
|||
|
|||
#include <boost/algorithm/string.hpp> |
|||
#include "Common.h" |
|||
using namespace std; |
|||
using namespace eth; |
|||
|
|||
static string readQuoted(char const*& o_d, char const* _e) |
|||
{ |
|||
string ret; |
|||
bool escaped = 0; |
|||
for (++o_d; o_d != _e && (escaped || *o_d != '"'); ++o_d) |
|||
if (!escaped && *o_d == '\\') |
|||
escaped = true; |
|||
else |
|||
ret.push_back(*o_d); |
|||
if (o_d != _e) |
|||
++o_d; // skip last "
|
|||
return ret; |
|||
} |
|||
|
|||
static u256 readNumeric(string _v, bool _quiet) |
|||
{ |
|||
u256 x = 1; |
|||
for (auto const& i: units()) |
|||
if (boost::algorithm::ends_with(_v, i.second)) |
|||
{ |
|||
_v = _v.substr(0, _v.size() - i.second.size()); |
|||
x = i.first; |
|||
break; |
|||
} |
|||
try |
|||
{ |
|||
return x * u256(_v); |
|||
} |
|||
catch (...) |
|||
{ |
|||
if (!_quiet) |
|||
cwarn << "Invalid numeric" << _v; |
|||
} |
|||
return 0; |
|||
} |
|||
|
|||
u256s eth::assemble(std::string const& _code, bool _quiet) |
|||
{ |
|||
u256s ret; |
|||
map<string, unsigned> known; |
|||
map<unsigned, string> req; |
|||
char const* d = _code.data(); |
|||
char const* e = _code.data() + _code.size(); |
|||
while (d != e) |
|||
{ |
|||
// skip to next token
|
|||
for (; d != e && !isalnum(*d) && *d != '_' && *d != ':' && *d != '"'; ++d) {} |
|||
if (d == e) |
|||
break; |
|||
|
|||
if (*d == '"') |
|||
{ |
|||
string s = readQuoted(d, e); |
|||
if (s.size() > 32) |
|||
{ |
|||
if (!_quiet) |
|||
cwarn << "String literal > 32 characters. Cropping."; |
|||
s.resize(32); |
|||
} |
|||
h256 valHash; |
|||
memcpy(valHash.data(), s.data(), s.size()); |
|||
memset(valHash.data() + s.size(), 0, 32 - s.size()); |
|||
ret.push_back((u256)valHash); |
|||
} |
|||
else |
|||
{ |
|||
char const* s = d; |
|||
for (; d != e && (isalnum(*d) || *d == '_' || *d == ':' || *d == '"'); ++d) {} |
|||
|
|||
string t = string(s, d - s); |
|||
if (isdigit(t[0])) |
|||
ret.push_back(readNumeric(t, _quiet)); |
|||
else if (t.back() == ':') |
|||
known[t.substr(0, t.size() - 1)] = (unsigned)ret.size(); |
|||
else |
|||
{ |
|||
auto it = c_instructions.find(boost::algorithm::to_upper_copy(t)); |
|||
if (it != c_instructions.end()) |
|||
ret.push_back((u256)it->second); |
|||
else |
|||
{ |
|||
req[(unsigned)ret.size()] = t; |
|||
ret.push_back(0); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
for (auto i: req) |
|||
if (known.count(i.second)) |
|||
ret[i.first] = known[i.second]; |
|||
else |
|||
if (!_quiet) |
|||
cwarn << "Unknown assembler token" << i.second << "at address" << i.first; |
|||
|
|||
return ret; |
|||
} |
|||
|
|||
static void appendCode(u256s& o_code, vector<unsigned>& o_locs, u256s _code, vector<unsigned>& _locs) |
|||
{ |
|||
o_locs.reserve(o_locs.size() + _locs.size()); |
|||
for (auto i: _locs) |
|||
{ |
|||
_code[i] += (u256)o_code.size(); |
|||
o_locs.push_back(i + (unsigned)o_code.size()); |
|||
} |
|||
o_code.reserve(o_code.size() + _code.size()); |
|||
for (auto i: _code) |
|||
o_code.push_back(i); |
|||
} |
|||
|
|||
static bool compileLispFragment(char const*& d, char const* e, bool _quiet, u256s& o_code, vector<unsigned>& o_locs) |
|||
{ |
|||
std::map<std::string, Instruction> const c_arith = { { "+", Instruction::ADD }, { "-", Instruction::SUB }, { "*", Instruction::MUL }, { "/", Instruction::DIV }, { "%", Instruction::MOD } }; |
|||
std::map<std::string, Instruction> const c_binary = { { "<", Instruction::LT }, { "<=", Instruction::LE }, { ">", Instruction::GT }, { ">=", Instruction::GE }, { "=", Instruction::EQ }, { "!=", Instruction::NOT } }; |
|||
std::map<std::string, Instruction> const c_unary = { { "!", Instruction::NOT } }; |
|||
std::set<char> const c_allowed = { '+', '-', '*', '/', '%', '<', '>', '=', '!' }; |
|||
|
|||
bool exec = false; |
|||
|
|||
while (d != e) |
|||
{ |
|||
// skip to next token
|
|||
for (; d != e && !isalnum(*d) && *d != '(' && *d != ')' && *d != '_' && *d != '"' && !c_allowed.count(*d) && *d != ';'; ++d) {} |
|||
if (d == e) |
|||
break; |
|||
|
|||
switch (*d) |
|||
{ |
|||
case ';': |
|||
for (; d != e && *d != '\n'; ++d) {} |
|||
break; |
|||
case '(': |
|||
exec = true; |
|||
++d; |
|||
break; |
|||
case ')': |
|||
if (exec) |
|||
{ |
|||
++d; |
|||
return true; |
|||
} |
|||
else |
|||
// unexpected - return false as we don't know what to do with it.
|
|||
return false; |
|||
default: |
|||
{ |
|||
bool haveLiteral = false; |
|||
u256 literalValue = 0; |
|||
string t; |
|||
|
|||
if (*d == '"') |
|||
{ |
|||
string s = readQuoted(d, e); |
|||
if (s.size() > 32) |
|||
{ |
|||
if (!_quiet) |
|||
cwarn << "String literal > 32 characters. Cropping."; |
|||
s.resize(32); |
|||
} |
|||
h256 valHash; |
|||
memcpy(valHash.data(), s.data(), s.size()); |
|||
memset(valHash.data() + s.size(), 0, 32 - s.size()); |
|||
literalValue = (u256)valHash; |
|||
haveLiteral = true; |
|||
} |
|||
else |
|||
{ |
|||
char const* s = d; |
|||
for (; d != e && (isalnum(*d) || *d == '_' || c_allowed.count(*d)); ++d) {} |
|||
t = string(s, d - s); |
|||
if (isdigit(t[0])) |
|||
{ |
|||
literalValue = readNumeric(t, _quiet); |
|||
haveLiteral = true; |
|||
} |
|||
} |
|||
|
|||
if (haveLiteral) |
|||
{ |
|||
bool bareLoad = true; |
|||
if (exec) |
|||
{ |
|||
u256s codes; |
|||
vector<unsigned> locs; |
|||
if (compileLispFragment(d, e, _quiet, codes, locs)) |
|||
{ |
|||
appendCode(o_code, o_locs, codes, locs); |
|||
while (compileLispFragment(d, e, _quiet, codes, locs)) |
|||
if (!_quiet) |
|||
cwarn << "Additional items in bare store. Ignoring."; |
|||
bareLoad = false; |
|||
} |
|||
} |
|||
o_code.push_back(Instruction::PUSH); |
|||
o_code.push_back(literalValue); |
|||
if (exec) |
|||
o_code.push_back(bareLoad ? Instruction::SLOAD : Instruction::SSTORE); |
|||
} |
|||
else |
|||
{ |
|||
boost::algorithm::to_upper(t); |
|||
if (t == "IF") |
|||
{ |
|||
// Compile all the code...
|
|||
u256s codes[4]; |
|||
vector<unsigned> locs[4]; |
|||
for (int i = 0; i < 3; ++i) |
|||
if (!compileLispFragment(d, e, _quiet, codes[i], locs[i])) |
|||
return false; |
|||
if (compileLispFragment(d, e, _quiet, codes[3], locs[3])) |
|||
return false; |
|||
|
|||
// Push the positive location.
|
|||
o_code.push_back(Instruction::PUSH); |
|||
unsigned posLocation = (unsigned)o_code.size(); |
|||
o_locs.push_back(posLocation); |
|||
o_code.push_back(0); |
|||
|
|||
// First fragment - predicate
|
|||
appendCode(o_code, o_locs, codes[0], locs[0]); |
|||
|
|||
// Jump to positive if true.
|
|||
o_code.push_back(Instruction::JMPI); |
|||
|
|||
// Second fragment - negative.
|
|||
appendCode(o_code, o_locs, codes[2], locs[2]); |
|||
|
|||
// Jump to end after negative.
|
|||
o_code.push_back(Instruction::PUSH); |
|||
unsigned endLocation = (unsigned)o_code.size(); |
|||
o_locs.push_back(endLocation); |
|||
o_code.push_back(0); |
|||
o_code.push_back(Instruction::JMP); |
|||
|
|||
// Third fragment - positive.
|
|||
o_code[posLocation] = o_code.size(); |
|||
appendCode(o_code, o_locs, codes[1], locs[1]); |
|||
|
|||
// At end now.
|
|||
o_code[endLocation] = o_code.size(); |
|||
} |
|||
else if (t == "WHEN" || t == "UNLESS") |
|||
{ |
|||
// Compile all the code...
|
|||
u256s codes[3]; |
|||
vector<unsigned> locs[3]; |
|||
for (int i = 0; i < 2; ++i) |
|||
if (!compileLispFragment(d, e, _quiet, codes[i], locs[i])) |
|||
return false; |
|||
if (compileLispFragment(d, e, _quiet, codes[2], locs[2])) |
|||
return false; |
|||
|
|||
// Push the positive location.
|
|||
o_code.push_back(Instruction::PUSH); |
|||
unsigned endLocation = (unsigned)o_code.size(); |
|||
o_locs.push_back(endLocation); |
|||
o_code.push_back(0); |
|||
|
|||
// First fragment - predicate
|
|||
appendCode(o_code, o_locs, codes[0], locs[0]); |
|||
|
|||
// Jump to end...
|
|||
if (t == "WHEN") |
|||
o_code.push_back(Instruction::NOT); |
|||
o_code.push_back(Instruction::JMPI); |
|||
|
|||
// Second fragment - negative.
|
|||
appendCode(o_code, o_locs, codes[1], locs[1]); |
|||
|
|||
// At end now.
|
|||
o_code[endLocation] = o_code.size(); |
|||
} |
|||
else if (t == "FOR") |
|||
{ |
|||
// Compile all the code...
|
|||
u256s codes[3]; |
|||
vector<unsigned> locs[3]; |
|||
for (int i = 0; i < 2; ++i) |
|||
if (!compileLispFragment(d, e, _quiet, codes[i], locs[i])) |
|||
return false; |
|||
if (compileLispFragment(d, e, _quiet, codes[2], locs[2])) |
|||
return false; |
|||
|
|||
unsigned startLocation = (unsigned)o_code.size(); |
|||
|
|||
// Push the positive location.
|
|||
o_code.push_back(Instruction::PUSH); |
|||
unsigned endInsertion = (unsigned)o_code.size(); |
|||
o_locs.push_back(endInsertion); |
|||
o_code.push_back(0); |
|||
|
|||
// First fragment - predicate
|
|||
appendCode(o_code, o_locs, codes[0], locs[0]); |
|||
|
|||
// Jump to positive if true.
|
|||
o_code.push_back(Instruction::NOT); |
|||
o_code.push_back(Instruction::JMPI); |
|||
|
|||
// Second fragment - negative.
|
|||
appendCode(o_code, o_locs, codes[1], locs[1]); |
|||
|
|||
// Jump to end after negative.
|
|||
o_code.push_back(Instruction::PUSH); |
|||
o_locs.push_back((unsigned)o_code.size()); |
|||
o_code.push_back(startLocation); |
|||
o_code.push_back(Instruction::JMP); |
|||
|
|||
// At end now.
|
|||
o_code[endInsertion] = o_code.size(); |
|||
} |
|||
else if (t == "SEQ") |
|||
{ |
|||
while (d != e) |
|||
{ |
|||
u256s codes; |
|||
vector<unsigned> locs; |
|||
if (compileLispFragment(d, e, _quiet, codes, locs)) |
|||
appendCode(o_code, o_locs, codes, locs); |
|||
else |
|||
break; |
|||
} |
|||
} |
|||
else if (t == "AND") |
|||
{ |
|||
vector<u256s> codes; |
|||
vector<vector<unsigned>> locs; |
|||
while (d != e) |
|||
{ |
|||
codes.resize(codes.size() + 1); |
|||
locs.resize(locs.size() + 1); |
|||
if (!compileLispFragment(d, e, _quiet, codes.back(), locs.back())) |
|||
break; |
|||
} |
|||
|
|||
// last one is empty.
|
|||
if (codes.size() < 2) |
|||
return false; |
|||
|
|||
codes.pop_back(); |
|||
locs.pop_back(); |
|||
|
|||
vector<unsigned> ends; |
|||
|
|||
if (codes.size() > 1) |
|||
{ |
|||
o_code.push_back(Instruction::PUSH); |
|||
o_code.push_back(0); |
|||
|
|||
for (unsigned i = 1; i < codes.size(); ++i) |
|||
{ |
|||
// Push the false location.
|
|||
o_code.push_back(Instruction::PUSH); |
|||
ends.push_back((unsigned)o_code.size()); |
|||
o_locs.push_back(ends.back()); |
|||
o_code.push_back(0); |
|||
|
|||
// Check if true - predicate
|
|||
appendCode(o_code, o_locs, codes[i - 1], locs[i - 1]); |
|||
|
|||
// Jump to end...
|
|||
o_code.push_back(Instruction::NOT); |
|||
o_code.push_back(Instruction::JMPI); |
|||
} |
|||
o_code.push_back(Instruction::POP); |
|||
} |
|||
|
|||
// Check if true - predicate
|
|||
appendCode(o_code, o_locs, codes.back(), locs.back()); |
|||
|
|||
// At end now.
|
|||
for (auto i: ends) |
|||
o_code[i] = o_code.size(); |
|||
} |
|||
else if (t == "OR") |
|||
{ |
|||
vector<u256s> codes; |
|||
vector<vector<unsigned>> locs; |
|||
while (d != e) |
|||
{ |
|||
codes.resize(codes.size() + 1); |
|||
locs.resize(locs.size() + 1); |
|||
if (!compileLispFragment(d, e, _quiet, codes.back(), locs.back())) |
|||
break; |
|||
} |
|||
|
|||
// last one is empty.
|
|||
if (codes.size() < 2) |
|||
return false; |
|||
|
|||
codes.pop_back(); |
|||
locs.pop_back(); |
|||
|
|||
vector<unsigned> ends; |
|||
|
|||
if (codes.size() > 1) |
|||
{ |
|||
o_code.push_back(Instruction::PUSH); |
|||
o_code.push_back(1); |
|||
|
|||
for (unsigned i = 1; i < codes.size(); ++i) |
|||
{ |
|||
// Push the false location.
|
|||
o_code.push_back(Instruction::PUSH); |
|||
ends.push_back((unsigned)o_code.size()); |
|||
o_locs.push_back(ends.back()); |
|||
o_code.push_back(0); |
|||
|
|||
// Check if true - predicate
|
|||
appendCode(o_code, o_locs, codes[i - 1], locs[i - 1]); |
|||
|
|||
// Jump to end...
|
|||
o_code.push_back(Instruction::JMPI); |
|||
} |
|||
o_code.push_back(Instruction::POP); |
|||
} |
|||
|
|||
// Check if true - predicate
|
|||
appendCode(o_code, o_locs, codes.back(), locs.back()); |
|||
|
|||
// At end now.
|
|||
for (auto i: ends) |
|||
o_code[i] = o_code.size(); |
|||
} |
|||
else |
|||
{ |
|||
auto it = c_instructions.find(t); |
|||
if (it != c_instructions.end()) |
|||
{ |
|||
if (exec) |
|||
{ |
|||
vector<pair<u256s, vector<unsigned>>> codes(1); |
|||
while (d != e && compileLispFragment(d, e, _quiet, codes.back().first, codes.back().second)) |
|||
codes.push_back(pair<u256s, vector<unsigned>>()); |
|||
for (auto it = codes.rbegin(); it != codes.rend(); ++it) |
|||
appendCode(o_code, o_locs, it->first, it->second); |
|||
o_code.push_back((u256)it->second); |
|||
} |
|||
else |
|||
{ |
|||
o_code.push_back(Instruction::PUSH); |
|||
o_code.push_back(it->second); |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
auto it = c_arith.find(t); |
|||
if (it != c_arith.end()) |
|||
{ |
|||
int i = 0; |
|||
while (d != e) |
|||
{ |
|||
u256s codes; |
|||
vector<unsigned> locs; |
|||
if (compileLispFragment(d, e, _quiet, codes, locs)) |
|||
{ |
|||
appendCode(o_code, o_locs, codes, locs); |
|||
if (i) |
|||
o_code.push_back((u256)it->second); |
|||
++i; |
|||
} |
|||
else |
|||
break; |
|||
} |
|||
} |
|||
else |
|||
{ |
|||
auto it = c_binary.find(t); |
|||
if (it != c_binary.end()) |
|||
{ |
|||
vector<pair<u256s, vector<unsigned>>> codes(1); |
|||
while (d != e && compileLispFragment(d, e, _quiet, codes.back().first, codes.back().second)) |
|||
codes.push_back(pair<u256s, vector<unsigned>>()); |
|||
codes.pop_back(); |
|||
int i = (int)codes.size(); |
|||
if (i > 2) |
|||
cwarn << "Greater than two arguments given to binary operator" << t << "; using first two only."; |
|||
for (auto it = codes.rbegin(); it != codes.rend(); ++it) |
|||
if (--i < 2) |
|||
appendCode(o_code, o_locs, it->first, it->second); |
|||
if (it->second == Instruction::NOT) |
|||
o_code.push_back(Instruction::EQ); |
|||
o_code.push_back((u256)it->second); |
|||
} |
|||
else |
|||
{ |
|||
auto it = c_unary.find(t); |
|||
if (it != c_unary.end()) |
|||
{ |
|||
vector<pair<u256s, vector<unsigned>>> codes(1); |
|||
while (d != e && compileLispFragment(d, e, _quiet, codes.back().first, codes.back().second)) |
|||
codes.push_back(pair<u256s, vector<unsigned>>()); |
|||
codes.pop_back(); |
|||
int i = (int)codes.size(); |
|||
if (i > 1) |
|||
cwarn << "Greater than one argument given to unary operator" << t << "; using first only."; |
|||
for (auto it = codes.rbegin(); it != codes.rend(); ++it) |
|||
if (--i < 1) |
|||
appendCode(o_code, o_locs, it->first, it->second); |
|||
o_code.push_back(it->second); |
|||
} |
|||
else if (!_quiet) |
|||
cwarn << "Unknown assembler token" << t; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
if (!exec) |
|||
return true; |
|||
} |
|||
} |
|||
} |
|||
return false; |
|||
} |
|||
|
|||
u256s eth::compileLisp(std::string const& _code, bool _quiet) |
|||
{ |
|||
char const* d = _code.data(); |
|||
char const* e = _code.data() + _code.size(); |
|||
u256s ret; |
|||
vector<unsigned> locs; |
|||
compileLispFragment(d, e, _quiet, ret, locs); |
|||
return ret; |
|||
} |
|||
|
|||
string eth::disassemble(u256s const& _mem) |
|||
{ |
|||
stringstream ret; |
|||
uint numerics = 0; |
|||
for (auto it = _mem.begin(); it != _mem.end(); ++it) |
|||
{ |
|||
u256 n = *it; |
|||
auto iit = c_instructionInfo.find((Instruction)(uint)n); |
|||
if (numerics || iit == c_instructionInfo.end() || (u256)(uint)iit->first != n) // not an instruction or expecting an argument...
|
|||
{ |
|||
if (numerics) |
|||
numerics--; |
|||
ret << "0x" << hex << n << " "; |
|||
} |
|||
else |
|||
{ |
|||
auto const& ii = iit->second; |
|||
ret << ii.name << " "; |
|||
numerics = ii.additional; |
|||
} |
|||
} |
|||
return ret.str(); |
|||
} |
@ -1,19 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ImportGroup Label="PropertySheets" /> |
|||
<PropertyGroup Label="UserMacros" /> |
|||
<PropertyGroup> |
|||
<IncludePath>$(IncludePath);../../boost_1_55_0;../../leveldb-1.15.0/include;../../cryptopp562;../../secp256k1/include</IncludePath> |
|||
<OutDir>..\build\$(ProjectName)\$(Platform)_$(Configuration)\</OutDir> |
|||
<IntDir>..\build\$(ProjectName)\$(Platform)_$(Configuration)\</IntDir> |
|||
</PropertyGroup> |
|||
<ItemDefinitionGroup> |
|||
<ClCompile> |
|||
<DisableSpecificWarnings>4100;4127;4505;4512;</DisableSpecificWarnings> |
|||
<WarningLevel>Level4</WarningLevel> |
|||
<TreatWarningAsError>true</TreatWarningAsError> |
|||
<MinimalRebuild>false</MinimalRebuild> |
|||
</ClCompile> |
|||
</ItemDefinitionGroup> |
|||
<ItemGroup /> |
|||
</Project> |
@ -1,32 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup> |
|||
<ClInclude Include="TransactionQueue.h" /> |
|||
<ClInclude Include="Trie.h" /> |
|||
<ClInclude Include="vector_ref.h" /> |
|||
<ClInclude Include="AddressState.h" /> |
|||
<ClInclude Include="BlockChain.h" /> |
|||
<ClInclude Include="BlockInfo.h" /> |
|||
<ClInclude Include="Common.h" /> |
|||
<ClInclude Include="Dagger.h" /> |
|||
<ClInclude Include="Exceptions.h" /> |
|||
<ClInclude Include="Instruction.h" /> |
|||
<ClInclude Include="PeerNetwork.h" /> |
|||
<ClInclude Include="RLP.h" /> |
|||
<ClInclude Include="State.h" /> |
|||
<ClInclude Include="Transaction.h" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="Trie.cpp" /> |
|||
<ClCompile Include="AddressState.cpp" /> |
|||
<ClCompile Include="BlockChain.cpp" /> |
|||
<ClCompile Include="BlockInfo.cpp" /> |
|||
<ClCompile Include="Common.cpp" /> |
|||
<ClCompile Include="Dagger.cpp" /> |
|||
<ClCompile Include="PeerNetwork.cpp" /> |
|||
<ClCompile Include="RLP.cpp" /> |
|||
<ClCompile Include="State.cpp" /> |
|||
<ClCompile Include="Transaction.cpp" /> |
|||
<ClCompile Include="TransactionQueue.cpp" /> |
|||
</ItemGroup> |
|||
</Project> |
@ -0,0 +1,60 @@ |
|||
/*
|
|||
This file is part of cpp-ethereum. |
|||
|
|||
cpp-ethereum is free software: you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation, either version 3 of the License, or |
|||
(at your option) any later version. |
|||
|
|||
cpp-ethereum is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License |
|||
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
/** @file VM.cpp
|
|||
* @author Gav Wood <i@gavwood.com> |
|||
* @date 2014 |
|||
*/ |
|||
|
|||
#include "VM.h" |
|||
|
|||
#include <secp256k1.h> |
|||
#include <boost/filesystem.hpp> |
|||
#if WIN32 |
|||
#pragma warning(push) |
|||
#pragma warning(disable:4244) |
|||
#else |
|||
#pragma GCC diagnostic ignored "-Wunused-function" |
|||
#endif |
|||
#include <sha.h> |
|||
#include <sha3.h> |
|||
#include <ripemd.h> |
|||
#if WIN32 |
|||
#pragma warning(pop) |
|||
#else |
|||
#endif |
|||
#include <ctime> |
|||
#include <random> |
|||
#include "BlockChain.h" |
|||
#include "Instruction.h" |
|||
#include "Exceptions.h" |
|||
#include "Dagger.h" |
|||
#include "Defaults.h" |
|||
using namespace std; |
|||
using namespace eth; |
|||
|
|||
VM::VM() |
|||
{ |
|||
reset(); |
|||
} |
|||
|
|||
void VM::reset() |
|||
{ |
|||
m_curPC = 0; |
|||
m_nextPC = 1; |
|||
m_stepCount = 0; |
|||
m_runFee = 0; |
|||
} |
@ -0,0 +1,594 @@ |
|||
/*
|
|||
This file is part of cpp-ethereum. |
|||
|
|||
cpp-ethereum is free software: you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation, either version 3 of the License, or |
|||
(at your option) any later version. |
|||
|
|||
cpp-ethereum is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License |
|||
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
/** @file VM.h
|
|||
* @author Gav Wood <i@gavwood.com> |
|||
* @date 2014 |
|||
*/ |
|||
|
|||
#pragma once |
|||
|
|||
#include <unordered_map> |
|||
#include <secp256k1.h> |
|||
#if WIN32 |
|||
#pragma warning(push) |
|||
#pragma warning(disable:4244) |
|||
#else |
|||
#pragma GCC diagnostic ignored "-Wunused-function" |
|||
#endif |
|||
#include <sha.h> |
|||
#include <sha3.h> |
|||
#include <ripemd.h> |
|||
#if WIN32 |
|||
#pragma warning(pop) |
|||
#else |
|||
#endif |
|||
#include "Common.h" |
|||
#include "Exceptions.h" |
|||
#include "FeeStructure.h" |
|||
#include "Instruction.h" |
|||
#include "BlockInfo.h" |
|||
#include "ExtVMFace.h" |
|||
|
|||
namespace eth |
|||
{ |
|||
|
|||
// Convert from a 256-bit integer stack/memory entry into a 160-bit Address hash.
|
|||
// Currently we just pull out the right (low-order in BE) 160-bits.
|
|||
inline Address asAddress(u256 _item) |
|||
{ |
|||
return right160(h256(_item)); |
|||
} |
|||
|
|||
inline u256 fromAddress(Address _a) |
|||
{ |
|||
return (u160)_a; |
|||
} |
|||
|
|||
/**
|
|||
*/ |
|||
class VM |
|||
{ |
|||
template <unsigned T> friend class UnitTest; |
|||
|
|||
public: |
|||
/// Construct VM object.
|
|||
VM(); |
|||
|
|||
void reset(); |
|||
|
|||
template <class Ext> |
|||
void go(Ext& _ext, uint64_t _steps = (uint64_t)-1); |
|||
|
|||
void require(u256 _n) { if (m_stack.size() < _n) throw StackTooSmall(_n, m_stack.size()); } |
|||
u256 runFee() const { return m_runFee; } |
|||
|
|||
private: |
|||
u256 m_curPC = 0; |
|||
u256 m_nextPC = 1; |
|||
uint64_t m_stepCount = 0; |
|||
std::map<u256, u256> m_temp; |
|||
std::vector<u256> m_stack; |
|||
u256 m_runFee = 0; |
|||
}; |
|||
|
|||
} |
|||
|
|||
// INLINE:
|
|||
template <class Ext> void eth::VM::go(Ext& _ext, uint64_t _steps) |
|||
{ |
|||
for (bool stopped = false; !stopped && _steps--; m_curPC = m_nextPC, m_nextPC = m_curPC + 1) |
|||
{ |
|||
m_stepCount++; |
|||
|
|||
// INSTRUCTION...
|
|||
auto rawInst = _ext.store(m_curPC); |
|||
if (rawInst > 0xff) |
|||
throw BadInstruction(); |
|||
Instruction inst = (Instruction)(uint8_t)rawInst; |
|||
|
|||
// FEES...
|
|||
bigint runFee = m_stepCount > 16 ? _ext.fees.m_stepFee : 0; |
|||
bigint storeCostDelta = 0; |
|||
switch (inst) |
|||
{ |
|||
case Instruction::SSTORE: |
|||
require(2); |
|||
if (!_ext.store(m_stack.back()) && m_stack[m_stack.size() - 2]) |
|||
storeCostDelta += _ext.fees.m_memoryFee; |
|||
if (_ext.store(m_stack.back()) && !m_stack[m_stack.size() - 2]) |
|||
storeCostDelta -= _ext.fees.m_memoryFee; |
|||
// continue on to...
|
|||
case Instruction::SLOAD: |
|||
runFee += _ext.fees.m_dataFee; |
|||
break; |
|||
|
|||
case Instruction::EXTRO: |
|||
case Instruction::BALANCE: |
|||
runFee += _ext.fees.m_extroFee; |
|||
break; |
|||
|
|||
case Instruction::MKTX: |
|||
runFee += _ext.fees.m_txFee; |
|||
break; |
|||
|
|||
case Instruction::SHA256: |
|||
case Instruction::RIPEMD160: |
|||
case Instruction::ECMUL: |
|||
case Instruction::ECADD: |
|||
case Instruction::ECSIGN: |
|||
case Instruction::ECRECOVER: |
|||
case Instruction::ECVALID: |
|||
runFee += _ext.fees.m_cryptoFee; |
|||
break; |
|||
default: |
|||
break; |
|||
} |
|||
_ext.payFee(runFee + storeCostDelta); |
|||
m_runFee += (u256)runFee; |
|||
|
|||
// EXECUTE...
|
|||
switch (inst) |
|||
{ |
|||
case Instruction::ADD: |
|||
//pops two items and pushes S[-1] + S[-2] mod 2^256.
|
|||
require(2); |
|||
m_stack[m_stack.size() - 2] += m_stack.back(); |
|||
m_stack.pop_back(); |
|||
break; |
|||
case Instruction::MUL: |
|||
//pops two items and pushes S[-1] * S[-2] mod 2^256.
|
|||
require(2); |
|||
m_stack[m_stack.size() - 2] *= m_stack.back(); |
|||
m_stack.pop_back(); |
|||
break; |
|||
case Instruction::SUB: |
|||
require(2); |
|||
m_stack[m_stack.size() - 2] = m_stack.back() - m_stack[m_stack.size() - 2]; |
|||
m_stack.pop_back(); |
|||
break; |
|||
case Instruction::DIV: |
|||
require(2); |
|||
m_stack[m_stack.size() - 2] = m_stack.back() / m_stack[m_stack.size() - 2]; |
|||
m_stack.pop_back(); |
|||
break; |
|||
case Instruction::SDIV: |
|||
require(2); |
|||
(s256&)m_stack[m_stack.size() - 2] = (s256&)m_stack.back() / (s256&)m_stack[m_stack.size() - 2]; |
|||
m_stack.pop_back(); |
|||
break; |
|||
case Instruction::MOD: |
|||
require(2); |
|||
m_stack[m_stack.size() - 2] = m_stack.back() % m_stack[m_stack.size() - 2]; |
|||
m_stack.pop_back(); |
|||
break; |
|||
case Instruction::SMOD: |
|||
require(2); |
|||
(s256&)m_stack[m_stack.size() - 2] = (s256&)m_stack.back() % (s256&)m_stack[m_stack.size() - 2]; |
|||
m_stack.pop_back(); |
|||
break; |
|||
case Instruction::EXP: |
|||
{ |
|||
// TODO: better implementation?
|
|||
require(2); |
|||
auto n = m_stack.back(); |
|||
auto x = m_stack[m_stack.size() - 2]; |
|||
m_stack.pop_back(); |
|||
for (u256 i = 0; i < x; ++i) |
|||
n *= n; |
|||
m_stack.back() = n; |
|||
break; |
|||
} |
|||
case Instruction::NEG: |
|||
require(1); |
|||
m_stack.back() = ~(m_stack.back() - 1); |
|||
break; |
|||
case Instruction::LT: |
|||
require(2); |
|||
m_stack[m_stack.size() - 2] = m_stack.back() < m_stack[m_stack.size() - 2] ? 1 : 0; |
|||
m_stack.pop_back(); |
|||
break; |
|||
case Instruction::LE: |
|||
require(2); |
|||
m_stack[m_stack.size() - 2] = m_stack.back() <= m_stack[m_stack.size() - 2] ? 1 : 0; |
|||
m_stack.pop_back(); |
|||
break; |
|||
case Instruction::GT: |
|||
require(2); |
|||
m_stack[m_stack.size() - 2] = m_stack.back() > m_stack[m_stack.size() - 2] ? 1 : 0; |
|||
m_stack.pop_back(); |
|||
break; |
|||
case Instruction::GE: |
|||
require(2); |
|||
m_stack[m_stack.size() - 2] = m_stack.back() >= m_stack[m_stack.size() - 2] ? 1 : 0; |
|||
m_stack.pop_back(); |
|||
break; |
|||
case Instruction::EQ: |
|||
require(2); |
|||
m_stack[m_stack.size() - 2] = m_stack.back() == m_stack[m_stack.size() - 2] ? 1 : 0; |
|||
m_stack.pop_back(); |
|||
break; |
|||
case Instruction::NOT: |
|||
require(1); |
|||
m_stack.back() = m_stack.back() ? 0 : 1; |
|||
break; |
|||
case Instruction::MYADDRESS: |
|||
m_stack.push_back(fromAddress(_ext.myAddress)); |
|||
break; |
|||
case Instruction::TXSENDER: |
|||
m_stack.push_back(fromAddress(_ext.txSender)); |
|||
break; |
|||
case Instruction::TXVALUE: |
|||
m_stack.push_back(_ext.txValue); |
|||
break; |
|||
case Instruction::TXDATAN: |
|||
m_stack.push_back(_ext.txData.size()); |
|||
break; |
|||
case Instruction::TXDATA: |
|||
require(1); |
|||
m_stack.back() = m_stack.back() < _ext.txData.size() ? _ext.txData[(uint)m_stack.back()] : 0; |
|||
break; |
|||
case Instruction::BLK_PREVHASH: |
|||
m_stack.push_back(_ext.previousBlock.hash); |
|||
break; |
|||
case Instruction::BLK_COINBASE: |
|||
m_stack.push_back((u160)_ext.currentBlock.coinbaseAddress); |
|||
break; |
|||
case Instruction::BLK_TIMESTAMP: |
|||
m_stack.push_back(_ext.currentBlock.timestamp); |
|||
break; |
|||
case Instruction::BLK_NUMBER: |
|||
m_stack.push_back(_ext.currentNumber); |
|||
break; |
|||
case Instruction::BLK_DIFFICULTY: |
|||
m_stack.push_back(_ext.currentBlock.difficulty); |
|||
break; |
|||
case Instruction::BLK_NONCE: |
|||
m_stack.push_back(_ext.previousBlock.nonce); |
|||
break; |
|||
case Instruction::BASEFEE: |
|||
m_stack.push_back(_ext.fees.multiplier()); |
|||
break; |
|||
case Instruction::SHA256: |
|||
{ |
|||
require(1); |
|||
uint s = (uint)std::min(m_stack.back(), (u256)(m_stack.size() - 1) * 32); |
|||
m_stack.pop_back(); |
|||
|
|||
CryptoPP::SHA256 digest; |
|||
uint i = 0; |
|||
for (; s; s = (s >= 32 ? s - 32 : 0), i += 32) |
|||
{ |
|||
bytes b = toBigEndian(m_stack.back()); |
|||
digest.Update(b.data(), (int)std::min<u256>(32, s)); // b.size() == 32
|
|||
m_stack.pop_back(); |
|||
} |
|||
std::array<byte, 32> final; |
|||
digest.TruncatedFinal(final.data(), 32); |
|||
m_stack.push_back(fromBigEndian<u256>(final)); |
|||
break; |
|||
} |
|||
case Instruction::RIPEMD160: |
|||
{ |
|||
require(1); |
|||
uint s = (uint)std::min(m_stack.back(), (u256)(m_stack.size() - 1) * 32); |
|||
m_stack.pop_back(); |
|||
|
|||
CryptoPP::RIPEMD160 digest; |
|||
uint i = 0; |
|||
for (; s; s = (s >= 32 ? s - 32 : 0), i += 32) |
|||
{ |
|||
bytes b = toBigEndian(m_stack.back()); |
|||
digest.Update(b.data(), (int)std::min<u256>(32, s)); // b.size() == 32
|
|||
m_stack.pop_back(); |
|||
} |
|||
std::array<byte, 20> final; |
|||
digest.TruncatedFinal(final.data(), 20); |
|||
// NOTE: this aligns to right of 256-bit container (low-order bytes).
|
|||
// This won't work if they're treated as byte-arrays and thus left-aligned in a 256-bit container.
|
|||
m_stack.push_back((u256)fromBigEndian<u160>(final)); |
|||
break; |
|||
} |
|||
case Instruction::ECMUL: |
|||
{ |
|||
// ECMUL - pops three items.
|
|||
// If (S[-2],S[-1]) are a valid point in secp256k1, including both coordinates being less than P, pushes (S[-1],S[-2]) * S[-3], using (0,0) as the point at infinity.
|
|||
// Otherwise, pushes (0,0).
|
|||
require(3); |
|||
|
|||
bytes pub(1, 4); |
|||
pub += toBigEndian(m_stack[m_stack.size() - 2]); |
|||
pub += toBigEndian(m_stack.back()); |
|||
m_stack.pop_back(); |
|||
m_stack.pop_back(); |
|||
|
|||
bytes x = toBigEndian(m_stack.back()); |
|||
m_stack.pop_back(); |
|||
|
|||
if (secp256k1_ecdsa_pubkey_verify(pub.data(), (int)pub.size())) // TODO: Check both are less than P.
|
|||
{ |
|||
secp256k1_ecdsa_pubkey_tweak_mul(pub.data(), (int)pub.size(), x.data()); |
|||
m_stack.push_back(fromBigEndian<u256>(bytesConstRef(&pub).cropped(1, 32))); |
|||
m_stack.push_back(fromBigEndian<u256>(bytesConstRef(&pub).cropped(33, 32))); |
|||
} |
|||
else |
|||
{ |
|||
m_stack.push_back(0); |
|||
m_stack.push_back(0); |
|||
} |
|||
break; |
|||
} |
|||
case Instruction::ECADD: |
|||
{ |
|||
// ECADD - pops four items and pushes (S[-4],S[-3]) + (S[-2],S[-1]) if both points are valid, otherwise (0,0).
|
|||
require(4); |
|||
|
|||
bytes pub(1, 4); |
|||
pub += toBigEndian(m_stack[m_stack.size() - 2]); |
|||
pub += toBigEndian(m_stack.back()); |
|||
m_stack.pop_back(); |
|||
m_stack.pop_back(); |
|||
|
|||
bytes tweak(1, 4); |
|||
tweak += toBigEndian(m_stack[m_stack.size() - 2]); |
|||
tweak += toBigEndian(m_stack.back()); |
|||
m_stack.pop_back(); |
|||
m_stack.pop_back(); |
|||
|
|||
if (secp256k1_ecdsa_pubkey_verify(pub.data(),(int) pub.size()) && secp256k1_ecdsa_pubkey_verify(tweak.data(),(int) tweak.size())) |
|||
{ |
|||
secp256k1_ecdsa_pubkey_tweak_add(pub.data(), (int)pub.size(), tweak.data()); |
|||
m_stack.push_back(fromBigEndian<u256>(bytesConstRef(&pub).cropped(1, 32))); |
|||
m_stack.push_back(fromBigEndian<u256>(bytesConstRef(&pub).cropped(33, 32))); |
|||
} |
|||
else |
|||
{ |
|||
m_stack.push_back(0); |
|||
m_stack.push_back(0); |
|||
} |
|||
break; |
|||
} |
|||
case Instruction::ECSIGN: |
|||
{ |
|||
require(2); |
|||
bytes sig(64); |
|||
int v = 0; |
|||
|
|||
u256 msg = m_stack.back(); |
|||
m_stack.pop_back(); |
|||
u256 priv = m_stack.back(); |
|||
m_stack.pop_back(); |
|||
bytes nonce = toBigEndian(Transaction::kFromMessage(msg, priv)); |
|||
|
|||
if (!secp256k1_ecdsa_sign_compact(toBigEndian(msg).data(), 64, sig.data(), toBigEndian(priv).data(), nonce.data(), &v)) |
|||
throw InvalidSignature(); |
|||
|
|||
m_stack.push_back(v + 27); |
|||
m_stack.push_back(fromBigEndian<u256>(bytesConstRef(&sig).cropped(0, 32))); |
|||
m_stack.push_back(fromBigEndian<u256>(bytesConstRef(&sig).cropped(32))); |
|||
break; |
|||
} |
|||
case Instruction::ECRECOVER: |
|||
{ |
|||
require(4); |
|||
|
|||
bytes sig = toBigEndian(m_stack[m_stack.size() - 2]) + toBigEndian(m_stack.back()); |
|||
m_stack.pop_back(); |
|||
m_stack.pop_back(); |
|||
int v = (int)m_stack.back(); |
|||
m_stack.pop_back(); |
|||
bytes msg = toBigEndian(m_stack.back()); |
|||
m_stack.pop_back(); |
|||
|
|||
byte pubkey[65]; |
|||
int pubkeylen = 65; |
|||
if (secp256k1_ecdsa_recover_compact(msg.data(), (int)msg.size(), sig.data(), pubkey, &pubkeylen, 0, v - 27)) |
|||
{ |
|||
m_stack.push_back(0); |
|||
m_stack.push_back(0); |
|||
} |
|||
else |
|||
{ |
|||
m_stack.push_back(fromBigEndian<u256>(bytesConstRef(&pubkey[1], 32))); |
|||
m_stack.push_back(fromBigEndian<u256>(bytesConstRef(&pubkey[33], 32))); |
|||
} |
|||
break; |
|||
} |
|||
case Instruction::ECVALID: |
|||
{ |
|||
require(2); |
|||
bytes pub(1, 4); |
|||
pub += toBigEndian(m_stack[m_stack.size() - 2]); |
|||
pub += toBigEndian(m_stack.back()); |
|||
m_stack.pop_back(); |
|||
m_stack.pop_back(); |
|||
|
|||
m_stack.back() = secp256k1_ecdsa_pubkey_verify(pub.data(), (int)pub.size()) ? 1 : 0; |
|||
break; |
|||
} |
|||
case Instruction::SHA3: |
|||
{ |
|||
require(1); |
|||
uint s = (uint)std::min(m_stack.back(), (u256)(m_stack.size() - 1) * 32); |
|||
m_stack.pop_back(); |
|||
|
|||
CryptoPP::SHA3_256 digest; |
|||
uint i = 0; |
|||
for (; s; s = (s >= 32 ? s - 32 : 0), i += 32) |
|||
{ |
|||
bytes b = toBigEndian(m_stack.back()); |
|||
digest.Update(b.data(), (int)std::min<u256>(32, s)); // b.size() == 32
|
|||
m_stack.pop_back(); |
|||
} |
|||
std::array<byte, 32> final; |
|||
digest.TruncatedFinal(final.data(), 32); |
|||
m_stack.push_back(fromBigEndian<u256>(final)); |
|||
break; |
|||
} |
|||
case Instruction::PUSH: |
|||
{ |
|||
m_stack.push_back(_ext.store(m_curPC + 1)); |
|||
m_nextPC = m_curPC + 2; |
|||
break; |
|||
} |
|||
case Instruction::POP: |
|||
require(1); |
|||
m_stack.pop_back(); |
|||
break; |
|||
case Instruction::DUP: |
|||
require(1); |
|||
m_stack.push_back(m_stack.back()); |
|||
break; |
|||
/*case Instruction::DUPN:
|
|||
{ |
|||
auto s = store(curPC + 1); |
|||
if (s == 0 || s > stack.size()) |
|||
throw OperandOutOfRange(1, stack.size(), s); |
|||
stack.push_back(stack[stack.size() - (uint)s]); |
|||
nextPC = curPC + 2; |
|||
break; |
|||
}*/ |
|||
case Instruction::SWAP: |
|||
{ |
|||
require(2); |
|||
auto d = m_stack.back(); |
|||
m_stack.back() = m_stack[m_stack.size() - 2]; |
|||
m_stack[m_stack.size() - 2] = d; |
|||
break; |
|||
} |
|||
/*case Instruction::SWAPN:
|
|||
{ |
|||
require(1); |
|||
auto d = stack.back(); |
|||
auto s = store(curPC + 1); |
|||
if (s == 0 || s > stack.size()) |
|||
throw OperandOutOfRange(1, stack.size(), s); |
|||
stack.back() = stack[stack.size() - (uint)s]; |
|||
stack[stack.size() - (uint)s] = d; |
|||
nextPC = curPC + 2; |
|||
break; |
|||
}*/ |
|||
case Instruction::MLOAD: |
|||
{ |
|||
require(1); |
|||
#ifdef __clang__ |
|||
auto mFinder = m_temp.find(m_stack.back()); |
|||
if (mFinder != m_temp.end()) |
|||
m_stack.back() = mFinder->second; |
|||
else |
|||
m_stack.back() = 0; |
|||
#else |
|||
m_stack.back() = m_temp[m_stack.back()]; |
|||
#endif |
|||
break; |
|||
} |
|||
case Instruction::MSTORE: |
|||
{ |
|||
require(2); |
|||
#ifdef __clang__ |
|||
auto mFinder = m_temp.find(m_stack.back()); |
|||
if (mFinder == m_temp.end()) |
|||
m_temp.insert(std::make_pair(m_stack.back(), m_stack[m_stack.size() - 2])); |
|||
else |
|||
mFinder->second = m_stack[m_stack.size() - 2]; |
|||
#else |
|||
m_temp[m_stack.back()] = m_stack[m_stack.size() - 2]; |
|||
#endif |
|||
m_stack.pop_back(); |
|||
m_stack.pop_back(); |
|||
break; |
|||
} |
|||
case Instruction::SLOAD: |
|||
require(1); |
|||
m_stack.back() = _ext.store(m_stack.back()); |
|||
break; |
|||
case Instruction::SSTORE: |
|||
require(2); |
|||
_ext.setStore(m_stack.back(), m_stack[m_stack.size() - 2]); |
|||
m_stack.pop_back(); |
|||
m_stack.pop_back(); |
|||
break; |
|||
case Instruction::JMP: |
|||
require(1); |
|||
m_nextPC = m_stack.back(); |
|||
m_stack.pop_back(); |
|||
break; |
|||
case Instruction::JMPI: |
|||
require(2); |
|||
if (m_stack.back()) |
|||
m_nextPC = m_stack[m_stack.size() - 2]; |
|||
m_stack.pop_back(); |
|||
m_stack.pop_back(); |
|||
break; |
|||
case Instruction::IND: |
|||
m_stack.push_back(m_curPC); |
|||
break; |
|||
case Instruction::EXTRO: |
|||
{ |
|||
require(2); |
|||
auto memoryAddress = m_stack.back(); |
|||
m_stack.pop_back(); |
|||
Address contractAddress = asAddress(m_stack.back()); |
|||
m_stack.back() = _ext.extro(contractAddress, memoryAddress); |
|||
break; |
|||
} |
|||
case Instruction::BALANCE: |
|||
{ |
|||
require(1); |
|||
m_stack.back() = _ext.balance(asAddress(m_stack.back())); |
|||
break; |
|||
} |
|||
case Instruction::MKTX: |
|||
{ |
|||
require(3); |
|||
|
|||
Transaction t; |
|||
t.receiveAddress = asAddress(m_stack.back()); |
|||
m_stack.pop_back(); |
|||
t.value = m_stack.back(); |
|||
m_stack.pop_back(); |
|||
|
|||
auto itemCount = m_stack.back(); |
|||
m_stack.pop_back(); |
|||
if (m_stack.size() < itemCount) |
|||
throw OperandOutOfRange(0, m_stack.size(), itemCount); |
|||
t.data.reserve((uint)itemCount); |
|||
for (auto i = 0; i < itemCount; ++i) |
|||
{ |
|||
t.data.push_back(m_stack.back()); |
|||
m_stack.pop_back(); |
|||
} |
|||
|
|||
_ext.mktx(t); |
|||
break; |
|||
} |
|||
case Instruction::SUICIDE: |
|||
{ |
|||
require(1); |
|||
Address dest = asAddress(m_stack.back()); |
|||
_ext.suicide(dest); |
|||
// ...follow through to...
|
|||
} |
|||
case Instruction::STOP: |
|||
return; |
|||
default: |
|||
throw BadInstruction(); |
|||
} |
|||
} |
|||
if (_steps == (unsigned)-1) |
|||
throw StepsDone(); |
|||
} |
|||
|
@ -0,0 +1,212 @@ |
|||
// Copyright (c) 2014 Tim Hughes
|
|||
// Distributed under the MIT/X11 software license, see the accompanying
|
|||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|||
|
|||
#ifndef _SECP256K1_NUM_REPR_IMPL_H_ |
|||
#define _SECP256K1_NUM_REPR_IMPL_H_ |
|||
#include <assert.h> |
|||
#include <boost/math/common_factor.hpp> |
|||
|
|||
void static secp256k1_num_init(secp256k1_num_t *r) |
|||
{ |
|||
*r = 0; |
|||
} |
|||
|
|||
void static secp256k1_num_free(secp256k1_num_t*) |
|||
{ |
|||
} |
|||
|
|||
void static secp256k1_num_copy(secp256k1_num_t *r, const secp256k1_num_t *a) |
|||
{ |
|||
*r = *a; |
|||
} |
|||
|
|||
int static secp256k1_num_bits(const secp256k1_num_t *a) |
|||
{ |
|||
int numLimbs = a->backend().size(); |
|||
int ret = (numLimbs - 1) * a->backend().limb_bits; |
|||
for (auto x = a->backend().limbs()[numLimbs - 1]; x; x >>= 1, ++ret); |
|||
return ret; |
|||
} |
|||
|
|||
void static secp256k1_num_get_bin(unsigned char *r, unsigned int rlen, const secp256k1_num_t *a) |
|||
{ |
|||
for (auto n = abs(*a); n; n >>= 8) |
|||
{ |
|||
assert(rlen > 0); // out of space?
|
|||
r[--rlen] = n.convert_to<unsigned char>(); |
|||
} |
|||
memset(r, 0, rlen); |
|||
} |
|||
|
|||
void static secp256k1_num_set_bin(secp256k1_num_t *r, const unsigned char *a, unsigned int alen) |
|||
{ |
|||
*r = 0; |
|||
for (unsigned int i = 0; i != alen; ++i) |
|||
{ |
|||
*r <<= 8; |
|||
*r |= a[i]; |
|||
} |
|||
} |
|||
|
|||
void static secp256k1_num_set_int(secp256k1_num_t *r, int a) |
|||
{ |
|||
*r = a; |
|||
} |
|||
|
|||
void static secp256k1_num_mod(secp256k1_num_t *r, const secp256k1_num_t *m) |
|||
{ |
|||
*r %= *m; |
|||
} |
|||
|
|||
void static secp256k1_num_mod_inverse(secp256k1_num_t *r, const secp256k1_num_t *n, const secp256k1_num_t *m) |
|||
{ |
|||
// http://rosettacode.org/wiki/Modular_inverse
|
|||
secp256k1_num_t a = *n; |
|||
secp256k1_num_t b = *m; |
|||
secp256k1_num_t x0 = 0; |
|||
secp256k1_num_t x1 = 1; |
|||
assert(*n > 0); |
|||
assert(*m > 0); |
|||
if (b != 1) |
|||
{ |
|||
secp256k1_num_t q, t; |
|||
while (a > 1) |
|||
{ |
|||
boost::multiprecision::divide_qr(a, b, q, t); |
|||
a = b; b = t; |
|||
|
|||
t = x1 - q * x0; |
|||
x1 = x0; x0 = t; |
|||
} |
|||
if (x1 < 0) |
|||
{ |
|||
x1 += *m; |
|||
} |
|||
} |
|||
*r = x1; |
|||
|
|||
// check result
|
|||
#ifdef _DEBUG |
|||
{ |
|||
typedef boost::multiprecision::number<boost::multiprecision::cpp_int_backend<512, 512, boost::multiprecision::signed_magnitude, boost::multiprecision::unchecked, void>> bignum; |
|||
bignum br = *r, bn = *n, bm = *m; |
|||
assert((((bn) * (br)) % bm) == 1); |
|||
} |
|||
#endif |
|||
} |
|||
|
|||
int static secp256k1_num_is_zero(const secp256k1_num_t *a) |
|||
{ |
|||
return a->is_zero(); |
|||
} |
|||
|
|||
int static secp256k1_num_is_odd(const secp256k1_num_t *a) |
|||
{ |
|||
return boost::multiprecision::bit_test(*a, 0); |
|||
} |
|||
|
|||
int static secp256k1_num_is_neg(const secp256k1_num_t *a) |
|||
{ |
|||
return a->backend().isneg(); |
|||
} |
|||
|
|||
int static secp256k1_num_cmp(const secp256k1_num_t *a, const secp256k1_num_t *b) |
|||
{ |
|||
return a->backend().compare_unsigned(b->backend()); |
|||
} |
|||
|
|||
void static secp256k1_num_add(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) |
|||
{ |
|||
*r = (*a) + (*b); |
|||
} |
|||
|
|||
void static secp256k1_num_sub(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) |
|||
{ |
|||
*r = (*a) - (*b); |
|||
} |
|||
|
|||
void static secp256k1_num_mul(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) |
|||
{ |
|||
*r = (*a) * (*b); |
|||
} |
|||
|
|||
void static secp256k1_num_div(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b) |
|||
{ |
|||
*r = (*a) / (*b); |
|||
} |
|||
|
|||
void static secp256k1_num_mod_mul(secp256k1_num_t *r, const secp256k1_num_t *a, const secp256k1_num_t *b, const secp256k1_num_t *m) |
|||
{ |
|||
secp256k1_num_mul(r, a, b); |
|||
secp256k1_num_mod(r, m); |
|||
} |
|||
|
|||
int static secp256k1_num_shift(secp256k1_num_t *r, int bits) |
|||
{ |
|||
unsigned ret = r->convert_to<unsigned>() & ((1 << bits) - 1); |
|||
*r >>= bits; |
|||
return ret; |
|||
} |
|||
|
|||
int static secp256k1_num_get_bit(const secp256k1_num_t *a, int pos) |
|||
{ |
|||
return boost::multiprecision::bit_test(*a, pos); |
|||
} |
|||
|
|||
void static secp256k1_num_inc(secp256k1_num_t *r) |
|||
{ |
|||
++*r; |
|||
} |
|||
|
|||
void static secp256k1_num_set_hex(secp256k1_num_t *r, const char *a, int alen) |
|||
{ |
|||
static const unsigned char cvt[256] = { |
|||
0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, |
|||
0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, |
|||
0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, |
|||
0, 1, 2, 3, 4, 5, 6,7,8,9,0,0,0,0,0,0, |
|||
0,10,11,12,13,14,15,0,0,0,0,0,0,0,0,0, |
|||
0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, |
|||
0,10,11,12,13,14,15,0,0,0,0,0,0,0,0,0, |
|||
0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, |
|||
0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, |
|||
0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, |
|||
0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, |
|||
0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, |
|||
0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, |
|||
0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, |
|||
0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0, |
|||
0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0 |
|||
}; |
|||
*r = 0; |
|||
for (int i = 0; i != alen; ++i) |
|||
{ |
|||
*r <<= 4; |
|||
*r |= cvt[a[i]]; |
|||
} |
|||
} |
|||
|
|||
void static secp256k1_num_get_hex(char *r, int rlen, const secp256k1_num_t *a) |
|||
{ |
|||
static const unsigned char cvt[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; |
|||
for (auto n = *a; n; n >>= 4) |
|||
{ |
|||
assert(rlen > 0); // out of space?
|
|||
r[--rlen] = cvt[n.convert_to<unsigned char>() & 15]; |
|||
} |
|||
memset(r, '0', rlen); |
|||
} |
|||
|
|||
void static secp256k1_num_split(secp256k1_num_t *rl, secp256k1_num_t *rh, const secp256k1_num_t *a, int bits) |
|||
{ |
|||
*rl = *a & ((secp256k1_num_t(1) << bits) - 1); |
|||
*rh = *a >> bits; |
|||
} |
|||
|
|||
void static secp256k1_num_negate(secp256k1_num_t *r) |
|||
{ |
|||
r->backend().negate(); |
|||
} |
|||
|
|||
#endif |
@ -0,0 +1,12 @@ |
|||
// Copyright (c) 2013 Pieter Wuille
|
|||
// Distributed under the MIT/X11 software license, see the accompanying
|
|||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|||
|
|||
#ifndef _SECP256K1_NUM_REPR_ |
|||
#define _SECP256K1_NUM_REPR_ |
|||
|
|||
#include <boost/multiprecision/cpp_int.hpp> |
|||
|
|||
typedef boost::multiprecision::number<boost::multiprecision::cpp_int_backend<512, 512, boost::multiprecision::signed_magnitude, boost::multiprecision::unchecked, void>> secp256k1_num_t ; |
|||
|
|||
#endif |
@ -0,0 +1,470 @@ |
|||
// Copyright (c) 2013 Pieter Wuille
|
|||
// Distributed under the MIT/X11 software license, see the accompanying
|
|||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|||
|
|||
#if defined HAVE_CONFIG_H |
|||
#include "libsecp256k1-config.h" |
|||
#endif |
|||
|
|||
#include <assert.h> |
|||
#include <stdio.h> |
|||
|
|||
#include "impl/num.h" |
|||
#include "impl/field.h" |
|||
#include "impl/group.h" |
|||
#include "impl/ecmult.h" |
|||
#include "impl/ecdsa.h" |
|||
#include "impl/util.h" |
|||
|
|||
#ifdef ENABLE_OPENSSL_TESTS |
|||
#include "openssl/bn.h" |
|||
#include "openssl/ec.h" |
|||
#include "openssl/ecdsa.h" |
|||
#include "openssl/obj_mac.h" |
|||
#endif |
|||
|
|||
static int count = 100; |
|||
|
|||
/***** NUM TESTS *****/ |
|||
|
|||
void random_num_negate(secp256k1_num_t *num) { |
|||
if (secp256k1_rand32() & 1) |
|||
secp256k1_num_negate(num); |
|||
} |
|||
|
|||
void random_num_order_test(secp256k1_num_t *num) { |
|||
do { |
|||
unsigned char b32[32]; |
|||
secp256k1_rand256_test(b32); |
|||
secp256k1_num_set_bin(num, b32, 32); |
|||
if (secp256k1_num_is_zero(num)) |
|||
continue; |
|||
if (secp256k1_num_cmp(num, &secp256k1_ge_consts->order) >= 0) |
|||
continue; |
|||
break; |
|||
} while(1); |
|||
} |
|||
|
|||
void random_num_order(secp256k1_num_t *num) { |
|||
do { |
|||
unsigned char b32[32]; |
|||
secp256k1_rand256(b32); |
|||
secp256k1_num_set_bin(num, b32, 32); |
|||
if (secp256k1_num_is_zero(num)) |
|||
continue; |
|||
if (secp256k1_num_cmp(num, &secp256k1_ge_consts->order) >= 0) |
|||
continue; |
|||
break; |
|||
} while(1); |
|||
} |
|||
|
|||
void test_num_copy_inc_cmp() { |
|||
secp256k1_num_t n1,n2; |
|||
secp256k1_num_init(&n1); |
|||
secp256k1_num_init(&n2); |
|||
random_num_order(&n1); |
|||
secp256k1_num_copy(&n2, &n1); |
|||
assert(secp256k1_num_cmp(&n1, &n2) == 0); |
|||
assert(secp256k1_num_cmp(&n2, &n1) == 0); |
|||
secp256k1_num_inc(&n2); |
|||
assert(secp256k1_num_cmp(&n1, &n2) != 0); |
|||
assert(secp256k1_num_cmp(&n2, &n1) != 0); |
|||
secp256k1_num_free(&n1); |
|||
secp256k1_num_free(&n2); |
|||
} |
|||
|
|||
|
|||
void test_num_get_set_hex() { |
|||
secp256k1_num_t n1,n2; |
|||
secp256k1_num_init(&n1); |
|||
secp256k1_num_init(&n2); |
|||
random_num_order_test(&n1); |
|||
char c[64]; |
|||
secp256k1_num_get_hex(c, 64, &n1); |
|||
secp256k1_num_set_hex(&n2, c, 64); |
|||
assert(secp256k1_num_cmp(&n1, &n2) == 0); |
|||
for (int i=0; i<64; i++) { |
|||
// check whether the lower 4 bits correspond to the last hex character
|
|||
int low1 = secp256k1_num_shift(&n1, 4); |
|||
int lowh = c[63]; |
|||
int low2 = (lowh>>6)*9+(lowh-'0')&15; |
|||
assert(low1 == low2); |
|||
// shift bits off the hex representation, and compare
|
|||
memmove(c+1, c, 63); |
|||
c[0] = '0'; |
|||
secp256k1_num_set_hex(&n2, c, 64); |
|||
assert(secp256k1_num_cmp(&n1, &n2) == 0); |
|||
} |
|||
secp256k1_num_free(&n2); |
|||
secp256k1_num_free(&n1); |
|||
} |
|||
|
|||
void test_num_get_set_bin() { |
|||
secp256k1_num_t n1,n2; |
|||
secp256k1_num_init(&n1); |
|||
secp256k1_num_init(&n2); |
|||
random_num_order_test(&n1); |
|||
unsigned char c[32]; |
|||
secp256k1_num_get_bin(c, 32, &n1); |
|||
secp256k1_num_set_bin(&n2, c, 32); |
|||
assert(secp256k1_num_cmp(&n1, &n2) == 0); |
|||
for (int i=0; i<32; i++) { |
|||
// check whether the lower 8 bits correspond to the last byte
|
|||
int low1 = secp256k1_num_shift(&n1, 8); |
|||
int low2 = c[31]; |
|||
assert(low1 == low2); |
|||
// shift bits off the byte representation, and compare
|
|||
memmove(c+1, c, 31); |
|||
c[0] = 0; |
|||
secp256k1_num_set_bin(&n2, c, 32); |
|||
assert(secp256k1_num_cmp(&n1, &n2) == 0); |
|||
} |
|||
secp256k1_num_free(&n2); |
|||
secp256k1_num_free(&n1); |
|||
} |
|||
|
|||
void run_num_int() { |
|||
secp256k1_num_t n1; |
|||
secp256k1_num_init(&n1); |
|||
for (int i=-255; i<256; i++) { |
|||
unsigned char c1[3] = {}; |
|||
c1[2] = abs(i); |
|||
unsigned char c2[3] = {0x11,0x22,0x33}; |
|||
secp256k1_num_set_int(&n1, i); |
|||
secp256k1_num_get_bin(c2, 3, &n1); |
|||
assert(memcmp(c1, c2, 3) == 0); |
|||
} |
|||
secp256k1_num_free(&n1); |
|||
} |
|||
|
|||
void test_num_negate() { |
|||
secp256k1_num_t n1; |
|||
secp256k1_num_t n2; |
|||
secp256k1_num_init(&n1); |
|||
secp256k1_num_init(&n2); |
|||
random_num_order_test(&n1); // n1 = R
|
|||
random_num_negate(&n1); |
|||
secp256k1_num_copy(&n2, &n1); // n2 = R
|
|||
secp256k1_num_sub(&n1, &n2, &n1); // n1 = n2-n1 = 0
|
|||
assert(secp256k1_num_is_zero(&n1)); |
|||
secp256k1_num_copy(&n1, &n2); // n1 = R
|
|||
secp256k1_num_negate(&n1); // n1 = -R
|
|||
assert(!secp256k1_num_is_zero(&n1)); |
|||
secp256k1_num_add(&n1, &n2, &n1); // n1 = n2+n1 = 0
|
|||
assert(secp256k1_num_is_zero(&n1)); |
|||
secp256k1_num_copy(&n1, &n2); // n1 = R
|
|||
secp256k1_num_negate(&n1); // n1 = -R
|
|||
assert(secp256k1_num_is_neg(&n1) != secp256k1_num_is_neg(&n2)); |
|||
secp256k1_num_negate(&n1); // n1 = R
|
|||
assert(secp256k1_num_cmp(&n1, &n2) == 0); |
|||
assert(secp256k1_num_is_neg(&n1) == secp256k1_num_is_neg(&n2)); |
|||
secp256k1_num_free(&n2); |
|||
secp256k1_num_free(&n1); |
|||
} |
|||
|
|||
void test_num_add_sub() { |
|||
secp256k1_num_t n1; |
|||
secp256k1_num_t n2; |
|||
secp256k1_num_init(&n1); |
|||
secp256k1_num_init(&n2); |
|||
random_num_order_test(&n1); // n1 = R1
|
|||
random_num_negate(&n1); |
|||
random_num_order_test(&n2); // n2 = R2
|
|||
random_num_negate(&n2); |
|||
secp256k1_num_t n1p2, n2p1, n1m2, n2m1; |
|||
secp256k1_num_init(&n1p2); |
|||
secp256k1_num_init(&n2p1); |
|||
secp256k1_num_init(&n1m2); |
|||
secp256k1_num_init(&n2m1); |
|||
secp256k1_num_add(&n1p2, &n1, &n2); // n1p2 = R1 + R2
|
|||
secp256k1_num_add(&n2p1, &n2, &n1); // n2p1 = R2 + R1
|
|||
secp256k1_num_sub(&n1m2, &n1, &n2); // n1m2 = R1 - R2
|
|||
secp256k1_num_sub(&n2m1, &n2, &n1); // n2m1 = R2 - R1
|
|||
assert(secp256k1_num_cmp(&n1p2, &n2p1) == 0); |
|||
assert(secp256k1_num_cmp(&n1p2, &n1m2) != 0); |
|||
secp256k1_num_negate(&n2m1); // n2m1 = -R2 + R1
|
|||
assert(secp256k1_num_cmp(&n2m1, &n1m2) == 0); |
|||
assert(secp256k1_num_cmp(&n2m1, &n1) != 0); |
|||
secp256k1_num_add(&n2m1, &n2m1, &n2); // n2m1 = -R2 + R1 + R2 = R1
|
|||
assert(secp256k1_num_cmp(&n2m1, &n1) == 0); |
|||
assert(secp256k1_num_cmp(&n2p1, &n1) != 0); |
|||
secp256k1_num_sub(&n2p1, &n2p1, &n2); // n2p1 = R2 + R1 - R2 = R1
|
|||
assert(secp256k1_num_cmp(&n2p1, &n1) == 0); |
|||
secp256k1_num_free(&n2m1); |
|||
secp256k1_num_free(&n1m2); |
|||
secp256k1_num_free(&n2p1); |
|||
secp256k1_num_free(&n1p2); |
|||
secp256k1_num_free(&n2); |
|||
secp256k1_num_free(&n1); |
|||
} |
|||
|
|||
void run_num_smalltests() { |
|||
for (int i=0; i<100*count; i++) { |
|||
test_num_copy_inc_cmp(); |
|||
test_num_get_set_hex(); |
|||
test_num_get_set_bin(); |
|||
test_num_negate(); |
|||
test_num_add_sub(); |
|||
} |
|||
run_num_int(); |
|||
} |
|||
|
|||
void run_ecmult_chain() { |
|||
// random starting point A (on the curve)
|
|||
secp256k1_fe_t ax; secp256k1_fe_set_hex(&ax, "8b30bbe9ae2a990696b22f670709dff3727fd8bc04d3362c6c7bf458e2846004", 64); |
|||
secp256k1_fe_t ay; secp256k1_fe_set_hex(&ay, "a357ae915c4a65281309edf20504740f0eb3343990216b4f81063cb65f2f7e0f", 64); |
|||
secp256k1_gej_t a; secp256k1_gej_set_xy(&a, &ax, &ay); |
|||
// two random initial factors xn and gn
|
|||
secp256k1_num_t xn; |
|||
secp256k1_num_init(&xn); |
|||
secp256k1_num_set_hex(&xn, "84cc5452f7fde1edb4d38a8ce9b1b84ccef31f146e569be9705d357a42985407", 64); |
|||
secp256k1_num_t gn; |
|||
secp256k1_num_init(&gn); |
|||
secp256k1_num_set_hex(&gn, "a1e58d22553dcd42b23980625d4c57a96e9323d42b3152e5ca2c3990edc7c9de", 64); |
|||
// two small multipliers to be applied to xn and gn in every iteration:
|
|||
secp256k1_num_t xf; |
|||
secp256k1_num_init(&xf); |
|||
secp256k1_num_set_hex(&xf, "1337", 4); |
|||
secp256k1_num_t gf; |
|||
secp256k1_num_init(&gf); |
|||
secp256k1_num_set_hex(&gf, "7113", 4); |
|||
// accumulators with the resulting coefficients to A and G
|
|||
secp256k1_num_t ae; |
|||
secp256k1_num_init(&ae); |
|||
secp256k1_num_set_int(&ae, 1); |
|||
secp256k1_num_t ge; |
|||
secp256k1_num_init(&ge); |
|||
secp256k1_num_set_int(&ge, 0); |
|||
// the point being computed
|
|||
secp256k1_gej_t x = a; |
|||
const secp256k1_num_t *order = &secp256k1_ge_consts->order; |
|||
for (int i=0; i<200*count; i++) { |
|||
// in each iteration, compute X = xn*X + gn*G;
|
|||
secp256k1_ecmult(&x, &x, &xn, &gn); |
|||
// also compute ae and ge: the actual accumulated factors for A and G
|
|||
// if X was (ae*A+ge*G), xn*X + gn*G results in (xn*ae*A + (xn*ge+gn)*G)
|
|||
secp256k1_num_mod_mul(&ae, &ae, &xn, order); |
|||
secp256k1_num_mod_mul(&ge, &ge, &xn, order); |
|||
secp256k1_num_add(&ge, &ge, &gn); |
|||
secp256k1_num_mod(&ge, order); |
|||
// modify xn and gn
|
|||
secp256k1_num_mod_mul(&xn, &xn, &xf, order); |
|||
secp256k1_num_mod_mul(&gn, &gn, &gf, order); |
|||
|
|||
// verify
|
|||
if (i == 19999) { |
|||
char res[132]; int resl = 132; |
|||
secp256k1_gej_get_hex(res, &resl, &x); |
|||
assert(strcmp(res, "(D6E96687F9B10D092A6F35439D86CEBEA4535D0D409F53586440BD74B933E830,B95CBCA2C77DA786539BE8FD53354D2D3B4F566AE658045407ED6015EE1B2A88)") == 0); |
|||
} |
|||
} |
|||
// redo the computation, but directly with the resulting ae and ge coefficients:
|
|||
secp256k1_gej_t x2; secp256k1_ecmult(&x2, &a, &ae, &ge); |
|||
char res[132]; int resl = 132; |
|||
char res2[132]; int resl2 = 132; |
|||
secp256k1_gej_get_hex(res, &resl, &x); |
|||
secp256k1_gej_get_hex(res2, &resl2, &x2); |
|||
assert(strcmp(res, res2) == 0); |
|||
assert(strlen(res) == 131); |
|||
secp256k1_num_free(&xn); |
|||
secp256k1_num_free(&gn); |
|||
secp256k1_num_free(&xf); |
|||
secp256k1_num_free(&gf); |
|||
secp256k1_num_free(&ae); |
|||
secp256k1_num_free(&ge); |
|||
} |
|||
|
|||
void test_point_times_order(const secp256k1_gej_t *point) { |
|||
// either the point is not on the curve, or multiplying it by the order results in O
|
|||
if (!secp256k1_gej_is_valid(point)) |
|||
return; |
|||
|
|||
const secp256k1_num_t *order = &secp256k1_ge_consts->order; |
|||
secp256k1_num_t zero; |
|||
secp256k1_num_init(&zero); |
|||
secp256k1_num_set_int(&zero, 0); |
|||
secp256k1_gej_t res; |
|||
secp256k1_ecmult(&res, point, order, order); // calc res = order * point + order * G;
|
|||
assert(secp256k1_gej_is_infinity(&res)); |
|||
secp256k1_num_free(&zero); |
|||
} |
|||
|
|||
void run_point_times_order() { |
|||
secp256k1_fe_t x; secp256k1_fe_set_hex(&x, "02", 2); |
|||
for (int i=0; i<500; i++) { |
|||
secp256k1_ge_t p; secp256k1_ge_set_xo(&p, &x, 1); |
|||
secp256k1_gej_t j; secp256k1_gej_set_ge(&j, &p); |
|||
test_point_times_order(&j); |
|||
secp256k1_fe_sqr(&x, &x); |
|||
} |
|||
char c[65]; int cl=65; |
|||
secp256k1_fe_get_hex(c, &cl, &x); |
|||
assert(strcmp(c, "7603CB59B0EF6C63FE6084792A0C378CDB3233A80F8A9A09A877DEAD31B38C45") == 0); |
|||
} |
|||
|
|||
void test_wnaf(const secp256k1_num_t *number, int w) { |
|||
secp256k1_num_t x, two, t; |
|||
secp256k1_num_init(&x); |
|||
secp256k1_num_init(&two); |
|||
secp256k1_num_init(&t); |
|||
secp256k1_num_set_int(&x, 0); |
|||
secp256k1_num_set_int(&two, 2); |
|||
int wnaf[257]; |
|||
int bits = secp256k1_ecmult_wnaf(wnaf, number, w); |
|||
int zeroes = -1; |
|||
for (int i=bits-1; i>=0; i--) { |
|||
secp256k1_num_mul(&x, &x, &two); |
|||
int v = wnaf[i]; |
|||
if (v) { |
|||
assert(zeroes == -1 || zeroes >= w-1); // check that distance between non-zero elements is at least w-1
|
|||
zeroes=0; |
|||
assert((v & 1) == 1); // check non-zero elements are odd
|
|||
assert(v <= (1 << (w-1)) - 1); // check range below
|
|||
assert(v >= -(1 << (w-1)) - 1); // check range above
|
|||
} else { |
|||
assert(zeroes != -1); // check that no unnecessary zero padding exists
|
|||
zeroes++; |
|||
} |
|||
secp256k1_num_set_int(&t, v); |
|||
secp256k1_num_add(&x, &x, &t); |
|||
} |
|||
assert(secp256k1_num_cmp(&x, number) == 0); // check that wnaf represents number
|
|||
secp256k1_num_free(&x); |
|||
secp256k1_num_free(&two); |
|||
secp256k1_num_free(&t); |
|||
} |
|||
|
|||
void run_wnaf() { |
|||
secp256k1_num_t n; |
|||
secp256k1_num_init(&n); |
|||
for (int i=0; i<count; i++) { |
|||
random_num_order(&n); |
|||
if (i % 1) |
|||
secp256k1_num_negate(&n); |
|||
test_wnaf(&n, 4+(i%10)); |
|||
} |
|||
secp256k1_num_free(&n); |
|||
} |
|||
|
|||
void random_sign(secp256k1_ecdsa_sig_t *sig, const secp256k1_num_t *key, const secp256k1_num_t *msg, int *recid) { |
|||
secp256k1_num_t nonce; |
|||
secp256k1_num_init(&nonce); |
|||
do { |
|||
random_num_order_test(&nonce); |
|||
} while(!secp256k1_ecdsa_sig_sign(sig, key, msg, &nonce, recid)); |
|||
secp256k1_num_free(&nonce); |
|||
} |
|||
|
|||
void test_ecdsa_sign_verify() { |
|||
const secp256k1_ge_consts_t *c = secp256k1_ge_consts; |
|||
secp256k1_num_t msg, key; |
|||
secp256k1_num_init(&msg); |
|||
random_num_order_test(&msg); |
|||
secp256k1_num_init(&key); |
|||
random_num_order_test(&key); |
|||
secp256k1_gej_t pubj; secp256k1_ecmult_gen(&pubj, &key); |
|||
secp256k1_ge_t pub; secp256k1_ge_set_gej(&pub, &pubj); |
|||
secp256k1_ecdsa_sig_t sig; |
|||
secp256k1_ecdsa_sig_init(&sig); |
|||
random_sign(&sig, &key, &msg, NULL); |
|||
assert(secp256k1_ecdsa_sig_verify(&sig, &pub, &msg)); |
|||
secp256k1_num_inc(&msg); |
|||
assert(!secp256k1_ecdsa_sig_verify(&sig, &pub, &msg)); |
|||
secp256k1_ecdsa_sig_free(&sig); |
|||
secp256k1_num_free(&msg); |
|||
secp256k1_num_free(&key); |
|||
} |
|||
|
|||
void run_ecdsa_sign_verify() { |
|||
for (int i=0; i<10*count; i++) { |
|||
test_ecdsa_sign_verify(); |
|||
} |
|||
} |
|||
|
|||
#ifdef ENABLE_OPENSSL_TESTS |
|||
EC_KEY *get_openssl_key(const secp256k1_num_t *key) { |
|||
unsigned char privkey[300]; |
|||
int privkeylen; |
|||
int compr = secp256k1_rand32() & 1; |
|||
const unsigned char* pbegin = privkey; |
|||
EC_KEY *ec_key = EC_KEY_new_by_curve_name(NID_secp256k1); |
|||
assert(secp256k1_ecdsa_privkey_serialize(privkey, &privkeylen, key, compr)); |
|||
assert(d2i_ECPrivateKey(&ec_key, &pbegin, privkeylen)); |
|||
assert(EC_KEY_check_key(ec_key)); |
|||
return ec_key; |
|||
} |
|||
|
|||
void test_ecdsa_openssl() { |
|||
const secp256k1_ge_consts_t *c = secp256k1_ge_consts; |
|||
secp256k1_num_t key, msg; |
|||
secp256k1_num_init(&msg); |
|||
unsigned char message[32]; |
|||
secp256k1_rand256_test(message); |
|||
secp256k1_num_set_bin(&msg, message, 32); |
|||
secp256k1_num_init(&key); |
|||
random_num_order_test(&key); |
|||
secp256k1_gej_t qj; |
|||
secp256k1_ecmult_gen(&qj, &key); |
|||
secp256k1_ge_t q; |
|||
secp256k1_ge_set_gej(&q, &qj); |
|||
EC_KEY *ec_key = get_openssl_key(&key); |
|||
assert(ec_key); |
|||
unsigned char signature[80]; |
|||
int sigsize = 80; |
|||
assert(ECDSA_sign(0, message, sizeof(message), signature, &sigsize, ec_key)); |
|||
secp256k1_ecdsa_sig_t sig; |
|||
secp256k1_ecdsa_sig_init(&sig); |
|||
assert(secp256k1_ecdsa_sig_parse(&sig, signature, sigsize)); |
|||
assert(secp256k1_ecdsa_sig_verify(&sig, &q, &msg)); |
|||
secp256k1_num_inc(&sig.r); |
|||
assert(!secp256k1_ecdsa_sig_verify(&sig, &q, &msg)); |
|||
|
|||
random_sign(&sig, &key, &msg, NULL); |
|||
sigsize = 80; |
|||
assert(secp256k1_ecdsa_sig_serialize(signature, &sigsize, &sig)); |
|||
assert(ECDSA_verify(0, message, sizeof(message), signature, sigsize, ec_key) == 1); |
|||
|
|||
secp256k1_ecdsa_sig_free(&sig); |
|||
EC_KEY_free(ec_key); |
|||
secp256k1_num_free(&key); |
|||
secp256k1_num_free(&msg); |
|||
} |
|||
|
|||
void run_ecdsa_openssl() { |
|||
for (int i=0; i<10*count; i++) { |
|||
test_ecdsa_openssl(); |
|||
} |
|||
} |
|||
#endif |
|||
|
|||
int main(int argc, char **argv) { |
|||
if (argc > 1) |
|||
count = strtol(argv[1], NULL, 0)*47; |
|||
|
|||
printf("test count = %i\n", count); |
|||
|
|||
// initialize
|
|||
secp256k1_fe_start(); |
|||
secp256k1_ge_start(); |
|||
secp256k1_ecmult_start(); |
|||
|
|||
// num tests
|
|||
run_num_smalltests(); |
|||
|
|||
// ecmult tests
|
|||
run_wnaf(); |
|||
run_point_times_order(); |
|||
run_ecmult_chain(); |
|||
|
|||
// ecdsa tests
|
|||
run_ecdsa_sign_verify(); |
|||
#ifdef ENABLE_OPENSSL_TESTS |
|||
run_ecdsa_openssl(); |
|||
#endif |
|||
|
|||
// shutdown
|
|||
secp256k1_ecmult_stop(); |
|||
secp256k1_ge_stop(); |
|||
secp256k1_fe_stop(); |
|||
return 0; |
|||
} |
@ -0,0 +1,451 @@ |
|||
/*
|
|||
This file is part of cpp-ethereum. |
|||
|
|||
cpp-ethereum is free software: you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation, either version 3 of the License, or |
|||
(at your option) any later version. |
|||
|
|||
cpp-ethereum is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License |
|||
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
/** @file state.cpp
|
|||
* @author Gav Wood <i@gavwood.com> |
|||
* @date 2014 |
|||
* State test functions. |
|||
*/ |
|||
|
|||
#include <fstream> |
|||
#include "../json_spirit/json_spirit_reader_template.h" |
|||
#include "../json_spirit/json_spirit_writer_template.h" |
|||
#include <ExtVMFace.h> |
|||
#include <Transaction.h> |
|||
#include <VM.h> |
|||
#include <Instruction.h> |
|||
using namespace std; |
|||
using namespace json_spirit; |
|||
using namespace eth; |
|||
|
|||
namespace eth |
|||
{ |
|||
|
|||
class FakeExtVM: public ExtVMFace |
|||
{ |
|||
public: |
|||
FakeExtVM() |
|||
{} |
|||
FakeExtVM(FeeStructure const& _fees, BlockInfo const& _previousBlock, BlockInfo const& _currentBlock, uint _currentNumber): |
|||
ExtVMFace(Address(), Address(), 0, u256s(), _fees, _previousBlock, _currentBlock, _currentNumber) |
|||
{} |
|||
|
|||
u256 store(u256 _n) |
|||
{ |
|||
#ifdef __clang__ |
|||
tuple<u256, u256, u256, map<u256, u256> > & address = addresses[myAddress]; |
|||
map<u256, u256> & third = get<3>(address); |
|||
auto sFinder = third.find(_n); |
|||
if (sFinder != third.end()) |
|||
return sFinder->second; |
|||
else |
|||
return 0; |
|||
#else |
|||
return get<3>(addresses[myAddress])[_n]; |
|||
#endif |
|||
} |
|||
void setStore(u256 _n, u256 _v) |
|||
{ |
|||
#ifdef __clang__ |
|||
tuple<u256, u256, u256, map<u256, u256> > & address = addresses[myAddress]; |
|||
map<u256, u256> & third = get<3>(address); |
|||
auto sFinder = third.find(_n); |
|||
if (sFinder != third.end()) |
|||
sFinder->second = _v; |
|||
else |
|||
third.insert(std::make_pair(_n, _v)); |
|||
#else |
|||
get<3>(addresses[myAddress])[_n] = _v; |
|||
#endif |
|||
} |
|||
void mktx(Transaction& _t) |
|||
{ |
|||
if (get<0>(addresses[myAddress]) >= _t.value) |
|||
{ |
|||
get<0>(addresses[myAddress]) -= _t.value; |
|||
get<1>(addresses[myAddress])++; |
|||
// get<0>(addresses[_t.receiveAddress]) += _t.value;
|
|||
txs.push_back(_t); |
|||
} |
|||
} |
|||
u256 balance(Address _a) { return get<0>(addresses[_a]); } |
|||
void payFee(bigint _fee) { get<0>(addresses[myAddress]) = (u256)(get<0>(addresses[myAddress]) - _fee); } |
|||
u256 txCount(Address _a) { return get<1>(addresses[_a]); } |
|||
u256 extro(Address _a, u256 _pos) |
|||
{ |
|||
#ifdef __clang__ |
|||
tuple<u256, u256, u256, map<u256, u256> > & address = addresses[_a]; |
|||
map<u256, u256> & third = get<3>(address); |
|||
auto sFinder = third.find(_pos); |
|||
if (sFinder != third.end()) |
|||
return sFinder->second; |
|||
else |
|||
return 0; |
|||
#else |
|||
return get<3>(addresses[_a])[_pos]; |
|||
#endif |
|||
} |
|||
u256 extroPrice(Address _a) { return get<2>(addresses[_a]); } |
|||
void suicide(Address _a) |
|||
{ |
|||
for (auto const& i: get<3>(addresses[myAddress])) |
|||
if (i.second) |
|||
get<0>(addresses[_a]) += fees.m_memoryFee; |
|||
get<0>(addresses[_a]) += get<0>(addresses[myAddress]); |
|||
addresses.erase(myAddress); |
|||
} |
|||
|
|||
void setTransaction(Address _txSender, u256 _txValue, u256s const& _txData) |
|||
{ |
|||
txSender = _txSender; |
|||
txValue = _txValue; |
|||
txData = _txData; |
|||
} |
|||
void setContract(Address _myAddress, u256 _myBalance, u256 _myNonce, u256s _myData) |
|||
{ |
|||
myAddress = _myAddress; |
|||
set(myAddress, _myBalance, _myNonce, _myData); |
|||
} |
|||
void set(Address _a, u256 _myBalance, u256 _myNonce, u256s _myData) |
|||
{ |
|||
get<0>(addresses[_a]) = _myBalance; |
|||
get<1>(addresses[_a]) = _myNonce; |
|||
get<2>(addresses[_a]) = 0; |
|||
for (unsigned i = 0; i < _myData.size(); ++i) |
|||
#ifdef __clang__ |
|||
{ |
|||
tuple<u256, u256, u256, map<u256, u256> > & address = addresses[_a]; |
|||
map<u256, u256> & third = get<3>(address); |
|||
auto sFinder = third.find(i); |
|||
if (sFinder != third.end()) |
|||
sFinder->second = _myData[i]; |
|||
else |
|||
third.insert(std::make_pair(i, _myData[i])); |
|||
} |
|||
#else |
|||
get<3>(addresses[_a])[i] = _myData[i]; |
|||
#endif |
|||
} |
|||
|
|||
mObject exportEnv() |
|||
{ |
|||
mObject ret; |
|||
ret["previousHash"] = toString(previousBlock.hash); |
|||
ret["previousNonce"] = toString(previousBlock.nonce); |
|||
push(ret, "currentDifficulty", currentBlock.difficulty); |
|||
push(ret, "currentTimestamp", currentBlock.timestamp); |
|||
ret["currentCoinbase"] = toString(currentBlock.coinbaseAddress); |
|||
push(ret, "feeMultiplier", fees.multiplier()); |
|||
return ret; |
|||
} |
|||
|
|||
void importEnv(mObject& _o) |
|||
{ |
|||
previousBlock.hash = h256(_o["previousHash"].get_str()); |
|||
previousBlock.nonce = h256(_o["previousNonce"].get_str()); |
|||
currentBlock.difficulty = toInt(_o["currentDifficulty"]); |
|||
currentBlock.timestamp = toInt(_o["currentTimestamp"]); |
|||
currentBlock.coinbaseAddress = Address(_o["currentCoinbase"].get_str()); |
|||
fees.setMultiplier(toInt(_o["feeMultiplier"])); |
|||
} |
|||
|
|||
static u256 toInt(mValue const& _v) |
|||
{ |
|||
switch (_v.type()) |
|||
{ |
|||
case str_type: return u256(_v.get_str()); |
|||
case int_type: return (u256)_v.get_uint64(); |
|||
case bool_type: return (u256)(uint64_t)_v.get_bool(); |
|||
case real_type: return (u256)(uint64_t)_v.get_real(); |
|||
default: cwarn << "Bad type for scalar: " << _v.type(); |
|||
} |
|||
return 0; |
|||
} |
|||
|
|||
static void push(mObject& o, string const& _n, u256 _v) |
|||
{ |
|||
if (_v < (u256)1 << 64) |
|||
o[_n] = (uint64_t)_v; |
|||
else |
|||
o[_n] = toString(_v); |
|||
} |
|||
|
|||
static void push(mArray& a, u256 _v) |
|||
{ |
|||
if (_v < (u256)1 << 64) |
|||
a.push_back((uint64_t)_v); |
|||
else |
|||
a.push_back(toString(_v)); |
|||
} |
|||
|
|||
mObject exportState() |
|||
{ |
|||
mObject ret; |
|||
for (auto const& a: addresses) |
|||
{ |
|||
mObject o; |
|||
push(o, "balance", get<0>(a.second)); |
|||
push(o, "nonce", get<1>(a.second)); |
|||
push(o, "extroPrice", get<2>(a.second)); |
|||
|
|||
mObject store; |
|||
string curKey; |
|||
u256 li = 0; |
|||
mArray curVal; |
|||
for (auto const& s: get<3>(a.second)) |
|||
{ |
|||
if (!li || s.first > li + 8) |
|||
{ |
|||
if (li) |
|||
store[curKey] = curVal; |
|||
li = s.first; |
|||
curKey = toString(li); |
|||
curVal = mArray(); |
|||
} |
|||
else |
|||
for (; li != s.first; ++li) |
|||
curVal.push_back(0); |
|||
push(curVal, s.second); |
|||
++li; |
|||
} |
|||
if (li) |
|||
{ |
|||
store[curKey] = curVal; |
|||
o["store"] = store; |
|||
} |
|||
ret[toString(a.first)] = o; |
|||
} |
|||
return ret; |
|||
} |
|||
|
|||
void importState(mObject& _o) |
|||
{ |
|||
for (auto const& i: _o) |
|||
{ |
|||
mObject o = i.second.get_obj(); |
|||
auto& a = addresses[Address(i.first)]; |
|||
get<0>(a) = toInt(o["balance"]); |
|||
get<1>(a) = toInt(o["nonce"]); |
|||
get<2>(a) = toInt(o["extroPrice"]); |
|||
if (o.count("store")) |
|||
for (auto const& j: o["store"].get_obj()) |
|||
{ |
|||
u256 adr(j.first); |
|||
for (auto const& k: j.second.get_array()) |
|||
#ifdef __clang__ |
|||
{ |
|||
map<u256, u256> & third = get<3>(a); |
|||
auto sFinder = third.find(adr); |
|||
if (sFinder != third.end()) |
|||
sFinder->second = toInt(k); |
|||
else |
|||
third.insert(std::make_pair(adr, toInt(k))); |
|||
adr++; |
|||
} |
|||
#else |
|||
get<3>(a)[adr++] = toInt(k); |
|||
#endif |
|||
} |
|||
if (o.count("code")) |
|||
{ |
|||
u256s d = compileLisp(o["code"].get_str()); |
|||
for (unsigned i = 0; i < d.size(); ++i) |
|||
#ifdef __clang__ |
|||
{ |
|||
map<u256, u256> & third = get<3>(a); |
|||
auto sFinder = third.find(i); |
|||
if (sFinder != third.end()) |
|||
sFinder->second = d[i]; |
|||
else |
|||
third.insert(std::make_pair(i, d[i])); |
|||
} |
|||
#else |
|||
get<3>(a)[(u256)i] = d[i]; |
|||
#endif |
|||
} |
|||
} |
|||
} |
|||
|
|||
mObject exportExec() |
|||
{ |
|||
mObject ret; |
|||
ret["address"] = toString(myAddress); |
|||
ret["sender"] = toString(txSender); |
|||
push(ret, "value", txValue); |
|||
mArray d; |
|||
for (auto const& i: txData) |
|||
push(d, i); |
|||
ret["data"] = d; |
|||
return ret; |
|||
} |
|||
|
|||
void importExec(mObject& _o) |
|||
{ |
|||
myAddress = Address(_o["address"].get_str()); |
|||
txSender = Address(_o["sender"].get_str()); |
|||
txValue = toInt(_o["value"]); |
|||
for (auto const& j: _o["data"].get_array()) |
|||
txData.push_back(toInt(j)); |
|||
} |
|||
|
|||
mArray exportTxs() |
|||
{ |
|||
mArray ret; |
|||
for (Transaction const& tx: txs) |
|||
{ |
|||
mObject o; |
|||
o["destination"] = toString(tx.receiveAddress); |
|||
push(o, "value", tx.value); |
|||
mArray d; |
|||
for (auto const& i: tx.data) |
|||
push(d, i); |
|||
o["data"] = d; |
|||
ret.push_back(o); |
|||
} |
|||
return ret; |
|||
} |
|||
|
|||
void importTxs(mArray& _txs) |
|||
{ |
|||
for (mValue& v: _txs) |
|||
{ |
|||
auto tx = v.get_obj(); |
|||
Transaction t; |
|||
t.receiveAddress = Address(tx["destination"].get_str()); |
|||
t.value = toInt(tx["value"]); |
|||
for (auto const& j: tx["data"].get_array()) |
|||
t.data.push_back(toInt(j)); |
|||
txs.push_back(t); |
|||
} |
|||
} |
|||
|
|||
void reset(u256 _myBalance, u256 _myNonce, u256s _myData) |
|||
{ |
|||
txs.clear(); |
|||
addresses.clear(); |
|||
set(myAddress, _myBalance, _myNonce, _myData); |
|||
} |
|||
|
|||
map<Address, tuple<u256, u256, u256, map<u256, u256>>> addresses; |
|||
Transactions txs; |
|||
}; |
|||
|
|||
#define CREATE_TESTS 0 |
|||
|
|||
template <> class UnitTest<1> |
|||
{ |
|||
public: |
|||
int operator()() |
|||
{ |
|||
json_spirit::mValue v; |
|||
#if CREATE_TESTS |
|||
string s = asString(contents("../../cpp-ethereum/test/vmtests.json")); |
|||
json_spirit::read_string(s, v); |
|||
bool passed = doTests(v, true); |
|||
cout << json_spirit::write_string(v, true) << endl; |
|||
#else |
|||
string s = asString(contents("../../tests/vmtests.json")); |
|||
json_spirit::read_string(s, v); |
|||
bool passed = doTests(v, false); |
|||
#endif |
|||
return passed ? 0 : 1; |
|||
} |
|||
|
|||
bool doTests(json_spirit::mValue& v, bool _fillin) |
|||
{ |
|||
bool passed = true; |
|||
for (auto& i: v.get_obj()) |
|||
{ |
|||
cnote << i.first; |
|||
mObject& o = i.second.get_obj(); |
|||
|
|||
VM vm; |
|||
FakeExtVM fev; |
|||
fev.importEnv(o["env"].get_obj()); |
|||
fev.importState(o["pre"].get_obj()); |
|||
|
|||
if (_fillin) |
|||
o["pre"] = mValue(fev.exportState()); |
|||
|
|||
for (auto i: o["exec"].get_array()) |
|||
{ |
|||
fev.importExec(i.get_obj()); |
|||
vm.go(fev); |
|||
} |
|||
if (_fillin) |
|||
{ |
|||
o["post"] = mValue(fev.exportState()); |
|||
o["txs"] = fev.exportTxs(); |
|||
} |
|||
else |
|||
{ |
|||
FakeExtVM test; |
|||
test.importState(o["post"].get_obj()); |
|||
test.importTxs(o["txs"].get_array()); |
|||
if (test.addresses != fev.addresses) |
|||
{ |
|||
cwarn << "Test failed: state different."; |
|||
passed = false; |
|||
} |
|||
if (test.txs != fev.txs) |
|||
{ |
|||
cwarn << "Test failed: tx list different:"; |
|||
cwarn << test.txs; |
|||
cwarn << fev.txs; |
|||
passed = false; |
|||
} |
|||
} |
|||
} |
|||
return passed; |
|||
} |
|||
|
|||
string makeTestCase() |
|||
{ |
|||
json_spirit::mObject o; |
|||
|
|||
VM vm; |
|||
BlockInfo pb; |
|||
pb.hash = sha3("previousHash"); |
|||
pb.nonce = sha3("previousNonce"); |
|||
BlockInfo cb = pb; |
|||
cb.difficulty = 256; |
|||
cb.timestamp = 1; |
|||
cb.coinbaseAddress = toAddress(sha3("coinbase")); |
|||
FeeStructure fees; |
|||
fees.setMultiplier(1); |
|||
FakeExtVM fev(fees, pb, cb, 0); |
|||
fev.setContract(toAddress(sha3("contract")), ether, 0, compileLisp("(suicide (txsender))")); |
|||
o["env"] = fev.exportEnv(); |
|||
o["pre"] = fev.exportState(); |
|||
fev.setTransaction(toAddress(sha3("sender")), ether, u256s()); |
|||
mArray execs; |
|||
execs.push_back(fev.exportExec()); |
|||
o["exec"] = execs; |
|||
vm.go(fev); |
|||
o["post"] = fev.exportState(); |
|||
o["txs"] = fev.exportTxs(); |
|||
|
|||
return json_spirit::write_string(json_spirit::mValue(o), true); |
|||
} |
|||
}; |
|||
|
|||
} |
|||
|
|||
int vmTest() |
|||
{ |
|||
return UnitTest<1>()(); |
|||
} |
|||
|
@ -0,0 +1,84 @@ |
|||
{ |
|||
"suicide": { |
|||
"env" : { |
|||
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", |
|||
"previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae", |
|||
"currentDifficulty" : "256", |
|||
"currentTimestamp" : 1, |
|||
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", |
|||
"feeMultiplier" : 1 |
|||
}, |
|||
"pre" : { |
|||
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { |
|||
"balance" : 1000000000000000000, |
|||
"nonce" : 0, |
|||
"code" : "(suicide (txsender))" |
|||
} |
|||
}, |
|||
"exec" : [ |
|||
{ |
|||
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", |
|||
"sender" : "cd1722f3947def4cf144679da39c4c32bdc35681", |
|||
"value" : 1000000000000000000, |
|||
"data" : [ |
|||
] |
|||
} |
|||
] |
|||
}, |
|||
|
|||
"mktx": { |
|||
"env" : { |
|||
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", |
|||
"previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae", |
|||
"currentDifficulty" : "256", |
|||
"currentTimestamp" : 1, |
|||
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", |
|||
"feeMultiplier" : 1 |
|||
}, |
|||
"pre" : { |
|||
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { |
|||
"balance" : 1000000000000000000, |
|||
"nonce" : 0, |
|||
"code" : "(mktx (txsender) 500000000000000000 0)" |
|||
} |
|||
}, |
|||
"exec" : [ |
|||
{ |
|||
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", |
|||
"sender" : "cd1722f3947def4cf144679da39c4c32bdc35681", |
|||
"value" : 1000000000000000000, |
|||
"data" : [ |
|||
] |
|||
} |
|||
] |
|||
}, |
|||
|
|||
"fan": { |
|||
"env" : { |
|||
"previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", |
|||
"previousNonce" : "9c9c6567b5ec0c5f3f25df79be42707090f1e62e9db84cbb556ae2a2f6ccccae", |
|||
"currentDifficulty" : "256", |
|||
"currentTimestamp" : 1, |
|||
"currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", |
|||
"feeMultiplier" : 1 |
|||
}, |
|||
"pre" : { |
|||
"0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { |
|||
"balance" : 0, |
|||
"nonce" : 0, |
|||
"code" : "(seq (unless (gt (txvalue) 100finney) (stop)) (\"value\" (div (sub (txvalue) 100finney) (txdatan))) (\"i\" 0) (for (lt (\"i\") (txdatan)) (seq (mktx (txdata (\"i\")) (\"value\") 0) (\"i\" (add (\"i\") 1)) ) ) )" |
|||
} |
|||
}, |
|||
"exec" : [ |
|||
{ |
|||
"address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", |
|||
"sender" : "cd1722f3947def4cf144679da39c4c32bdc35681", |
|||
"value" : 1000000000000000000, |
|||
"data" : [ |
|||
"0xcd1722f3947def4cf144679da39c4c32bdc35681", |
|||
"0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" |
|||
] |
|||
} |
|||
] |
|||
} |
|||
} |
@ -0,0 +1,212 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup Label="ProjectConfigurations"> |
|||
<ProjectConfiguration Include="Debug|Win32"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Debug|x64"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>x64</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|Win32"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|x64"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>x64</Platform> |
|||
</ProjectConfiguration> |
|||
</ItemGroup> |
|||
<PropertyGroup Label="Globals"> |
|||
<Keyword>Win32Proj</Keyword> |
|||
<RootNamespace>AlethZero</RootNamespace> |
|||
<ProjectName>AlethZero</ProjectName> |
|||
<ProjectGuid>{BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}</ProjectGuid> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
|||
<ConfigurationType>Application</ConfigurationType> |
|||
<UseDebugLibraries>true</UseDebugLibraries> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> |
|||
<ConfigurationType>Application</ConfigurationType> |
|||
<UseDebugLibraries>true</UseDebugLibraries> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
|||
<ConfigurationType>Application</ConfigurationType> |
|||
<UseDebugLibraries>false</UseDebugLibraries> |
|||
<WholeProgramOptimization>true</WholeProgramOptimization> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> |
|||
<ConfigurationType>Application</ConfigurationType> |
|||
<UseDebugLibraries>false</UseDebugLibraries> |
|||
<WholeProgramOptimization>true</WholeProgramOptimization> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
|||
<ImportGroup Label="ExtensionSettings"> |
|||
</ImportGroup> |
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
<Import Project="UseQt.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
<Import Project="UseQt.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
<Import Project="CopyBinary.props" /> |
|||
<Import Project="UseQt.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
<Import Project="CopyBinary.props" /> |
|||
<Import Project="UseQt.props" /> |
|||
</ImportGroup> |
|||
<PropertyGroup Label="UserMacros" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<LinkIncremental>true</LinkIncremental> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<LinkIncremental>false</LinkIncremental> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
|||
<LinkIncremental>false</LinkIncremental> |
|||
</PropertyGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<ClCompile> |
|||
<PrecompiledHeader>Use</PrecompiledHeader> |
|||
<Optimization>Disabled</Optimization> |
|||
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Windows</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<LargeAddressAware>true</LargeAddressAware> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
|||
<ClCompile> |
|||
<PrecompiledHeader>Use</PrecompiledHeader> |
|||
<Optimization>Disabled</Optimization> |
|||
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Windows</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<ClCompile> |
|||
<PrecompiledHeader>Use</PrecompiledHeader> |
|||
<Optimization>MaxSpeed</Optimization> |
|||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
|||
<StringPooling>true</StringPooling> |
|||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> |
|||
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Windows</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
|||
<OptimizeReferences>true</OptimizeReferences> |
|||
<LargeAddressAware>true</LargeAddressAware> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
|||
<ClCompile> |
|||
<PrecompiledHeader>Use</PrecompiledHeader> |
|||
<Optimization>MaxSpeed</Optimization> |
|||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
|||
<StringPooling>true</StringPooling> |
|||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> |
|||
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Windows</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
|||
<OptimizeReferences>true</OptimizeReferences> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemGroup> |
|||
<ProjectReference Include="..\windows\LibEthereum.vcxproj"> |
|||
<Project>{826e68cb-d3ee-4a8a-b540-59a8c3f38d4f}</Project> |
|||
</ProjectReference> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="..\alethzero\main.cpp" /> |
|||
<ClCompile Include="..\alethzero\MainWin.cpp" /> |
|||
<ClCompile Include="qt_plugin_import.cpp" /> |
|||
<ClCompile Include="stdafx.cpp"> |
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> |
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> |
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader> |
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader> |
|||
</ClCompile> |
|||
<ClCompile Include="WinMain.cpp" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<CustomBuild Include="..\alethzero\MainWin.h"> |
|||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">"$(Lua)" moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)"</Command> |
|||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)moc_%(FileName).cpp</Outputs> |
|||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
|||
</Message> |
|||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(Lua)" moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)"</Command> |
|||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
</Message> |
|||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(Lua)" moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)"</Command> |
|||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
</Message> |
|||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">"$(Lua)" moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)"</Command> |
|||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
|||
</Message> |
|||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)moc_%(FileName).cpp</Outputs> |
|||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)moc_%(FileName).cpp</Outputs> |
|||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)moc_%(FileName).cpp</Outputs> |
|||
</CustomBuild> |
|||
<ClInclude Include="stdafx.h" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<CustomBuild Include="..\alethzero\Main.ui"> |
|||
<FileType>Document</FileType> |
|||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)"</Command> |
|||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)"</Message> |
|||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)ui_%(FileName).h</Outputs> |
|||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)"</Command> |
|||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)"</Message> |
|||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)ui_%(FileName).h</Outputs> |
|||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">"$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)"</Command> |
|||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">"$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)"</Message> |
|||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)ui_%(FileName).h</Outputs> |
|||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">"$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)"</Command> |
|||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">"$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)"</Message> |
|||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)ui_%(FileName).h</Outputs> |
|||
</CustomBuild> |
|||
</ItemGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
|||
<ImportGroup Label="ExtensionTargets"> |
|||
</ImportGroup> |
|||
</Project> |
@ -0,0 +1,28 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup> |
|||
<ClCompile Include="..\alethzero\main.cpp" /> |
|||
<ClCompile Include="..\alethzero\MainWin.cpp" /> |
|||
<ClCompile Include="stdafx.cpp"> |
|||
<Filter>Windows</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="WinMain.cpp"> |
|||
<Filter>Windows</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="qt_plugin_import.cpp" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClInclude Include="stdafx.h"> |
|||
<Filter>Windows</Filter> |
|||
</ClInclude> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Filter Include="Windows"> |
|||
<UniqueIdentifier>{049fb46c-1677-45cb-95ae-3a2d9e3090be}</UniqueIdentifier> |
|||
</Filter> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<CustomBuild Include="..\alethzero\MainWin.h" /> |
|||
<CustomBuild Include="..\alethzero\Main.ui" /> |
|||
</ItemGroup> |
|||
</Project> |
@ -0,0 +1,18 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ImportGroup Label="PropertySheets" /> |
|||
<PropertyGroup Label="UserMacros" /> |
|||
<PropertyGroup /> |
|||
<ItemDefinitionGroup> |
|||
<PostBuildEvent> |
|||
<Command>xcopy /F /Y $(OutDir)$(TargetName)$(TargetExt) ..\..\_binaries\$(Platform)\</Command> |
|||
</PostBuildEvent> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup> |
|||
<PostBuildEvent> |
|||
<Message> |
|||
</Message> |
|||
</PostBuildEvent> |
|||
</ItemDefinitionGroup> |
|||
<ItemGroup /> |
|||
</Project> |
@ -0,0 +1,121 @@ |
|||
|
|||
Microsoft Visual Studio Solution File, Format Version 12.00 |
|||
# Visual Studio Express 2013 for Windows Desktop |
|||
VisualStudioVersion = 12.0.21005.1 |
|||
MinimumVisualStudioVersion = 10.0.40219.1 |
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libs", "Libs", "{988F2383-FA1D-408B-BCF6-C0EE7AB0A560}" |
|||
EndProject |
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{6838FA95-01BF-4FF7-914C-FC209B81406E}" |
|||
EndProject |
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibEthereum", "LibEthereum.vcxproj", "{826E68CB-D3EE-4A8A-B540-59A8C3F38D4F}" |
|||
EndProject |
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibLevelDB", "LibLevelDB.vcxproj", "{27014763-955D-486B-9BA7-69872192E6F4}" |
|||
EndProject |
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibSecp256k1", "LibSecp256k1.vcxproj", "{1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA}" |
|||
EndProject |
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Ethereum", "Ethereum.vcxproj", "{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}" |
|||
EndProject |
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestSecp256k1", "TestSecp256k1.vcxproj", "{3BF049F8-AF7E-4E1C-9627-3E94C887AF24}" |
|||
EndProject |
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestEthereum", "TestEthereum.vcxproj", "{3F3E389B-88DE-41D5-A73B-4F6036E18B36}" |
|||
EndProject |
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibCryptoPP", "LibCryptoPP.vcxproj", "{1CC213A4-3482-4211-B47B-172E90DAC7DE}" |
|||
EndProject |
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibMiniUPnPc", "LibMiniUPnPc.vcxproj", "{1B1CA20E-39C3-4D9B-AC37-3783048E6672}" |
|||
EndProject |
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Alethzero", "Alethzero.vcxproj", "{BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}" |
|||
EndProject |
|||
Global |
|||
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
|||
Debug|Win32 = Debug|Win32 |
|||
Debug|x64 = Debug|x64 |
|||
Release|Win32 = Release|Win32 |
|||
Release|x64 = Release|x64 |
|||
EndGlobalSection |
|||
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
|||
{826E68CB-D3EE-4A8A-B540-59A8C3F38D4F}.Debug|Win32.ActiveCfg = Debug|Win32 |
|||
{826E68CB-D3EE-4A8A-B540-59A8C3F38D4F}.Debug|Win32.Build.0 = Debug|Win32 |
|||
{826E68CB-D3EE-4A8A-B540-59A8C3F38D4F}.Debug|x64.ActiveCfg = Debug|x64 |
|||
{826E68CB-D3EE-4A8A-B540-59A8C3F38D4F}.Debug|x64.Build.0 = Debug|x64 |
|||
{826E68CB-D3EE-4A8A-B540-59A8C3F38D4F}.Release|Win32.ActiveCfg = Release|Win32 |
|||
{826E68CB-D3EE-4A8A-B540-59A8C3F38D4F}.Release|Win32.Build.0 = Release|Win32 |
|||
{826E68CB-D3EE-4A8A-B540-59A8C3F38D4F}.Release|x64.ActiveCfg = Release|x64 |
|||
{826E68CB-D3EE-4A8A-B540-59A8C3F38D4F}.Release|x64.Build.0 = Release|x64 |
|||
{27014763-955D-486B-9BA7-69872192E6F4}.Debug|Win32.ActiveCfg = Debug|Win32 |
|||
{27014763-955D-486B-9BA7-69872192E6F4}.Debug|Win32.Build.0 = Debug|Win32 |
|||
{27014763-955D-486B-9BA7-69872192E6F4}.Debug|x64.ActiveCfg = Debug|x64 |
|||
{27014763-955D-486B-9BA7-69872192E6F4}.Debug|x64.Build.0 = Debug|x64 |
|||
{27014763-955D-486B-9BA7-69872192E6F4}.Release|Win32.ActiveCfg = Release|Win32 |
|||
{27014763-955D-486B-9BA7-69872192E6F4}.Release|Win32.Build.0 = Release|Win32 |
|||
{27014763-955D-486B-9BA7-69872192E6F4}.Release|x64.ActiveCfg = Release|x64 |
|||
{27014763-955D-486B-9BA7-69872192E6F4}.Release|x64.Build.0 = Release|x64 |
|||
{1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA}.Debug|Win32.ActiveCfg = Debug|Win32 |
|||
{1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA}.Debug|Win32.Build.0 = Debug|Win32 |
|||
{1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA}.Debug|x64.ActiveCfg = Debug|x64 |
|||
{1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA}.Debug|x64.Build.0 = Debug|x64 |
|||
{1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA}.Release|Win32.ActiveCfg = Release|Win32 |
|||
{1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA}.Release|Win32.Build.0 = Release|Win32 |
|||
{1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA}.Release|x64.ActiveCfg = Release|x64 |
|||
{1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA}.Release|x64.Build.0 = Release|x64 |
|||
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Debug|Win32.ActiveCfg = Debug|Win32 |
|||
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Debug|Win32.Build.0 = Debug|Win32 |
|||
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Debug|x64.ActiveCfg = Debug|x64 |
|||
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Debug|x64.Build.0 = Debug|x64 |
|||
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Release|Win32.ActiveCfg = Release|Win32 |
|||
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Release|Win32.Build.0 = Release|Win32 |
|||
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Release|x64.ActiveCfg = Release|x64 |
|||
{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Release|x64.Build.0 = Release|x64 |
|||
{3BF049F8-AF7E-4E1C-9627-3E94C887AF24}.Debug|Win32.ActiveCfg = Debug|Win32 |
|||
{3BF049F8-AF7E-4E1C-9627-3E94C887AF24}.Debug|Win32.Build.0 = Debug|Win32 |
|||
{3BF049F8-AF7E-4E1C-9627-3E94C887AF24}.Debug|x64.ActiveCfg = Debug|x64 |
|||
{3BF049F8-AF7E-4E1C-9627-3E94C887AF24}.Debug|x64.Build.0 = Debug|x64 |
|||
{3BF049F8-AF7E-4E1C-9627-3E94C887AF24}.Release|Win32.ActiveCfg = Release|Win32 |
|||
{3BF049F8-AF7E-4E1C-9627-3E94C887AF24}.Release|Win32.Build.0 = Release|Win32 |
|||
{3BF049F8-AF7E-4E1C-9627-3E94C887AF24}.Release|x64.ActiveCfg = Release|x64 |
|||
{3BF049F8-AF7E-4E1C-9627-3E94C887AF24}.Release|x64.Build.0 = Release|x64 |
|||
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Debug|Win32.ActiveCfg = Debug|Win32 |
|||
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Debug|Win32.Build.0 = Debug|Win32 |
|||
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Debug|x64.ActiveCfg = Debug|x64 |
|||
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Debug|x64.Build.0 = Debug|x64 |
|||
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Release|Win32.ActiveCfg = Release|Win32 |
|||
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Release|Win32.Build.0 = Release|Win32 |
|||
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Release|x64.ActiveCfg = Release|x64 |
|||
{3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Release|x64.Build.0 = Release|x64 |
|||
{1CC213A4-3482-4211-B47B-172E90DAC7DE}.Debug|Win32.ActiveCfg = Debug|Win32 |
|||
{1CC213A4-3482-4211-B47B-172E90DAC7DE}.Debug|Win32.Build.0 = Debug|Win32 |
|||
{1CC213A4-3482-4211-B47B-172E90DAC7DE}.Debug|x64.ActiveCfg = Debug|x64 |
|||
{1CC213A4-3482-4211-B47B-172E90DAC7DE}.Debug|x64.Build.0 = Debug|x64 |
|||
{1CC213A4-3482-4211-B47B-172E90DAC7DE}.Release|Win32.ActiveCfg = Release|Win32 |
|||
{1CC213A4-3482-4211-B47B-172E90DAC7DE}.Release|Win32.Build.0 = Release|Win32 |
|||
{1CC213A4-3482-4211-B47B-172E90DAC7DE}.Release|x64.ActiveCfg = Release|x64 |
|||
{1CC213A4-3482-4211-B47B-172E90DAC7DE}.Release|x64.Build.0 = Release|x64 |
|||
{1B1CA20E-39C3-4D9B-AC37-3783048E6672}.Debug|Win32.ActiveCfg = Debug|Win32 |
|||
{1B1CA20E-39C3-4D9B-AC37-3783048E6672}.Debug|Win32.Build.0 = Debug|Win32 |
|||
{1B1CA20E-39C3-4D9B-AC37-3783048E6672}.Debug|x64.ActiveCfg = Debug|x64 |
|||
{1B1CA20E-39C3-4D9B-AC37-3783048E6672}.Debug|x64.Build.0 = Debug|x64 |
|||
{1B1CA20E-39C3-4D9B-AC37-3783048E6672}.Release|Win32.ActiveCfg = Release|Win32 |
|||
{1B1CA20E-39C3-4D9B-AC37-3783048E6672}.Release|Win32.Build.0 = Release|Win32 |
|||
{1B1CA20E-39C3-4D9B-AC37-3783048E6672}.Release|x64.ActiveCfg = Release|x64 |
|||
{1B1CA20E-39C3-4D9B-AC37-3783048E6672}.Release|x64.Build.0 = Release|x64 |
|||
{BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}.Debug|Win32.ActiveCfg = Debug|Win32 |
|||
{BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}.Debug|Win32.Build.0 = Debug|Win32 |
|||
{BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}.Debug|x64.ActiveCfg = Debug|x64 |
|||
{BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}.Debug|x64.Build.0 = Debug|x64 |
|||
{BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}.Release|Win32.ActiveCfg = Release|Win32 |
|||
{BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}.Release|Win32.Build.0 = Release|Win32 |
|||
{BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}.Release|x64.ActiveCfg = Release|x64 |
|||
{BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}.Release|x64.Build.0 = Release|x64 |
|||
EndGlobalSection |
|||
GlobalSection(SolutionProperties) = preSolution |
|||
HideSolutionNode = FALSE |
|||
EndGlobalSection |
|||
GlobalSection(NestedProjects) = preSolution |
|||
{826E68CB-D3EE-4A8A-B540-59A8C3F38D4F} = {988F2383-FA1D-408B-BCF6-C0EE7AB0A560} |
|||
{27014763-955D-486B-9BA7-69872192E6F4} = {988F2383-FA1D-408B-BCF6-C0EE7AB0A560} |
|||
{1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA} = {988F2383-FA1D-408B-BCF6-C0EE7AB0A560} |
|||
{1CC213A4-3482-4211-B47B-172E90DAC7DE} = {988F2383-FA1D-408B-BCF6-C0EE7AB0A560} |
|||
{1B1CA20E-39C3-4D9B-AC37-3783048E6672} = {988F2383-FA1D-408B-BCF6-C0EE7AB0A560} |
|||
{3BF049F8-AF7E-4E1C-9627-3E94C887AF24} = {6838FA95-01BF-4FF7-914C-FC209B81406E} |
|||
{3F3E389B-88DE-41D5-A73B-4F6036E18B36} = {6838FA95-01BF-4FF7-914C-FC209B81406E} |
|||
EndGlobalSection |
|||
EndGlobal |
@ -0,0 +1,176 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup Label="ProjectConfigurations"> |
|||
<ProjectConfiguration Include="Debug|Win32"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Debug|x64"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>x64</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|Win32"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|x64"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>x64</Platform> |
|||
</ProjectConfiguration> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="..\..\cryptopp\algparam.cpp" /> |
|||
<ClCompile Include="..\..\cryptopp\cpu.cpp" /> |
|||
<ClCompile Include="..\..\cryptopp\cryptlib.cpp" /> |
|||
<ClCompile Include="..\..\cryptopp\filters.cpp" /> |
|||
<ClCompile Include="..\..\cryptopp\fips140.cpp" /> |
|||
<ClCompile Include="..\..\cryptopp\iterhash.cpp" /> |
|||
<ClCompile Include="..\..\cryptopp\misc.cpp" /> |
|||
<ClCompile Include="..\..\cryptopp\mqueue.cpp" /> |
|||
<ClCompile Include="..\..\cryptopp\queue.cpp" /> |
|||
<ClCompile Include="..\..\cryptopp\rdtables.cpp" /> |
|||
<ClCompile Include="..\..\cryptopp\rijndael.cpp" /> |
|||
<ClCompile Include="..\..\cryptopp\ripemd.cpp" /> |
|||
<ClCompile Include="..\..\cryptopp\sha.cpp" /> |
|||
<ClCompile Include="..\..\cryptopp\sha3.cpp" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClInclude Include="..\..\cryptopp\algparam.h" /> |
|||
<ClInclude Include="..\..\cryptopp\cpu.h" /> |
|||
<ClInclude Include="..\..\cryptopp\cryptlib.h" /> |
|||
<ClInclude Include="..\..\cryptopp\filters.h" /> |
|||
<ClInclude Include="..\..\cryptopp\fips140.h" /> |
|||
<ClInclude Include="..\..\cryptopp\iterhash.h" /> |
|||
<ClInclude Include="..\..\cryptopp\misc.h" /> |
|||
<ClInclude Include="..\..\cryptopp\mqueue.h" /> |
|||
<ClInclude Include="..\..\cryptopp\queue.h" /> |
|||
<ClInclude Include="..\..\cryptopp\rijndael.h" /> |
|||
<ClInclude Include="..\..\cryptopp\ripemd.h" /> |
|||
<ClInclude Include="..\..\cryptopp\sha.h" /> |
|||
<ClInclude Include="..\..\cryptopp\sha3.h" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<CustomBuild Include="..\..\cryptopp\x64dll.asm"> |
|||
<FileType>Document</FileType> |
|||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ml64.exe /c /nologo /Fo"$(IntDir)x64dll.obj" /Zi "%(FullPath)"</Command> |
|||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ml64.exe /c /nologo /Fo"$(IntDir)x64dll.obj" /Zi "%(FullPath)"</Command> |
|||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)x64dll.obj</Outputs> |
|||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)x64dll.obj</Outputs> |
|||
</CustomBuild> |
|||
</ItemGroup> |
|||
<PropertyGroup Label="Globals"> |
|||
<Keyword>Win32Proj</Keyword> |
|||
<RootNamespace>LibCryptoPP</RootNamespace> |
|||
<ProjectGuid>{1CC213A4-3482-4211-B47B-172E90DAC7DE}</ProjectGuid> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
|||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|||
<UseDebugLibraries>true</UseDebugLibraries> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> |
|||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|||
<UseDebugLibraries>true</UseDebugLibraries> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
|||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|||
<UseDebugLibraries>false</UseDebugLibraries> |
|||
<WholeProgramOptimization>true</WholeProgramOptimization> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> |
|||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|||
<UseDebugLibraries>false</UseDebugLibraries> |
|||
<WholeProgramOptimization>true</WholeProgramOptimization> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
|||
<ImportGroup Label="ExtensionSettings"> |
|||
</ImportGroup> |
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
</ImportGroup> |
|||
<PropertyGroup Label="UserMacros" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<ClCompile> |
|||
<PrecompiledHeader> |
|||
</PrecompiledHeader> |
|||
<Optimization>Disabled</Optimization> |
|||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
|||
<DisableSpecificWarnings>4189;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Windows</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
|||
<ClCompile> |
|||
<PrecompiledHeader> |
|||
</PrecompiledHeader> |
|||
<Optimization>Disabled</Optimization> |
|||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
|||
<DisableSpecificWarnings>4189;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Windows</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<ClCompile> |
|||
<PrecompiledHeader> |
|||
</PrecompiledHeader> |
|||
<Optimization>MaxSpeed</Optimization> |
|||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
|||
<DisableSpecificWarnings>4189;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Windows</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
|||
<OptimizeReferences>true</OptimizeReferences> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
|||
<ClCompile> |
|||
<PrecompiledHeader> |
|||
</PrecompiledHeader> |
|||
<Optimization>MaxSpeed</Optimization> |
|||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
|||
<DisableSpecificWarnings>4189;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Windows</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
|||
<OptimizeReferences>true</OptimizeReferences> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
|||
<ImportGroup Label="ExtensionTargets"> |
|||
</ImportGroup> |
|||
</Project> |
@ -0,0 +1,31 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ImportGroup Label="PropertySheets" /> |
|||
<PropertyGroup Label="UserMacros"> |
|||
<BoostDir>../../boost</BoostDir> |
|||
</PropertyGroup> |
|||
<PropertyGroup> |
|||
<OutDir>..\..\_build\$(ProjectName)\$(Platform)_$(Configuration)\</OutDir> |
|||
<IntDir>..\..\_build\$(ProjectName)\$(Platform)_$(Configuration)\</IntDir> |
|||
</PropertyGroup> |
|||
<ItemDefinitionGroup> |
|||
<ClCompile> |
|||
<DisableSpecificWarnings>4068;4100;4127;4258;4505;4512;4706</DisableSpecificWarnings> |
|||
<WarningLevel>Level4</WarningLevel> |
|||
<TreatWarningAsError>true</TreatWarningAsError> |
|||
<MinimalRebuild>false</MinimalRebuild> |
|||
<AdditionalIncludeDirectories>include/$(ProjectName);../libethereum;$(BoostDir);../../leveldb/include;../../cryptopp;../secp256k1;../../miniupnp</AdditionalIncludeDirectories> |
|||
<PreprocessorDefinitions>ETH_BUILD_PLATFORM=Windows/VS2013;ETH_BUILD_TYPE=$(Configuration)-$(Platform);STATICLIB;LEVELDB_PLATFORM_WINDOWS;USE_NUM_BOOST;USE_FIELD_10X26;USE_FIELD_INV_BUILTIN;_WIN32_WINNT=0x0501;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<RuntimeTypeInfo>true</RuntimeTypeInfo> |
|||
<MultiProcessorCompilation>true</MultiProcessorCompilation> |
|||
</ClCompile> |
|||
<Link> |
|||
<AdditionalLibraryDirectories>$(BoostDir)/stage/$(Platform)</AdditionalLibraryDirectories> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemGroup> |
|||
<BuildMacro Include="BoostDir"> |
|||
<Value>$(BoostDir)</Value> |
|||
</BuildMacro> |
|||
</ItemGroup> |
|||
</Project> |
@ -0,0 +1,218 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup Label="ProjectConfigurations"> |
|||
<ProjectConfiguration Include="Debug|Win32"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Debug|x64"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>x64</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|Win32"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|x64"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>x64</Platform> |
|||
</ProjectConfiguration> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="..\libethereum\AddressState.cpp"> |
|||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> |
|||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> |
|||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> |
|||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild> |
|||
</ClCompile> |
|||
<ClCompile Include="..\libethereum\BlockChain.cpp" /> |
|||
<ClCompile Include="..\libethereum\BlockInfo.cpp" /> |
|||
<ClCompile Include="..\libethereum\Client.cpp" /> |
|||
<ClCompile Include="..\libethereum\Common.cpp" /> |
|||
<ClCompile Include="..\libethereum\Dagger.cpp" /> |
|||
<ClCompile Include="..\libethereum\Defaults.cpp" /> |
|||
<ClCompile Include="..\libethereum\FeeStructure.cpp" /> |
|||
<ClCompile Include="..\libethereum\FileSystem.cpp" /> |
|||
<ClCompile Include="..\libethereum\Instruction.cpp" /> |
|||
<ClCompile Include="..\libethereum\MemTrie.cpp" /> |
|||
<ClCompile Include="..\libethereum\PeerNetwork.cpp" /> |
|||
<ClCompile Include="..\libethereum\RLP.cpp" /> |
|||
<ClCompile Include="..\libethereum\State.cpp" /> |
|||
<ClCompile Include="..\libethereum\Transaction.cpp" /> |
|||
<ClCompile Include="..\libethereum\TransactionQueue.cpp" /> |
|||
<ClCompile Include="..\libethereum\TrieCommon.cpp" /> |
|||
<ClCompile Include="..\libethereum\TrieDB.cpp" /> |
|||
<ClCompile Include="..\libethereum\TrieHash.cpp" /> |
|||
<ClCompile Include="..\libethereum\UPnP.cpp" /> |
|||
<ClCompile Include="..\libethereum\VM.cpp" /> |
|||
<ClCompile Include="stdafx.cpp"> |
|||
<PrecompiledHeaderFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">stdafx.h</PrecompiledHeaderFile> |
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> |
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> |
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader> |
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader> |
|||
</ClCompile> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClInclude Include="..\libethereum\AddressState.h" /> |
|||
<ClInclude Include="..\libethereum\BlockChain.h" /> |
|||
<ClInclude Include="..\libethereum\BlockInfo.h" /> |
|||
<ClInclude Include="..\libethereum\Client.h" /> |
|||
<ClInclude Include="..\libethereum\Common.h" /> |
|||
<ClInclude Include="..\libethereum\Dagger.h" /> |
|||
<ClInclude Include="..\libethereum\Defaults.h" /> |
|||
<ClInclude Include="..\libethereum\Exceptions.h" /> |
|||
<ClInclude Include="..\libethereum\ExtVMFace.h" /> |
|||
<ClInclude Include="..\libethereum\FeeStructure.h" /> |
|||
<ClInclude Include="..\libethereum\FileSystem.h" /> |
|||
<ClInclude Include="..\libethereum\Instruction.h" /> |
|||
<ClInclude Include="..\libethereum\MemTrie.h" /> |
|||
<ClInclude Include="..\libethereum\PeerNetwork.h" /> |
|||
<ClInclude Include="..\libethereum\RLP.h" /> |
|||
<ClInclude Include="..\libethereum\State.h" /> |
|||
<ClInclude Include="..\libethereum\Transaction.h" /> |
|||
<ClInclude Include="..\libethereum\TransactionQueue.h" /> |
|||
<ClInclude Include="..\libethereum\TrieCommon.h" /> |
|||
<ClInclude Include="..\libethereum\TrieDB.h" /> |
|||
<ClInclude Include="..\libethereum\TrieHash.h" /> |
|||
<ClInclude Include="..\libethereum\UPnP.h" /> |
|||
<ClInclude Include="..\libethereum\vector_ref.h" /> |
|||
<ClInclude Include="..\libethereum\VM.h" /> |
|||
<ClInclude Include="stdafx.h" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ProjectReference Include="LibCryptoPP.vcxproj"> |
|||
<Project>{1cc213a4-3482-4211-b47b-172e90dac7de}</Project> |
|||
</ProjectReference> |
|||
<ProjectReference Include="LibLevelDB.vcxproj"> |
|||
<Project>{27014763-955d-486b-9ba7-69872192e6f4}</Project> |
|||
</ProjectReference> |
|||
<ProjectReference Include="LibMiniUPnPc.vcxproj"> |
|||
<Project>{1b1ca20e-39c3-4d9b-ac37-3783048e6672}</Project> |
|||
</ProjectReference> |
|||
<ProjectReference Include="LibSecp256k1.vcxproj"> |
|||
<Project>{1e1175bb-c4a9-41d8-b2d1-9022f71d3cea}</Project> |
|||
</ProjectReference> |
|||
</ItemGroup> |
|||
<PropertyGroup Label="Globals"> |
|||
<ProjectGuid>{826E68CB-D3EE-4A8A-B540-59A8C3F38D4F}</ProjectGuid> |
|||
<Keyword>Win32Proj</Keyword> |
|||
<RootNamespace>LibEthereum</RootNamespace> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
|||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|||
<UseDebugLibraries>true</UseDebugLibraries> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> |
|||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|||
<UseDebugLibraries>true</UseDebugLibraries> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
|||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|||
<UseDebugLibraries>false</UseDebugLibraries> |
|||
<WholeProgramOptimization>true</WholeProgramOptimization> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> |
|||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|||
<UseDebugLibraries>false</UseDebugLibraries> |
|||
<WholeProgramOptimization>true</WholeProgramOptimization> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
|||
<ImportGroup Label="ExtensionSettings"> |
|||
</ImportGroup> |
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
</ImportGroup> |
|||
<PropertyGroup Label="UserMacros" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<ClCompile> |
|||
<Optimization>Disabled</Optimization> |
|||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<MinimalRebuild>false</MinimalRebuild> |
|||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
|||
<PrecompiledHeader>Use</PrecompiledHeader> |
|||
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Windows</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
|||
<ClCompile> |
|||
<Optimization>Disabled</Optimization> |
|||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<MinimalRebuild>false</MinimalRebuild> |
|||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
|||
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles> |
|||
<PrecompiledHeader>Use</PrecompiledHeader> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Windows</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
</Link> |
|||
<Lib /> |
|||
<ProjectReference /> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<ClCompile> |
|||
<Optimization>MaxSpeed</Optimization> |
|||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<TreatWarningAsError>true</TreatWarningAsError> |
|||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
|||
<PrecompiledHeader>Use</PrecompiledHeader> |
|||
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Windows</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
|||
<OptimizeReferences>true</OptimizeReferences> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
|||
<ClCompile> |
|||
<Optimization>MaxSpeed</Optimization> |
|||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<TreatWarningAsError>true</TreatWarningAsError> |
|||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
|||
<PrecompiledHeader>Use</PrecompiledHeader> |
|||
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Windows</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
|||
<OptimizeReferences>true</OptimizeReferences> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
|||
<ImportGroup Label="ExtensionTargets"> |
|||
</ImportGroup> |
|||
</Project> |
@ -0,0 +1,63 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup> |
|||
<ClCompile Include="..\libethereum\BlockInfo.cpp" /> |
|||
<ClCompile Include="..\libethereum\Client.cpp" /> |
|||
<ClCompile Include="..\libethereum\Common.cpp" /> |
|||
<ClCompile Include="..\libethereum\Dagger.cpp" /> |
|||
<ClCompile Include="..\libethereum\Defaults.cpp" /> |
|||
<ClCompile Include="..\libethereum\FileSystem.cpp" /> |
|||
<ClCompile Include="..\libethereum\MemTrie.cpp" /> |
|||
<ClCompile Include="..\libethereum\PeerNetwork.cpp" /> |
|||
<ClCompile Include="..\libethereum\RLP.cpp" /> |
|||
<ClCompile Include="..\libethereum\State.cpp" /> |
|||
<ClCompile Include="..\libethereum\Transaction.cpp" /> |
|||
<ClCompile Include="..\libethereum\TransactionQueue.cpp" /> |
|||
<ClCompile Include="..\libethereum\TrieCommon.cpp" /> |
|||
<ClCompile Include="..\libethereum\TrieDB.cpp" /> |
|||
<ClCompile Include="..\libethereum\TrieHash.cpp" /> |
|||
<ClCompile Include="..\libethereum\UPnP.cpp" /> |
|||
<ClCompile Include="..\libethereum\AddressState.cpp" /> |
|||
<ClCompile Include="..\libethereum\BlockChain.cpp" /> |
|||
<ClCompile Include="..\libethereum\Instruction.cpp" /> |
|||
<ClCompile Include="stdafx.cpp"> |
|||
<Filter>Windows</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\libethereum\FeeStructure.cpp" /> |
|||
<ClCompile Include="..\libethereum\VM.cpp" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClInclude Include="..\libethereum\BlockInfo.h" /> |
|||
<ClInclude Include="..\libethereum\Client.h" /> |
|||
<ClInclude Include="..\libethereum\Common.h" /> |
|||
<ClInclude Include="..\libethereum\Dagger.h" /> |
|||
<ClInclude Include="..\libethereum\Defaults.h" /> |
|||
<ClInclude Include="..\libethereum\Exceptions.h" /> |
|||
<ClInclude Include="..\libethereum\FileSystem.h" /> |
|||
<ClInclude Include="..\libethereum\Instruction.h" /> |
|||
<ClInclude Include="..\libethereum\MemTrie.h" /> |
|||
<ClInclude Include="..\libethereum\PeerNetwork.h" /> |
|||
<ClInclude Include="..\libethereum\RLP.h" /> |
|||
<ClInclude Include="..\libethereum\State.h" /> |
|||
<ClInclude Include="..\libethereum\Transaction.h" /> |
|||
<ClInclude Include="..\libethereum\TransactionQueue.h" /> |
|||
<ClInclude Include="..\libethereum\TrieCommon.h" /> |
|||
<ClInclude Include="..\libethereum\TrieDB.h" /> |
|||
<ClInclude Include="..\libethereum\TrieHash.h" /> |
|||
<ClInclude Include="..\libethereum\UPnP.h" /> |
|||
<ClInclude Include="..\libethereum\vector_ref.h" /> |
|||
<ClInclude Include="..\libethereum\AddressState.h" /> |
|||
<ClInclude Include="..\libethereum\BlockChain.h" /> |
|||
<ClInclude Include="stdafx.h"> |
|||
<Filter>Windows</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\libethereum\ExtVMFace.h" /> |
|||
<ClInclude Include="..\libethereum\FeeStructure.h" /> |
|||
<ClInclude Include="..\libethereum\VM.h" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Filter Include="Windows"> |
|||
<UniqueIdentifier>{2d571d8f-bacf-4c49-a0d0-c9036f5c0cc9}</UniqueIdentifier> |
|||
</Filter> |
|||
</ItemGroup> |
|||
</Project> |
@ -0,0 +1,223 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup Label="ProjectConfigurations"> |
|||
<ProjectConfiguration Include="Debug|Win32"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Debug|x64"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>x64</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|Win32"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|x64"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>x64</Platform> |
|||
</ProjectConfiguration> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClInclude Include="..\..\leveldb\db\builder.h" /> |
|||
<ClInclude Include="..\..\leveldb\db\dbformat.h" /> |
|||
<ClInclude Include="..\..\leveldb\db\db_impl.h" /> |
|||
<ClInclude Include="..\..\leveldb\db\db_iter.h" /> |
|||
<ClInclude Include="..\..\leveldb\db\filename.h" /> |
|||
<ClInclude Include="..\..\leveldb\db\log_format.h" /> |
|||
<ClInclude Include="..\..\leveldb\db\log_reader.h" /> |
|||
<ClInclude Include="..\..\leveldb\db\log_writer.h" /> |
|||
<ClInclude Include="..\..\leveldb\db\memtable.h" /> |
|||
<ClInclude Include="..\..\leveldb\db\skiplist.h" /> |
|||
<ClInclude Include="..\..\leveldb\db\snapshot.h" /> |
|||
<ClInclude Include="..\..\leveldb\db\table_cache.h" /> |
|||
<ClInclude Include="..\..\leveldb\db\version_edit.h" /> |
|||
<ClInclude Include="..\..\leveldb\db\version_set.h" /> |
|||
<ClInclude Include="..\..\leveldb\db\write_batch_internal.h" /> |
|||
<ClInclude Include="..\..\leveldb\port\atomic_pointer.h" /> |
|||
<ClInclude Include="..\..\leveldb\port\port.h" /> |
|||
<ClInclude Include="..\..\leveldb\port\port_win.h" /> |
|||
<ClInclude Include="..\..\leveldb\table\block.h" /> |
|||
<ClInclude Include="..\..\leveldb\table\block_builder.h" /> |
|||
<ClInclude Include="..\..\leveldb\table\format.h" /> |
|||
<ClInclude Include="..\..\leveldb\table\iterator_wrapper.h" /> |
|||
<ClInclude Include="..\..\leveldb\table\merger.h" /> |
|||
<ClInclude Include="..\..\leveldb\table\two_level_iterator.h" /> |
|||
<ClInclude Include="..\..\leveldb\util\arena.h" /> |
|||
<ClInclude Include="..\..\leveldb\util\coding.h" /> |
|||
<ClInclude Include="..\..\leveldb\util\crc32c.h" /> |
|||
<ClInclude Include="..\..\leveldb\util\hash.h" /> |
|||
<ClInclude Include="..\..\leveldb\util\histogram.h" /> |
|||
<ClInclude Include="..\..\leveldb\util\logging.h" /> |
|||
<ClInclude Include="..\..\leveldb\util\mutexlock.h" /> |
|||
<ClInclude Include="..\..\leveldb\util\posix_logger.h" /> |
|||
<ClInclude Include="..\..\leveldb\util\random.h" /> |
|||
<ClInclude Include="..\..\leveldb\util\testharness.h" /> |
|||
<ClInclude Include="..\..\leveldb\util\testutil.h" /> |
|||
<ClInclude Include="..\..\leveldb\util\win_logger.h" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="..\..\leveldb\db\builder.cc" /> |
|||
<ClCompile Include="..\..\leveldb\db\c.cc" /> |
|||
<ClCompile Include="..\..\leveldb\db\dbformat.cc" /> |
|||
<ClCompile Include="..\..\leveldb\db\db_bench.cc" /> |
|||
<ClCompile Include="..\..\leveldb\db\db_impl.cc" /> |
|||
<ClCompile Include="..\..\leveldb\db\db_iter.cc" /> |
|||
<ClCompile Include="..\..\leveldb\db\filename.cc" /> |
|||
<ClCompile Include="..\..\leveldb\db\log_reader.cc" /> |
|||
<ClCompile Include="..\..\leveldb\db\log_writer.cc" /> |
|||
<ClCompile Include="..\..\leveldb\db\memtable.cc" /> |
|||
<ClCompile Include="..\..\leveldb\db\repair.cc" /> |
|||
<ClCompile Include="..\..\leveldb\db\table_cache.cc" /> |
|||
<ClCompile Include="..\..\leveldb\db\version_edit.cc" /> |
|||
<ClCompile Include="..\..\leveldb\db\version_set.cc" /> |
|||
<ClCompile Include="..\..\leveldb\db\write_batch.cc" /> |
|||
<ClCompile Include="..\..\leveldb\port\port_win.cc" /> |
|||
<ClCompile Include="..\..\leveldb\table\block.cc" /> |
|||
<ClCompile Include="..\..\leveldb\table\block_builder.cc" /> |
|||
<ClCompile Include="..\..\leveldb\table\format.cc" /> |
|||
<ClCompile Include="..\..\leveldb\table\iterator.cc" /> |
|||
<ClCompile Include="..\..\leveldb\table\merger.cc" /> |
|||
<ClCompile Include="..\..\leveldb\table\table.cc" /> |
|||
<ClCompile Include="..\..\leveldb\table\table_builder.cc" /> |
|||
<ClCompile Include="..\..\leveldb\table\two_level_iterator.cc" /> |
|||
<ClCompile Include="..\..\leveldb\util\arena.cc" /> |
|||
<ClCompile Include="..\..\leveldb\util\cache.cc" /> |
|||
<ClCompile Include="..\..\leveldb\util\coding.cc" /> |
|||
<ClCompile Include="..\..\leveldb\util\comparator.cc" /> |
|||
<ClCompile Include="..\..\leveldb\util\crc32c.cc" /> |
|||
<ClCompile Include="..\..\leveldb\util\env.cc" /> |
|||
<ClCompile Include="..\..\leveldb\util\env_boost.cc" /> |
|||
<ClCompile Include="..\..\leveldb\util\hash.cc" /> |
|||
<ClCompile Include="..\..\leveldb\util\histogram.cc" /> |
|||
<ClCompile Include="..\..\leveldb\util\logging.cc" /> |
|||
<ClCompile Include="..\..\leveldb\util\options.cc" /> |
|||
<ClCompile Include="..\..\leveldb\util\status.cc" /> |
|||
<ClCompile Include="..\..\leveldb\util\testharness.cc" /> |
|||
<ClCompile Include="..\..\leveldb\util\testutil.cc" /> |
|||
<ClCompile Include="..\..\leveldb\util\win_logger.cc" /> |
|||
</ItemGroup> |
|||
<PropertyGroup Label="Globals"> |
|||
<ProjectGuid>{27014763-955D-486B-9BA7-69872192E6F4}</ProjectGuid> |
|||
<Keyword>Win32Proj</Keyword> |
|||
<RootNamespace>LibLevelDB</RootNamespace> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
|||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|||
<UseDebugLibraries>true</UseDebugLibraries> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> |
|||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|||
<UseDebugLibraries>true</UseDebugLibraries> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
|||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|||
<UseDebugLibraries>false</UseDebugLibraries> |
|||
<WholeProgramOptimization>true</WholeProgramOptimization> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> |
|||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|||
<UseDebugLibraries>false</UseDebugLibraries> |
|||
<WholeProgramOptimization>true</WholeProgramOptimization> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
|||
<ImportGroup Label="ExtensionSettings"> |
|||
</ImportGroup> |
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
</ImportGroup> |
|||
<PropertyGroup Label="UserMacros" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<ClCompile> |
|||
<PrecompiledHeader> |
|||
</PrecompiledHeader> |
|||
<Optimization>Disabled</Optimization> |
|||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
|||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);../../leveldb</AdditionalIncludeDirectories> |
|||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<DisableSpecificWarnings>4018;4244;4267;4389;4702;4722;4800;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Windows</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
|||
<ClCompile> |
|||
<PrecompiledHeader> |
|||
</PrecompiledHeader> |
|||
<Optimization>Disabled</Optimization> |
|||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
|||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);../../leveldb</AdditionalIncludeDirectories> |
|||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<DisableSpecificWarnings>4018;4244;4267;4389;4702;4722;4800;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Windows</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<ClCompile> |
|||
<PrecompiledHeader> |
|||
</PrecompiledHeader> |
|||
<Optimization>MaxSpeed</Optimization> |
|||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
|||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);../../leveldb</AdditionalIncludeDirectories> |
|||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<DisableSpecificWarnings>4018;4244;4267;4389;4702;4722;4800;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Windows</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
|||
<OptimizeReferences>true</OptimizeReferences> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
|||
<ClCompile> |
|||
<PrecompiledHeader> |
|||
</PrecompiledHeader> |
|||
<Optimization>MaxSpeed</Optimization> |
|||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
|||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);../../leveldb</AdditionalIncludeDirectories> |
|||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<DisableSpecificWarnings>4018;4244;4267;4389;4702;4722;4800;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Windows</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
|||
<OptimizeReferences>true</OptimizeReferences> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
|||
<ImportGroup Label="ExtensionTargets"> |
|||
</ImportGroup> |
|||
</Project> |
@ -0,0 +1,246 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup> |
|||
<Filter Include="db"> |
|||
<UniqueIdentifier>{d83904b1-b5d1-4c5b-b476-96f08300d103}</UniqueIdentifier> |
|||
</Filter> |
|||
<Filter Include="util"> |
|||
<UniqueIdentifier>{72573022-b7fd-4b7a-a92e-a68c06bd6366}</UniqueIdentifier> |
|||
</Filter> |
|||
<Filter Include="table"> |
|||
<UniqueIdentifier>{7f821e9e-4ebf-4d18-8fb4-898bd3d81376}</UniqueIdentifier> |
|||
</Filter> |
|||
<Filter Include="port"> |
|||
<UniqueIdentifier>{f285a595-6c39-4350-8d30-6f696a3a7c4c}</UniqueIdentifier> |
|||
</Filter> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClInclude Include="..\..\leveldb\db\table_cache.h"> |
|||
<Filter>db</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\db\version_edit.h"> |
|||
<Filter>db</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\db\version_set.h"> |
|||
<Filter>db</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\db\write_batch_internal.h"> |
|||
<Filter>db</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\db\builder.h"> |
|||
<Filter>db</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\db\db_impl.h"> |
|||
<Filter>db</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\db\db_iter.h"> |
|||
<Filter>db</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\db\dbformat.h"> |
|||
<Filter>db</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\db\filename.h"> |
|||
<Filter>db</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\db\log_format.h"> |
|||
<Filter>db</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\db\log_reader.h"> |
|||
<Filter>db</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\db\log_writer.h"> |
|||
<Filter>db</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\db\memtable.h"> |
|||
<Filter>db</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\db\skiplist.h"> |
|||
<Filter>db</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\db\snapshot.h"> |
|||
<Filter>db</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\table\merger.h"> |
|||
<Filter>table</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\table\two_level_iterator.h"> |
|||
<Filter>table</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\table\block.h"> |
|||
<Filter>table</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\table\block_builder.h"> |
|||
<Filter>table</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\table\format.h"> |
|||
<Filter>table</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\table\iterator_wrapper.h"> |
|||
<Filter>table</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\util\posix_logger.h"> |
|||
<Filter>util</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\util\random.h"> |
|||
<Filter>util</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\util\testharness.h"> |
|||
<Filter>util</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\util\testutil.h"> |
|||
<Filter>util</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\util\win_logger.h"> |
|||
<Filter>util</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\util\arena.h"> |
|||
<Filter>util</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\util\coding.h"> |
|||
<Filter>util</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\util\crc32c.h"> |
|||
<Filter>util</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\util\hash.h"> |
|||
<Filter>util</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\util\histogram.h"> |
|||
<Filter>util</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\util\logging.h"> |
|||
<Filter>util</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\util\mutexlock.h"> |
|||
<Filter>util</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\port\port_win.h"> |
|||
<Filter>port</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\port\atomic_pointer.h"> |
|||
<Filter>port</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\..\leveldb\port\port.h"> |
|||
<Filter>port</Filter> |
|||
</ClInclude> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="..\..\leveldb\db\version_edit.cc"> |
|||
<Filter>db</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\db\version_set.cc"> |
|||
<Filter>db</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\db\write_batch.cc"> |
|||
<Filter>db</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\db\builder.cc"> |
|||
<Filter>db</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\db\c.cc"> |
|||
<Filter>db</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\db\db_bench.cc"> |
|||
<Filter>db</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\db\db_impl.cc"> |
|||
<Filter>db</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\db\db_iter.cc"> |
|||
<Filter>db</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\db\dbformat.cc"> |
|||
<Filter>db</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\db\filename.cc"> |
|||
<Filter>db</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\db\log_reader.cc"> |
|||
<Filter>db</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\db\log_writer.cc"> |
|||
<Filter>db</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\db\memtable.cc"> |
|||
<Filter>db</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\db\repair.cc"> |
|||
<Filter>db</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\db\table_cache.cc"> |
|||
<Filter>db</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\table\merger.cc"> |
|||
<Filter>table</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\table\table.cc"> |
|||
<Filter>table</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\table\table_builder.cc"> |
|||
<Filter>table</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\table\two_level_iterator.cc"> |
|||
<Filter>table</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\table\block.cc"> |
|||
<Filter>table</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\table\block_builder.cc"> |
|||
<Filter>table</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\table\format.cc"> |
|||
<Filter>table</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\table\iterator.cc"> |
|||
<Filter>table</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\util\status.cc"> |
|||
<Filter>util</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\util\testharness.cc"> |
|||
<Filter>util</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\util\testutil.cc"> |
|||
<Filter>util</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\util\win_logger.cc"> |
|||
<Filter>util</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\util\arena.cc"> |
|||
<Filter>util</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\util\cache.cc"> |
|||
<Filter>util</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\util\coding.cc"> |
|||
<Filter>util</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\util\comparator.cc"> |
|||
<Filter>util</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\util\crc32c.cc"> |
|||
<Filter>util</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\util\env.cc"> |
|||
<Filter>util</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\util\env_boost.cc"> |
|||
<Filter>util</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\util\hash.cc"> |
|||
<Filter>util</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\util\histogram.cc"> |
|||
<Filter>util</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\util\logging.cc"> |
|||
<Filter>util</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\util\options.cc"> |
|||
<Filter>util</Filter> |
|||
</ClCompile> |
|||
<ClCompile Include="..\..\leveldb\port\port_win.cc"> |
|||
<Filter>port</Filter> |
|||
</ClCompile> |
|||
</ItemGroup> |
|||
</Project> |
@ -0,0 +1,184 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup Label="ProjectConfigurations"> |
|||
<ProjectConfiguration Include="Debug|Win32"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Debug|x64"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>x64</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|Win32"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|x64"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>x64</Platform> |
|||
</ProjectConfiguration> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClInclude Include="..\..\miniupnp\miniupnpc\bsdqueue.h" /> |
|||
<ClInclude Include="..\..\miniupnp\miniupnpc\codelength.h" /> |
|||
<ClInclude Include="..\..\miniupnp\miniupnpc\connecthostport.h" /> |
|||
<ClInclude Include="..\..\miniupnp\miniupnpc\declspec.h" /> |
|||
<ClInclude Include="..\..\miniupnp\miniupnpc\igd_desc_parse.h" /> |
|||
<ClInclude Include="..\..\miniupnp\miniupnpc\minisoap.h" /> |
|||
<ClInclude Include="..\..\miniupnp\miniupnpc\minissdpc.h" /> |
|||
<ClInclude Include="..\..\miniupnp\miniupnpc\miniupnpc.h" /> |
|||
<ClInclude Include="..\..\miniupnp\miniupnpc\miniupnpctypes.h" /> |
|||
<ClInclude Include="..\..\miniupnp\miniupnpc\miniwget.h" /> |
|||
<ClInclude Include="..\..\miniupnp\miniupnpc\minixml.h" /> |
|||
<ClInclude Include="..\..\miniupnp\miniupnpc\portlistingparse.h" /> |
|||
<ClInclude Include="..\..\miniupnp\miniupnpc\receivedata.h" /> |
|||
<ClInclude Include="..\..\miniupnp\miniupnpc\upnpcommands.h" /> |
|||
<ClInclude Include="..\..\miniupnp\miniupnpc\upnperrors.h" /> |
|||
<ClInclude Include="..\..\miniupnp\miniupnpc\upnpreplyparse.h" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="..\..\miniupnp\miniupnpc\connecthostport.c" /> |
|||
<ClCompile Include="..\..\miniupnp\miniupnpc\igd_desc_parse.c" /> |
|||
<ClCompile Include="..\..\miniupnp\miniupnpc\minisoap.c" /> |
|||
<ClCompile Include="..\..\miniupnp\miniupnpc\miniupnpc.c" /> |
|||
<ClCompile Include="..\..\miniupnp\miniupnpc\miniwget.c" /> |
|||
<ClCompile Include="..\..\miniupnp\miniupnpc\minixml.c" /> |
|||
<ClCompile Include="..\..\miniupnp\miniupnpc\portlistingparse.c" /> |
|||
<ClCompile Include="..\..\miniupnp\miniupnpc\receivedata.c" /> |
|||
<ClCompile Include="..\..\miniupnp\miniupnpc\upnpcommands.c" /> |
|||
<ClCompile Include="..\..\miniupnp\miniupnpc\upnperrors.c" /> |
|||
<ClCompile Include="..\..\miniupnp\miniupnpc\upnpreplyparse.c" /> |
|||
</ItemGroup> |
|||
<PropertyGroup Label="Globals"> |
|||
<Keyword>Win32Proj</Keyword> |
|||
<RootNamespace>LibMiniUPnPc</RootNamespace> |
|||
<ProjectGuid>{1B1CA20E-39C3-4D9B-AC37-3783048E6672}</ProjectGuid> |
|||
<ProjectName>LibMiniUPnPc</ProjectName> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
|||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|||
<UseDebugLibraries>true</UseDebugLibraries> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> |
|||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|||
<UseDebugLibraries>true</UseDebugLibraries> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
|||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|||
<UseDebugLibraries>false</UseDebugLibraries> |
|||
<WholeProgramOptimization>true</WholeProgramOptimization> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> |
|||
<ConfigurationType>StaticLibrary</ConfigurationType> |
|||
<UseDebugLibraries>false</UseDebugLibraries> |
|||
<WholeProgramOptimization>true</WholeProgramOptimization> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
|||
<ImportGroup Label="ExtensionSettings"> |
|||
</ImportGroup> |
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
</ImportGroup> |
|||
<PropertyGroup Label="UserMacros" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<ClCompile> |
|||
<PrecompiledHeader> |
|||
</PrecompiledHeader> |
|||
<Optimization>Disabled</Optimization> |
|||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
|||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<DisableSpecificWarnings>4244;4245;4267;4389;%(DisableSpecificWarnings)</DisableSpecificWarnings> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Windows</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
</Link> |
|||
<Lib> |
|||
<AdditionalDependencies>Iphlpapi.lib</AdditionalDependencies> |
|||
</Lib> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
|||
<ClCompile> |
|||
<PrecompiledHeader> |
|||
</PrecompiledHeader> |
|||
<Optimization>Disabled</Optimization> |
|||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
|||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<DisableSpecificWarnings>4244;4245;4267;4389;%(DisableSpecificWarnings)</DisableSpecificWarnings> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Windows</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
</Link> |
|||
<Lib> |
|||
<AdditionalDependencies>Iphlpapi.lib</AdditionalDependencies> |
|||
</Lib> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<ClCompile> |
|||
<PrecompiledHeader> |
|||
</PrecompiledHeader> |
|||
<Optimization>MaxSpeed</Optimization> |
|||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
|||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<DisableSpecificWarnings>4244;4245;4267;4389;%(DisableSpecificWarnings)</DisableSpecificWarnings> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Windows</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
|||
<OptimizeReferences>true</OptimizeReferences> |
|||
</Link> |
|||
<Lib> |
|||
<AdditionalDependencies>Iphlpapi.lib</AdditionalDependencies> |
|||
</Lib> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
|||
<ClCompile> |
|||
<PrecompiledHeader> |
|||
</PrecompiledHeader> |
|||
<Optimization>MaxSpeed</Optimization> |
|||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
|||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<DisableSpecificWarnings>4244;4245;4267;4389;%(DisableSpecificWarnings)</DisableSpecificWarnings> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Windows</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
|||
<OptimizeReferences>true</OptimizeReferences> |
|||
</Link> |
|||
<Lib> |
|||
<AdditionalDependencies>Iphlpapi.lib</AdditionalDependencies> |
|||
</Lib> |
|||
</ItemDefinitionGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
|||
<ImportGroup Label="ExtensionTargets"> |
|||
</ImportGroup> |
|||
</Project> |
@ -0,0 +1,71 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup> |
|||
<Filter Include="impl"> |
|||
<UniqueIdentifier>{7d4db365-bce7-45c1-861c-f5f86beca992}</UniqueIdentifier> |
|||
</Filter> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClInclude Include="..\secp256k1\impl\group.h"> |
|||
<Filter>impl</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\secp256k1\impl\num.h"> |
|||
<Filter>impl</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\secp256k1\impl\num_boost.h"> |
|||
<Filter>impl</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\secp256k1\impl\num_gmp.h"> |
|||
<Filter>impl</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\secp256k1\impl\num_openssl.h"> |
|||
<Filter>impl</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\secp256k1\impl\util.h"> |
|||
<Filter>impl</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\secp256k1\impl\ecdsa.h"> |
|||
<Filter>impl</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\secp256k1\impl\ecmult.h"> |
|||
<Filter>impl</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\secp256k1\impl\field.h"> |
|||
<Filter>impl</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\secp256k1\impl\field_5x52.h"> |
|||
<Filter>impl</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\secp256k1\impl\field_5x52_asm.h"> |
|||
<Filter>impl</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\secp256k1\impl\field_5x52_int128.h"> |
|||
<Filter>impl</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\secp256k1\impl\field_10x26.h"> |
|||
<Filter>impl</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\secp256k1\impl\field_gmp.h"> |
|||
<Filter>impl</Filter> |
|||
</ClInclude> |
|||
<ClInclude Include="..\secp256k1\group.h" /> |
|||
<ClInclude Include="..\secp256k1\num.h" /> |
|||
<ClInclude Include="..\secp256k1\num_boost.h" /> |
|||
<ClInclude Include="..\secp256k1\num_gmp.h" /> |
|||
<ClInclude Include="..\secp256k1\num_openssl.h" /> |
|||
<ClInclude Include="..\secp256k1\secp256k1.h" /> |
|||
<ClInclude Include="..\secp256k1\util.h" /> |
|||
<ClInclude Include="..\secp256k1\ecdsa.h" /> |
|||
<ClInclude Include="..\secp256k1\ecmult.h" /> |
|||
<ClInclude Include="..\secp256k1\field.h" /> |
|||
<ClInclude Include="..\secp256k1\field_5x52.h" /> |
|||
<ClInclude Include="..\secp256k1\field_10x26.h" /> |
|||
<ClInclude Include="..\secp256k1\field_gmp.h" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="..\secp256k1\secp256k1.c" /> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<None Include="..\secp256k1\field_5x52_asm.asm" /> |
|||
</ItemGroup> |
|||
</Project> |
@ -0,0 +1,181 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup Label="ProjectConfigurations"> |
|||
<ProjectConfiguration Include="Debug|Win32"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Debug|x64"> |
|||
<Configuration>Debug</Configuration> |
|||
<Platform>x64</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|Win32"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>Win32</Platform> |
|||
</ProjectConfiguration> |
|||
<ProjectConfiguration Include="Release|x64"> |
|||
<Configuration>Release</Configuration> |
|||
<Platform>x64</Platform> |
|||
</ProjectConfiguration> |
|||
</ItemGroup> |
|||
<PropertyGroup Label="Globals"> |
|||
<Keyword>Win32Proj</Keyword> |
|||
<RootNamespace>TestEthereum</RootNamespace> |
|||
<ProjectName>TestEthereum</ProjectName> |
|||
<ProjectGuid>{3F3E389B-88DE-41D5-A73B-4F6036E18B36}</ProjectGuid> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
|||
<ConfigurationType>Application</ConfigurationType> |
|||
<UseDebugLibraries>true</UseDebugLibraries> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> |
|||
<ConfigurationType>Application</ConfigurationType> |
|||
<UseDebugLibraries>true</UseDebugLibraries> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
|||
<ConfigurationType>Application</ConfigurationType> |
|||
<UseDebugLibraries>false</UseDebugLibraries> |
|||
<WholeProgramOptimization>true</WholeProgramOptimization> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> |
|||
<ConfigurationType>Application</ConfigurationType> |
|||
<UseDebugLibraries>false</UseDebugLibraries> |
|||
<WholeProgramOptimization>true</WholeProgramOptimization> |
|||
<PlatformToolset>v120</PlatformToolset> |
|||
</PropertyGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
|||
<ImportGroup Label="ExtensionSettings"> |
|||
</ImportGroup> |
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
</ImportGroup> |
|||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> |
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
|||
<Import Project="LibEthereum.props" /> |
|||
</ImportGroup> |
|||
<PropertyGroup Label="UserMacros" /> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<LinkIncremental>true</LinkIncremental> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
|||
<LinkIncremental>true</LinkIncremental> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<LinkIncremental>false</LinkIncremental> |
|||
</PropertyGroup> |
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
|||
<LinkIncremental>false</LinkIncremental> |
|||
</PropertyGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
|||
<ClCompile> |
|||
<PrecompiledHeader>Use</PrecompiledHeader> |
|||
<Optimization>Disabled</Optimization> |
|||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<OpenMPSupport>true</OpenMPSupport> |
|||
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Console</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<LargeAddressAware>true</LargeAddressAware> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
|||
<ClCompile> |
|||
<PrecompiledHeader>Use</PrecompiledHeader> |
|||
<Optimization>Disabled</Optimization> |
|||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Console</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
|||
<ClCompile> |
|||
<PrecompiledHeader>Use</PrecompiledHeader> |
|||
<Optimization>MaxSpeed</Optimization> |
|||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
|||
<StringPooling>true</StringPooling> |
|||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> |
|||
<OpenMPSupport>true</OpenMPSupport> |
|||
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Console</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
|||
<OptimizeReferences>true</OptimizeReferences> |
|||
<LargeAddressAware>true</LargeAddressAware> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
|||
<ClCompile> |
|||
<PrecompiledHeader>Use</PrecompiledHeader> |
|||
<Optimization>MaxSpeed</Optimization> |
|||
<FunctionLevelLinking>true</FunctionLevelLinking> |
|||
<IntrinsicFunctions>true</IntrinsicFunctions> |
|||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
|||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
|||
<StringPooling>true</StringPooling> |
|||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> |
|||
<OpenMPSupport>true</OpenMPSupport> |
|||
<ForcedIncludeFiles>stdafx.h</ForcedIncludeFiles> |
|||
</ClCompile> |
|||
<Link> |
|||
<SubSystem>Console</SubSystem> |
|||
<GenerateDebugInformation>true</GenerateDebugInformation> |
|||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
|||
<OptimizeReferences>true</OptimizeReferences> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemGroup> |
|||
<ProjectReference Include="LibEthereum.vcxproj"> |
|||
<Project>{826e68cb-d3ee-4a8a-b540-59a8c3f38d4f}</Project> |
|||
</ProjectReference> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClCompile Include="..\test\crypto.cpp" /> |
|||
<ClCompile Include="..\test\dagger.cpp" /> |
|||
<ClCompile Include="..\test\hexPrefix.cpp" /> |
|||
<ClCompile Include="..\test\main.cpp" /> |
|||
<ClCompile Include="..\test\peer.cpp" /> |
|||
<ClCompile Include="..\test\rlp.cpp" /> |
|||
<ClCompile Include="..\test\state.cpp" /> |
|||
<ClCompile Include="..\test\trie.cpp" /> |
|||
<ClCompile Include="..\test\vm.cpp" /> |
|||
<ClCompile Include="stdafx.cpp"> |
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> |
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> |
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader> |
|||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader> |
|||
</ClCompile> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClInclude Include="stdafx.h" /> |
|||
</ItemGroup> |
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
|||
<ImportGroup Label="ExtensionTargets"> |
|||
</ImportGroup> |
|||
</Project> |
@ -0,0 +1,27 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ItemGroup> |
|||
<ClCompile Include="..\test\crypto.cpp" /> |
|||
<ClCompile Include="..\test\dagger.cpp" /> |
|||
<ClCompile Include="..\test\hexPrefix.cpp" /> |
|||
<ClCompile Include="..\test\main.cpp" /> |
|||
<ClCompile Include="..\test\peer.cpp" /> |
|||
<ClCompile Include="..\test\rlp.cpp" /> |
|||
<ClCompile Include="..\test\state.cpp" /> |
|||
<ClCompile Include="..\test\trie.cpp" /> |
|||
<ClCompile Include="..\test\vm.cpp" /> |
|||
<ClCompile Include="stdafx.cpp"> |
|||
<Filter>Windows</Filter> |
|||
</ClCompile> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<Filter Include="Windows"> |
|||
<UniqueIdentifier>{0acd7e2f-2594-4c13-94cb-3247045bdbfd}</UniqueIdentifier> |
|||
</Filter> |
|||
</ItemGroup> |
|||
<ItemGroup> |
|||
<ClInclude Include="stdafx.h"> |
|||
<Filter>Windows</Filter> |
|||
</ClInclude> |
|||
</ItemGroup> |
|||
</Project> |
@ -0,0 +1,38 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<ImportGroup Label="PropertySheets" /> |
|||
<PropertyGroup Label="UserMacros"> |
|||
<QtDir>../../Qt/$(Platform)</QtDir> |
|||
<QtBin>$(QtDir)/qtbase/bin</QtBin> |
|||
<QtInclude>$(QtDir)/qtbase/include;../../Qt/Src/qtbase/include</QtInclude> |
|||
<QtLib>$(QtDir)/qtbase/lib;$(QtDir)/qtbase/plugins/platforms</QtLib> |
|||
<Lua>../../lua/lua</Lua> |
|||
</PropertyGroup> |
|||
<PropertyGroup /> |
|||
<ItemDefinitionGroup> |
|||
<Link /> |
|||
<ClCompile> |
|||
<AdditionalIncludeDirectories>..;$(IntDir);$(QtInclude);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
|||
</ClCompile> |
|||
<Link> |
|||
<AdditionalLibraryDirectories>$(QtLib);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> |
|||
</Link> |
|||
</ItemDefinitionGroup> |
|||
<ItemGroup> |
|||
<BuildMacro Include="QtDir"> |
|||
<Value>$(QtDir)</Value> |
|||
</BuildMacro> |
|||
<BuildMacro Include="QtBin"> |
|||
<Value>$(QtBin)</Value> |
|||
</BuildMacro> |
|||
<BuildMacro Include="QtInclude"> |
|||
<Value>$(QtInclude)</Value> |
|||
</BuildMacro> |
|||
<BuildMacro Include="QtLib"> |
|||
<Value>$(QtLib)</Value> |
|||
</BuildMacro> |
|||
<BuildMacro Include="Lua"> |
|||
<Value>$(Lua)</Value> |
|||
</BuildMacro> |
|||
</ItemGroup> |
|||
</Project> |
@ -0,0 +1,72 @@ |
|||
// http://www.flipcode.com/archives/WinMain_Command_Line_Parser.shtml
|
|||
// COTD Entry submitted by Max McGuire [amcguire@andrew.cmu.edu]
|
|||
|
|||
#include <windows.h> |
|||
|
|||
extern int main(int argc, char* argv[]); |
|||
|
|||
int WINAPI WinMain(HINSTANCE instance, HINSTANCE prev_instance, char* command_line, int show_command) |
|||
{ |
|||
int argc; |
|||
char** argv; |
|||
char* arg; |
|||
int index; |
|||
int result; |
|||
|
|||
// count the arguments
|
|||
argc = 1; |
|||
arg = command_line; |
|||
|
|||
while (arg[0] != 0) |
|||
{ |
|||
while (arg[0] != 0 && arg[0] == ' ') |
|||
{ |
|||
arg++; |
|||
} |
|||
if (arg[0] != 0) |
|||
{ |
|||
argc++; |
|||
while (arg[0] != 0 && arg[0] != ' ') |
|||
{ |
|||
arg++; |
|||
} |
|||
} |
|||
} |
|||
|
|||
// tokenize the arguments
|
|||
argv = (char**)malloc(argc * sizeof(char*)); |
|||
arg = command_line; |
|||
index = 1; |
|||
|
|||
while (arg[0] != 0) |
|||
{ |
|||
while (arg[0] != 0 && arg[0] == ' ') |
|||
{ |
|||
arg++; |
|||
} |
|||
if (arg[0] != 0) |
|||
{ |
|||
argv[index] = arg; |
|||
index++; |
|||
while (arg[0] != 0 && arg[0] != ' ') |
|||
{ |
|||
arg++; |
|||
} |
|||
if (arg[0] != 0) |
|||
{ |
|||
arg[0] = 0; |
|||
arg++; |
|||
} |
|||
} |
|||
} |
|||
|
|||
// put the program name into argv[0]
|
|||
char filename[_MAX_PATH]; |
|||
GetModuleFileName(NULL, filename, _MAX_PATH); |
|||
argv[0] = filename; |
|||
|
|||
// call the user specified main function
|
|||
result = main(argc, argv); |
|||
free(argv); |
|||
return result; |
|||
} |
@ -0,0 +1,160 @@ |
|||
#!/bin/bash |
|||
# @file bootstrap.sh |
|||
# @author Tim Hughes <tim@twistedfury.com> |
|||
# @date 2014 |
|||
# Script to fetch and compile depdencies for building Ethereum using Visual Studio Express 2013. |
|||
# Prerequisites: |
|||
# - Visual Studio Express 2013 for Desktop |
|||
# - On PATH: bash, git, git-svn, curl, sed, 7z |
|||
|
|||
error_exit() { |
|||
echo $1 1>&2 |
|||
exit 1 |
|||
} |
|||
|
|||
for i in python perl curl git sed 7z; do |
|||
which $i &>/dev/null || error_exit "Could not find $i on PATH" |
|||
done |
|||
|
|||
if [ ! -d "$VS120COMNTOOLS" ]; then |
|||
error_exit "Couldn't find Visual Studio 2013" |
|||
fi |
|||
|
|||
if [[ ! $@ ]] || [ $1 == "fetch" ]; then |
|||
# fetch ethereum (develop branch) |
|||
if [ ! -d cpp-ethereum ]; then |
|||
(set -x; git clone https://github.com/ethereum/cpp-ethereum.git) |
|||
cd cpp-ethereum |
|||
(set -x; git checkout -b develop origin/develop) |
|||
cd .. |
|||
echo |
|||
fi |
|||
|
|||
# fetch CryptoPP-5.6.2 |
|||
if [ ! -d cryptopp ]; then |
|||
(set -x; git svn clone -r 541:541 http://svn.code.sf.net/p/cryptopp/code/trunk/c5 cryptopp) |
|||
echo |
|||
fi |
|||
|
|||
# fetch MiniUPnP-1.8 |
|||
if [ ! -d miniupnp ]; then |
|||
(set -x; git clone https://github.com/miniupnp/miniupnp.git) |
|||
cd miniupnp |
|||
(set -x; git checkout tags/miniupnpd_1_8) |
|||
cd .. |
|||
echo |
|||
fi |
|||
|
|||
# fetch LevelDB (windows branch) |
|||
if [ ! -d leveldb ]; then |
|||
(set -x; git clone https://code.google.com/p/leveldb/) |
|||
cd leveldb |
|||
(set -x; git checkout origin/windows) |
|||
cd .. |
|||
echo |
|||
fi |
|||
|
|||
# fetch and unpack boost-1.55 source |
|||
if [ ! -d boost ]; then |
|||
if [ ! -f _download/boost_1_55_0.7z ]; then |
|||
(set -x; mkdir -p _download) |
|||
(set -x; curl -o _download/boost_1_55_0.7z -L http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.7z/download) |
|||
fi |
|||
(set -x; 7z x _download/boost_1_55_0.7z) |
|||
(set -x; mv boost_1_55_0 boost) |
|||
echo |
|||
fi |
|||
|
|||
# fetch and unpack Qt 5.1.2 source |
|||
if [ ! -d Qt ]; then |
|||
if [ ! -f _download/qt-everywhere-opensource-src-5.2.1.zip ]; then |
|||
(set -x; mkdir -p _download) |
|||
(set -x; curl -o _download/qt-everywhere-opensource-src-5.2.1.zip -L http://download.qt-project.org/official_releases/qt/5.2/5.2.1/single/qt-everywhere-opensource-src-5.2.1.zip) |
|||
fi |
|||
(set -x; mkdir Qt) |
|||
cd Qt |
|||
(set -x; 7z x ../_download/qt-everywhere-opensource-src-5.2.1.zip) |
|||
(set -x; mv qt-everywhere-opensource-src-5.2.1 Src) |
|||
# patch qmake.conf to use the static CRT |
|||
(set -x; sed -i -e 's/-MD/-MT/g' Src/qtbase/mkspecs/win32-msvc2013/qmake.conf) |
|||
cd .. |
|||
echo |
|||
fi |
|||
|
|||
# fetch jom |
|||
if [ ! -f "Qt/jom/jom.exe" ]; then |
|||
if [ ! -f "_download/jom.zip" ]; then |
|||
(set -x; mkdir -p _download) |
|||
(set -x; curl -o "_download/jom.zip" -L http://download.qt-project.org/official_releases/jom/jom.zip) |
|||
fi |
|||
(set -x; mkdir -p Qt/jom) |
|||
cd Qt/jom |
|||
(set -x; 7z x ../../_download/jom.zip) |
|||
cd ../.. |
|||
echo |
|||
fi |
|||
|
|||
# fetch and unpack Lua binaries |
|||
if [ ! -d lua ]; then |
|||
if [ ! -f _download/lua-5.2.1_Win32_bin.zip ]; then |
|||
(set -x; mkdir -p _download) |
|||
(set -x; curl -o _download/lua-5.2.1_Win32_bin.zip -L http://sourceforge.net/projects/luabinaries/files/5.2.1/Executables/lua-5.2.1_Win32_bin.zip/download) |
|||
fi |
|||
(set -x; mkdir lua) |
|||
cd lua |
|||
(set -x; 7z x ../_download/lua-5.2.1_Win32_bin.zip lua52.exe lua52.dll) |
|||
(set -x; mv lua52.exe lua.exe) |
|||
cd .. |
|||
echo |
|||
fi |
|||
fi |
|||
|
|||
compile_boost() |
|||
{ |
|||
if [ $platform == "x64" ]; then |
|||
addressModel="address-model=64" |
|||
else |
|||
addressModel="" |
|||
fi |
|||
|
|||
if [ ! -d "stage/$platform" ]; then |
|||
targets="--with-filesystem --with-system --with-thread --with-date_time --with-regex" |
|||
(set -x; ./b2 -j4 --build-type=complete link=static runtime-link=static variant=debug,release threading=multi $addressModel $targets stage) |
|||
(set -x; mv stage/lib stage/$platform) |
|||
fi |
|||
} |
|||
|
|||
if [[ ! $@ ]] || [ $1 == "compile-boost" ]; then |
|||
# bootstrap if b2 is missing |
|||
cd boost |
|||
if [ ! -f "b2.exe" ]; then |
|||
(set -x; cmd.exe /c bootstrap.bat) |
|||
fi |
|||
|
|||
# compile boost for x86 and x64 |
|||
platform="x64"; compile_boost |
|||
platform="Win32"; compile_boost |
|||
cd .. |
|||
echo |
|||
fi |
|||
|
|||
compile_qt() |
|||
{ |
|||
if [ ! -d $platform ]; then |
|||
(set -x; cmd.exe /c "..\\cpp-ethereum\\windows\\compile_qt.bat $platform") |
|||
fi |
|||
} |
|||
|
|||
if [[ ! $@ ]] || [ $1 == "compile-qt" ]; then |
|||
# compile Qt for x86 and x64 |
|||
cd Qt |
|||
platform="x64"; compile_qt |
|||
platform="Win32"; compile_qt |
|||
cd .. |
|||
echo |
|||
fi |
|||
|
|||
# finally run MS build |
|||
cd cpp-ethereum/windows |
|||
cmd.exe /c "compile_ethereum.bat" |
|||
cd .. |
@ -0,0 +1,14 @@ |
|||
@echo off |
|||
rem @file compileqt.bat |
|||
rem @author Tim Hughes <tim@twistedfury.com> |
|||
rem @date 2014 |
|||
echo on |
|||
|
|||
rem : import VC environment |
|||
call "%VS120COMNTOOLS%\VsDevCmd.bat" |
|||
|
|||
rem : build for x64 |
|||
msbuild /maxcpucount /p:Configuration=Release;Platform=x64 Ethereum.sln |
|||
|
|||
rem : build for Win32 |
|||
msbuild /maxcpucount /p:Configuration=Release;Platform=Win32 Ethereum.sln |
@ -0,0 +1,41 @@ |
|||
@echo off |
|||
rem @file compileqt.bat |
|||
rem @author Tim Hughes <tim@twistedfury.com> |
|||
rem @date 2014 |
|||
|
|||
rem : enable use prefix if we want to produce standalone Qt binaries |
|||
rem : off by default since this takes longer and duplicates all the headers |
|||
set USE_PREFIX=0 |
|||
|
|||
rem : echo commands so we can see what's going on |
|||
echo on |
|||
|
|||
rem : select platform and toolset from first argument |
|||
IF %1%==x64 (set PLATFORM=x64&set TOOLSET=x86_amd64) ELSE (set PLATFORM=Win32&set TOOLSET=x86) |
|||
|
|||
rem : import VC environment vars |
|||
call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" %TOOLSET% |
|||
|
|||
rem : assume our root Qt dir is the current dir |
|||
set QT=%CD% |
|||
|
|||
rem : create the build folder and add the qtbase/bin folder to the PATH |
|||
if not exist %QT%\%PLATFORM% mkdir %QT%\%PLATFORM% |
|||
if %USE_PREFIX%==1 ( |
|||
if not exist %QT%\%PLATFORM%-Build mkdir %QT%\%PLATFORM%-Build |
|||
if not exist %QT%\%PLATFORM%\qtbase mkdir %QT%\%PLATFORM%\qtbase |
|||
cd %QT%\%PLATFORM%-Build |
|||
set QT_PREFIX=-prefix %Qt%\%PLATFORM%\qtbase |
|||
set QT_TARGETS=module-qtbase-install_subtargets |
|||
) else ( |
|||
cd %QT%\%PLATFORM% |
|||
set QT_PREFIX= |
|||
set QT_TARGETS=module-qtbase |
|||
) |
|||
set PATH=%CD%\qtbase\bin;%PATH% |
|||
|
|||
rem : run Qt configure with desired settings |
|||
call %QT%\Src\configure.bat -opensource -confirm-license %QT_PREFIX% -mp -opengl desktop -static -debug-and-release -platform win32-msvc2013 -nomake examples -nomake tests |
|||
|
|||
rem : compile and install module-qtbase |
|||
%QT%\jom\jom %QT_TARGETS% |
@ -0,0 +1,23 @@ |
|||
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
|||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
|||
|
|||
#ifndef STORAGE_LEVELDB_PORT_PORT_H_ |
|||
#define STORAGE_LEVELDB_PORT_PORT_H_ |
|||
|
|||
#include <string.h> |
|||
|
|||
// Include the appropriate platform specific file below. If you are
|
|||
// porting to a new platform, see "port_example.h" for documentation
|
|||
// of what the new port_<platform>.h file must provide.
|
|||
#if defined(LEVELDB_PLATFORM_POSIX) |
|||
# include "port/port_posix.h" |
|||
#elif defined(LEVELDB_PLATFORM_CHROMIUM) |
|||
# include "port/port_chromium.h" |
|||
#elif defined(LEVELDB_PLATFORM_ANDROID) |
|||
# include "port/port_android.h" |
|||
#elif defined(LEVELDB_PLATFORM_WINDOWS) |
|||
# include "port/port_win.h" |
|||
#endif |
|||
|
|||
#endif // STORAGE_LEVELDB_PORT_PORT_H_
|
@ -0,0 +1,14 @@ |
|||
/* $Id: miniupnpcstrings.h.in,v 1.4 2011/01/04 11:41:53 nanard Exp $ */ |
|||
/* Project: miniupnp
|
|||
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
|||
* Author: Thomas Bernard |
|||
* Copyright (c) 2005-2011 Thomas Bernard |
|||
* This software is subjects to the conditions detailed |
|||
* in the LICENCE file provided within this distribution */ |
|||
#ifndef MINIUPNPCSTRINGS_H_INCLUDED |
|||
#define MINIUPNPCSTRINGS_H_INCLUDED |
|||
|
|||
#define OS_STRING "Windows" |
|||
#define MINIUPNPC_VERSION_STRING "1.9" |
|||
|
|||
#endif |
@ -0,0 +1,38 @@ |
|||
|
|||
local function quote(x) |
|||
return '"' .. x .. '"' |
|||
end |
|||
|
|||
local function toForward(x) |
|||
return x:gsub('\\', '/') |
|||
end |
|||
|
|||
-- arguments are in this order |
|||
local cmd = arg[1] |
|||
local outFile = arg[2] |
|||
local includes = toForward(arg[3]) |
|||
local defines = arg[4] |
|||
local inFile = arg[5] |
|||
|
|||
-- build list of includes |
|||
local includes2 = "" |
|||
for i in string.gmatch(includes, "[^;]+") do |
|||
includes2 = includes2.." -I "..quote(i) |
|||
end |
|||
includes = includes2; |
|||
|
|||
-- build list of defines |
|||
local defines2 = "" |
|||
for i in string.gmatch(defines, "[^;]+") do |
|||
defines2 = defines2.." -D"..i |
|||
end |
|||
defines = defines2 |
|||
|
|||
-- moc doesn't compile boost correctly, so skip those headers |
|||
workarounds=' -DBOOST_MP_CPP_INT_HPP -DBOOST_THREAD_WEK01082003_HPP' |
|||
|
|||
-- build command |
|||
cmd = quote(cmd).." -o "..quote(outFile)..includes..defines..workarounds..' '..quote(inFile) |
|||
print(cmd) |
|||
os.execute(quote(cmd)) |
|||
|
@ -1,4 +1,4 @@ |
|||
// This file is autogenerated by qmake. It imports static plugin classes for
|
|||
// static plugins specified using QTPLUGIN and QT_PLUGIN_CLASS.<plugin> variables.
|
|||
#include <QtPlugin> |
|||
#include <QtCore/QtPlugin> |
|||
Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) |
|||
|
@ -0,0 +1,21 @@ |
|||
/*
|
|||
This file is part of cpp-ethereum. |
|||
|
|||
cpp-ethereum is free software: you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation, either version 3 of the License, or |
|||
(at your option) any later version. |
|||
|
|||
cpp-ethereum is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License |
|||
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
/** @file stdafx.cpp
|
|||
* @author Tim Hughes <tim@twistedfury.com> |
|||
* @date 2014 |
|||
*/ |
|||
|
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue