Documentation ¶
Index ¶
- func ComputeDirectoryIdentity(str *protocol.DirSTR) [crypto.HashSizeByte]byte
- type AudState
- func (a *AudState) AuditDirectory(strs []*protocol.DirSTR) error
- func (a *AudState) CheckSTRAgainstVerified(str *protocol.DirSTR) error
- func (a *AudState) Update(newSTR *protocol.DirSTR)
- func (a *AudState) VerifiedSTR() *protocol.DirSTR
- func (a *AudState) Verify(message, sig []byte) bool
- func (a *AudState) VerifySTRRange(prevSTR *protocol.DirSTR, strs []*protocol.DirSTR) error
- type Auditor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeDirectoryIdentity ¶
func ComputeDirectoryIdentity(str *protocol.DirSTR) [crypto.HashSizeByte]byte
ComputeDirectoryIdentity returns the hash of the directory's initial STR as a byte array. It panics if the STR isn't an initial STR (i.e. str.Epoch != 0).
Types ¶
type AudState ¶
type AudState struct {
// contains filtered or unexported fields
}
AudState verifies the hash chain of a specific directory.
func (*AudState) AuditDirectory ¶
AuditDirectory validates a range of STRs received from a CONIKS directory. AuditDirectory() checks the consistency of the oldest STR in the range against the verifiedSTR, and verifies the remaining range if the message contains more than one STR. AuditDirectory() returns the appropriate consistency check error if any of the checks fail, or nil if the checks pass.
func (*AudState) CheckSTRAgainstVerified ¶
CheckSTRAgainstVerified checks an STR str against the a.verifiedSTR. If str's Epoch is the same as the verified, CheckSTRAgainstVerified() compares the two STRs directly. If str is one epoch ahead of the a.verifiedSTR, CheckSTRAgainstVerified() checks the consistency between the two STRs. CheckSTRAgainstVerified() returns nil if the check passes, or the appropriate consistency check error if any of the checks fail, or str's epoch is anything other than the same or one ahead of a.verifiedSTR.
func (*AudState) VerifiedSTR ¶
VerifiedSTR returns the newly verified STR.
func (*AudState) Verify ¶
Verify verifies a signature sig on message using the underlying public-key of the AudState.
func (*AudState) VerifySTRRange ¶
VerifySTRRange checks the consistency of a range of a directory's STRs. It begins by verifying the STR consistency between the given prevSTR and the first STR in the given range, and then verifies the consistency between each subsequent STR pair.