mirror of
				https://github.com/PurpleI2P/i2pd.git
				synced 2025-11-04 08:30:46 +00:00 
			
		
		
		
	Add constructor from keypair for EDDSA25519Signer.
This commit is contained in:
		
							parent
							
								
									eabf434a48
								
							
						
					
					
						commit
						22f9380d49
					
				
					 2 changed files with 13 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -28,6 +28,11 @@ size_t EDDSA25519Verifier::GetSignatureLen() const
 | 
			
		|||
    return EDDSA25519_SIGNATURE_LENGTH;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
EDDSA25519Signer::EDDSA25519Signer(const uint8_t* signingPrivateKey, const uint8_t* signingPublicKey)
 | 
			
		||||
{
 | 
			
		||||
    std::memcpy(m_PrivateKey, signingPrivateKey, EDDSA25519_PRIVATE_KEY_LENGTH);
 | 
			
		||||
    std::memcpy(m_PublicKey, signingPublicKey, EDDSA25519_PUBLIC_KEY_LENGTH);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
EDDSA25519Signer::EDDSA25519Signer(const uint8_t* signingPrivateKey)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -29,9 +29,15 @@ class EDDSA25519Signer : public Signer {
 | 
			
		|||
public:
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @todo allow passing the public key too as an optimization
 | 
			
		||||
     * Construct from a key pair.
 | 
			
		||||
     */
 | 
			
		||||
    EDDSA25519Signer(const uint8_t * signingPrivateKey);
 | 
			
		||||
    EDDSA25519Signer(const uint8_t* signingPrivateKey, const uint8_t* signingPublicKey);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Construct from a private key.
 | 
			
		||||
     * The corresponding public key will be computed from it.
 | 
			
		||||
     */
 | 
			
		||||
    EDDSA25519Signer(const uint8_t* signingPrivateKey);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @todo do not pass random number generator, EdDSA does not require a random
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue