mirror of
				https://github.com/PurpleI2P/i2pd.git
				synced 2025-11-04 08:30:46 +00:00 
			
		
		
		
	compute IdentHash in Identity method
This commit is contained in:
		
							parent
							
								
									19333d5697
								
							
						
					
					
						commit
						a82bd628c1
					
				
					 2 changed files with 10 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -24,6 +24,13 @@ namespace data
 | 
			
		|||
	{
 | 
			
		||||
		size_t count = Base64ToByteStream (s.c_str(), s.length(), reinterpret_cast<uint8_t*> (this), sizeof (Identity));
 | 
			
		||||
		return count == sizeof(Identity);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	IdentHash Identity::Hash()
 | 
			
		||||
	{
 | 
			
		||||
		IdentHash hash;
 | 
			
		||||
		CryptoPP::SHA256().CalculateDigest(reinterpret_cast<uint8_t*>(&hash), reinterpret_cast<uint8_t*> (this), sizeof (Identity));
 | 
			
		||||
		return hash;
 | 
			
		||||
	}	
 | 
			
		||||
	
 | 
			
		||||
	PrivateKeys& PrivateKeys::operator=(const Keys& keys)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,6 +9,8 @@ namespace i2p
 | 
			
		|||
{
 | 
			
		||||
namespace data
 | 
			
		||||
{
 | 
			
		||||
	class IdentHash;
 | 
			
		||||
 | 
			
		||||
#pragma pack(1)
 | 
			
		||||
 | 
			
		||||
	struct DHKeysPair // transient keys for transport sessions
 | 
			
		||||
| 
						 | 
				
			
			@ -33,6 +35,7 @@ namespace data
 | 
			
		|||
 | 
			
		||||
		Identity& operator=(const Keys& keys);
 | 
			
		||||
		bool FromBase64(const std::string&);
 | 
			
		||||
		IdentHash Hash();
 | 
			
		||||
	};	
 | 
			
		||||
	
 | 
			
		||||
	struct PrivateKeys // for eepsites
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue