* minor fixes

This commit is contained in:
Scott Powell 2025-01-15 00:39:32 +11:00
parent a05b951018
commit daa157cf49
3 changed files with 12 additions and 5 deletions

View file

@ -63,8 +63,8 @@ void LocalIdentity::sign(uint8_t* sig, const uint8_t* message, int msg_len) cons
ed25519_sign(sig, message, msg_len, pub_key, prv_key);
}
void LocalIdentity::calcSharedSecret(uint8_t* secret, const Identity& other) {
ed25519_key_exchange(secret, other.pub_key, prv_key);
void LocalIdentity::calcSharedSecret(uint8_t* secret, const uint8_t* other_pub_key) {
ed25519_key_exchange(secret, other_pub_key, prv_key);
}
}

View file

@ -64,7 +64,14 @@ public:
* \param secret OUT - the 'shared secret' (must be PUB_KEY_SIZE bytes)
* \param other IN - the second party in the exchange.
*/
void calcSharedSecret(uint8_t* secret, const Identity& other);
void calcSharedSecret(uint8_t* secret, const Identity& other) { calcSharedSecret(secret, other.pub_key); }
/**
* \brief the ECDH key exhange, with Ed25519 public key transposed to Ex25519.
* \param secret OUT - the 'shared secret' (must be PUB_KEY_SIZE bytes)
* \param other_pub_key IN - the public key of second party in the exchange (must be PUB_KEY_SIZE bytes)
*/
void calcSharedSecret(uint8_t* secret, const uint8_t* other_pub_key);
bool readFrom(Stream& s);
bool writeTo(Stream& s) const;