mirror of
				https://github.com/PurpleI2P/i2pd.git
				synced 2025-11-04 08:30:46 +00:00 
			
		
		
		
	restructure build to separate the 3 main components into 3 subdirectories
libi2pd for core libs libi2pd_client for i2pd client libs daemon for i2pd daemon libs
This commit is contained in:
		
							parent
							
								
									b3161dde93
								
							
						
					
					
						commit
						4cc3b7f9fb
					
				
					 140 changed files with 209 additions and 206 deletions
				
			
		| 
						 | 
				
			
			@ -1,19 +1,19 @@
 | 
			
		|||
CXXFLAGS += -Wall -Wextra -pedantic -O0 -g -std=c++11 -D_GLIBCXX_USE_NANOSLEEP=1
 | 
			
		||||
CXXFLAGS += -Wall -Wextra -pedantic -O0 -g -std=c++11 -D_GLIBCXX_USE_NANOSLEEP=1 -I../libi2pd/ -pthread
 | 
			
		||||
 | 
			
		||||
TESTS = test-gost test-gost-sig test-base-64
 | 
			
		||||
 | 
			
		||||
all: $(TESTS) run
 | 
			
		||||
 | 
			
		||||
test-http-%: ../HTTP.cpp test-http-%.cpp
 | 
			
		||||
test-http-%: ../libi2pd/HTTP.cpp test-http-%.cpp
 | 
			
		||||
	$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) -o $@ $^
 | 
			
		||||
 | 
			
		||||
test-base-%: ../Base.cpp test-base-%.cpp
 | 
			
		||||
test-base-%: ../libi2pd/Base.cpp test-base-%.cpp
 | 
			
		||||
	$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) -o $@ $^
 | 
			
		||||
 | 
			
		||||
test-gost: ../Gost.cpp ../I2PEndian.cpp test-gost.cpp
 | 
			
		||||
test-gost: ../libi2pd/Gost.cpp ../libi2pd/I2PEndian.cpp test-gost.cpp
 | 
			
		||||
	$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) -o $@ $^ -lcrypto
 | 
			
		||||
 | 
			
		||||
test-gost-sig: ../Gost.cpp ../I2PEndian.cpp ../Signature.cpp ../Crypto.cpp ../Log.cpp test-gost-sig.cpp
 | 
			
		||||
test-gost-sig: ../libi2pd/Gost.cpp ../libi2pd/I2PEndian.cpp ../libi2pd/Signature.cpp ../libi2pd/Crypto.cpp ../libi2pd/Log.cpp test-gost-sig.cpp
 | 
			
		||||
	$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) -o $@ $^ -lcrypto -lssl -lboost_system
 | 
			
		||||
 | 
			
		||||
run: $(TESTS)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
#include <cassert>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
#include "../Base.h"
 | 
			
		||||
#include "Base.h"
 | 
			
		||||
 | 
			
		||||
using namespace i2p::data;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,8 +2,8 @@
 | 
			
		|||
#include <inttypes.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
#include "../Gost.h"
 | 
			
		||||
#include "../Signature.h"
 | 
			
		||||
#include "Gost.h"
 | 
			
		||||
#include "Signature.h"
 | 
			
		||||
 | 
			
		||||
const uint8_t example2[72] =
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -30,6 +30,3 @@ int main ()
 | 
			
		|||
	i2p::crypto::GOSTR3410_256_Verifier verifier1 (i2p::crypto::eGOSTR3410CryptoProA, pub);
 | 
			
		||||
	assert (verifier1.Verify (example2, 72, signature));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,7 +2,7 @@
 | 
			
		|||
#include <inttypes.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 | 
			
		||||
#include "../Gost.h"
 | 
			
		||||
#include "Gost.h"
 | 
			
		||||
 | 
			
		||||
const uint8_t example1[63] =
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -51,19 +51,16 @@ const uint8_t example2_hash_256[32] =
 | 
			
		|||
 | 
			
		||||
int main ()
 | 
			
		||||
{
 | 
			
		||||
	uint8_t digest[64];	
 | 
			
		||||
	i2p::crypto::GOSTR3411_2012_512 (example1, 63, digest);	
 | 
			
		||||
	uint8_t digest[64];
 | 
			
		||||
	i2p::crypto::GOSTR3411_2012_512 (example1, 63, digest);
 | 
			
		||||
	assert(memcmp (digest, example1_hash_512, 64) == 0);
 | 
			
		||||
 | 
			
		||||
	i2p::crypto::GOSTR3411_2012_256 (example1, 63, digest);	
 | 
			
		||||
	i2p::crypto::GOSTR3411_2012_256 (example1, 63, digest);
 | 
			
		||||
	assert(memcmp (digest, example1_hash_256, 32) == 0);
 | 
			
		||||
 | 
			
		||||
	i2p::crypto::GOSTR3411_2012_512 (example2, 72, digest);	
 | 
			
		||||
	i2p::crypto::GOSTR3411_2012_512 (example2, 72, digest);
 | 
			
		||||
	assert(memcmp (digest, example2_hash_512, 64) == 0);
 | 
			
		||||
 | 
			
		||||
	i2p::crypto::GOSTR3411_2012_256 (example2, 72, digest);	
 | 
			
		||||
	i2p::crypto::GOSTR3411_2012_256 (example2, 72, digest);
 | 
			
		||||
	assert(memcmp (digest, example2_hash_256, 32) == 0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue