Documentation
¶
Index ¶
- func ConvertToSHA256(string []byte) []byte
- func EncryptAES(plainData, password []byte) ([]byte, error)
- func GenerateKeyFromSeed(seed []byte) (ed25519.PrivateKey, error)
- func GetCodebaseHashHex(codebase FileSystem) (string, error)
- func ResolveChallenge(codebase FileSystem, location SampleLocation, nonce int64) ([]byte, error)
- func Sign(privKey, body []byte) string
- func VerifySignature(pubKey, body []byte, signatureStr string) error
- type DiffieHellmanEncrypter
- func (e *DiffieHellmanEncrypter) ComputeSharedSecret(clientPublicKeyBytes, salt []byte) error
- func (e *DiffieHellmanEncrypter) DecryptMessage(encryptedMessage []byte) ([]byte, error)
- func (e *DiffieHellmanEncrypter) EncryptMessage(plaintext []byte) ([]byte, error)
- func (e *DiffieHellmanEncrypter) PublicKey() []byte
- type FileSystem
- type PSK
- type PrivateKey
- type SampleLocation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToSHA256 ¶
func EncryptAES ¶
func GenerateKeyFromSeed ¶
func GenerateKeyFromSeed(seed []byte) (ed25519.PrivateKey, error)
func GetCodebaseHashHex ¶ added in v0.3.9
func GetCodebaseHashHex(codebase FileSystem) (string, error)
func ResolveChallenge ¶ added in v0.2.476
func ResolveChallenge(codebase FileSystem, location SampleLocation, nonce int64) ([]byte, error)
func VerifySignature ¶ added in v0.4.18
Types ¶
type DiffieHellmanEncrypter ¶
type DiffieHellmanEncrypter struct {
// contains filtered or unexported fields
}
func NewDiffieHellmanEncrypter ¶
func NewDiffieHellmanEncrypter() (*DiffieHellmanEncrypter, error)
func (*DiffieHellmanEncrypter) ComputeSharedSecret ¶
func (e *DiffieHellmanEncrypter) ComputeSharedSecret(clientPublicKeyBytes, salt []byte) error
func (*DiffieHellmanEncrypter) DecryptMessage ¶
func (e *DiffieHellmanEncrypter) DecryptMessage(encryptedMessage []byte) ([]byte, error)
DecryptMessage a message using AES-GCM
func (*DiffieHellmanEncrypter) EncryptMessage ¶
func (e *DiffieHellmanEncrypter) EncryptMessage(plaintext []byte) ([]byte, error)
Encrypt a message using AES-GCM
func (*DiffieHellmanEncrypter) PublicKey ¶
func (e *DiffieHellmanEncrypter) PublicKey() []byte
type FileSystem ¶
type PrivateKey ¶
type SampleLocation ¶ added in v0.2.476
type SampleLocation struct {
DirStack []int // every index is level and value is dir num
FileStack []int // file index, line index, left line border, right line border
}
func GenerateChallenge ¶ added in v0.2.476
func GenerateChallenge(codebase FileSystem, nonce int64) ([]byte, SampleLocation, error)
Click to show internal directories.
Click to hide internal directories.