Documentation
¶
Overview ¶
Package ed25519 holds the strict Ed25519 rule of SPEC.md section 6.2 (Strict verification) for the new verifier: CheckKeyBytes, the checks of a key's bytes (this file), and Verify, Verify(A, msg, S), which makes them and then calls Go's crypto/ed25519 (verify.go).
This file holds the checks of a key's bytes of SPEC.md section 6.2: steps 2 and 3 of Verify(A, msg, S), which a verifier also makes outside Verify, on K at ENVELOPE (SPEC.md section 10.2, step 3), on each key of a keyring it loads (step 0), and on each key event's public_key at DERIVE. Go's crypto/ed25519 makes neither step, so they are made here, before any library is called.
A key is a [32]byte, so a key of any other length cannot be passed; y is compared with p through math/big; and SMALL_ORDER_KEYS is internal/specdata's transcription of spec/small-order-keys.json, which specdata's tests hold to the file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrYNotBelowP is step 2: y, the key read as a little-endian integer // with its highest bit cleared, is not below p = 2^255 - 19. ErrYNotBelowP = errors.New("y_not_below_p") // ErrSmallOrderKey is step 3: the key is one of SMALL_ORDER_KEYS. ErrSmallOrderKey = errors.New("small_order_key") )
The refusals of the checks of a key's bytes, by the step of SPEC.md section 6.2 that refuses.
var ( // ErrNotOnCurve is step 4: no point of the curve has the encoding A. ErrNotOnCurve = errors.New("not_on_curve") // ErrSNotBelowL is step 5: s is not below L. ErrSNotBelowL = errors.New("s_not_below_l") // ErrEquation is step 7: the encoding of [s]B - [k]A is not R. ErrEquation = errors.New("equation") )
The refusals of Verify past the checks of a key's bytes, by the step of SPEC.md section 6.2 that refuses.
Functions ¶
func CheckKeyBytes ¶
CheckKeyBytes makes steps 2 and 3 of SPEC.md section 6.2 on key, in that order: nil when key passes both, and otherwise ErrYNotBelowP or ErrSmallOrderKey, the first that refuses.
func Verify ¶
Verify is Verify(A, msg, S) of SPEC.md section 6.2: nil when the 64 octets signature verify under the 32-octet public key key over message, and otherwise the refusal of the first step that fails: ErrYNotBelowP, ErrSmallOrderKey, ErrNotOnCurve, ErrSNotBelowL or ErrEquation. Every message Truestamp signs is 32 octets (section 4.1), but the rule holds for any.
Types ¶
This section is empty.