Documentation
¶
Overview ¶
Package vectors generates the golden vectors under testdata/vectors from the boxrec codec. Every input is fixed, so a run writes the same bytes every time; TestVectors regenerates them and compares byte for byte.
Index ¶
Constants ¶
const Office = "example_office_qzxkvbmwtr"
Office is the vectors' office identifier: the readable part "example_office" and a fixed example suffix. A real office draws its suffix at random (boxrec.NewOffice); a vector fixes one so it is reproducible.
const OtherOffice = "example_office_hdjvnwpxle"
OtherOffice shares Office's readable part under another suffix: a different office, and a different topic.
Variables ¶
var ( SenderKey = bytes.Repeat([]byte{0x42}, 32) RecipientKey = bytes.Repeat([]byte{0x43}, 32) )
SenderKey and RecipientKey are the test keys: 32 bytes of 0x42 and of 0x43. Both are public and must never hold anything real.
var OtherKey = bytes.Repeat([]byte{0x44}, 32)
OtherKey is a third test key, 32 bytes of 0x44: an identity that is neither the sender nor the recipient. Public, never for real use.
Functions ¶
func BRC78 ¶
BRC78 encrypts plaintext from sender to recipient exactly as BRC-78 and go-sdk's message.Encrypt do, but with the key id and the IV given rather than drawn, so the vector is reproducible. The tests decrypt every result with go-sdk's message.Decrypt and through the recipient's wallet.
Types ¶
type Headers ¶
Headers is the test chain's block headers: a merkle root per height. It is the chain tracker the vectors are admitted against.
func (Headers) CurrentHeight ¶
CurrentHeight is the highest height held.