Documentation
¶
Index ¶
- Variables
- func ConvertToSHA256(input []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 FileSystem
- type PSK
- type PrivateKey
- type SampleLocation
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoSampleFiles = errors.New("challenge: no usable files or subdirectories") ErrEmptySampleLine = errors.New("empty sample line found") ErrNoNonEmptySampleLines = errors.New("no non-empty lines found") ErrSampleIndexOutOfBounds = errors.New("sample index out of bounds") ErrInvalidSubstringBounds = errors.New("invalid substring bounds") )
View Source
var ( ErrPSKNetwrokRequired = errors.New("psk: network required") ErrPSKVersionRequired = errors.New("psk: version required") )
View Source
var ErrEmptySeed = errors.New("empty seed")
View Source
var ErrInvalidStackSize = errors.New("challenge: invalid file stack size - expected 4 elements")
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 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.