Documentation
¶
Index ¶
Constants ¶
View Source
const CHUNK_SIZE = 8192 * 2
View Source
const ECDH_PUBKEY_SIZE = 65
65 for P-256, 32 for X25519
View Source
const PBKDF_ITERATIONS = 100000
View Source
const SALT_SIZE = 32
Variables ¶
This section is empty.
Functions ¶
func GenerateEcdhKeypair ¶
func GenerateEcdhKeypair() (*ecdh.PrivateKey, error)
func GenreateSalt ¶
func ShareCodeHash ¶
Types ¶
type GcmService ¶
type GcmService struct {
// contains filtered or unexported fields
}
func NewGcmService ¶
func NewGcmService(priKey *ecdh.PrivateKey, pubKey *ecdh.PublicKey, discoverPhrase string) (*GcmService, error)
type HmacService ¶
type HmacService struct {
// contains filtered or unexported fields
}
func NewHmacService ¶
func NewHmacService(shareCode string) *HmacService
func (*HmacService) Sign ¶
func (h *HmacService) Sign(data, salt []byte) []byte
func (*HmacService) Verify ¶
func (h *HmacService) Verify(data, signature, salt []byte) bool
Click to show internal directories.
Click to hide internal directories.