nip46: support decrypting with nip44.

This commit is contained in:
fiatjaf
2024-05-20 09:20:39 -03:00
parent abe84f9089
commit 7578bf6c71
3 changed files with 21 additions and 4 deletions

View File

@@ -56,8 +56,14 @@ func (p *StaticKeySigner) getOrCreateSession(clientPubkey string) (Session, erro
return Session{}, fmt.Errorf("failed to compute shared secret: %w", err)
}
ck, err := nip44.GenerateConversationKey(clientPubkey, p.secretKey)
if err != nil {
return Session{}, fmt.Errorf("failed to compute shared secret: %w", err)
}
session := Session{
SharedKey: shared,
SharedKey: shared,
ConversationKey: ck,
}
// add to pool