handshake and Ed25519 refactorings