nip44

package module
v0.0.0-...-6a3d864 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 15 Imported by: 3

README

NIP-44 implementation in Go

NIP-44 specification: https://github.com/nostr-protocol/nips/blob/master/44.md

To use as library: go get -u github.com/ekzyis/nip44

To run tests, clone repository and then run go test.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MinPlaintextSize = 0x0001 // 1b msg => padded to 32b
	MaxPlaintextSize = 0xffff // 65535 (64kb-1) => padded to 64kb
)

Functions

func Decrypt

func Decrypt(conversationKey []byte, ciphertext string) (string, error)

func Encrypt

func Encrypt(conversationKey []byte, plaintext string, options *EncryptOptions) (string, error)

func GenerateConversationKey

func GenerateConversationKey(sendPrivkey []byte, recvPubkey []byte) ([]byte, error)

Types

type EncryptOptions

type EncryptOptions struct {
	Salt    []byte
	Version int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL