Documentation ¶
Index ¶
- Constants
- func GetCurrentHashTreeEpoch() uint64
- func GetTimeSinceHashTreeEpoch(epoch uint64) time.Duration
- func Sign(sigInput, signKey common.RawBytes, signAlgo string) (common.RawBytes, error)
- func Verify(sigInput, sig, verifyKey common.RawBytes, signAlgo string) error
- func VerifyHashTreeEpoch(epoch uint64) bool
Constants ¶
View Source
const ( Ed25519 = "ed25519" Curve25519xSalsa20Poly1305 = "curve25519xsalsa20poly1305" InvalidKeySize = "Invalid key size" UnsupportedSignAlgo = "Unsupported signing algorithm" InvalidSignature = "Invalid signature" )
View Source
const ( // HashTreeTTL is the TTL of one hash tree (in seconds). // FIXME(shitz): This should really be matching spath.MaxTTL, but more importantly, // it needs to match the hash tree ttl used by the BS, which is currently set to 30 mins. HashTreeTTL = 30 * 60 * time.Second // HashTreeEpochTime is the duration of one epoch (in seconds). HashTreeEpochTime = 10 * time.Second // HashTreeEpochTolerance is the duration after a revocation expired within which a // revocation is still accepted by a verifier. HashTreeEpochTolerance = 2 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func GetCurrentHashTreeEpoch ¶
func GetCurrentHashTreeEpoch() uint64
GetCurrentHashTreeEpoch returns the current epoch ID.
func GetTimeSinceHashTreeEpoch ¶
GetTimeSinceHashTreeEpoch returns the time since the start of epoch.
func Sign ¶
Sign takes a signature input and a signing key to create a signature. Currently only ed25519 is supported
func Verify ¶
Verify takes a signature input and a verifying key and returns an error, if the signature does not match. Currently only ed25519 is supported.
func VerifyHashTreeEpoch ¶
VerifyHashTreeEpoch verifies a given hash tree epoch. An epoch is valid if it is equal to the current epoch or within the tolerance limit of the next epoch.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.