Versions in this module Expand all Collapse all v0 v0.1.0 Jun 18, 2024 Changes in this version + const PrivateEKPEMTypeString + const PrivateIKPEMTypeString + const PrivateKeyFileMode + const PublicEKPEMTypeString + const PublicIKPEMTypeString + const PublicKeyFileMode + const StageKeySize + func CoPath(root *PublicNode, idx int, copathNodes []*ecdh.PublicKey) []*ecdh.PublicKey + func DHKeyGen() (*ecdh.PrivateKey, error) + func DeriveLeafKey(ekPath string, suk *ecdh.PublicKey) (*ecdh.PrivateKey, error) + func DeriveLeafKeyOrFail(privKeyFile string, setupKey *ecdh.PublicKey) *ecdh.PrivateKey + func DeriveStageKey(skInfo *StageKeyInfo) ([]byte, error) + func GetPublicKeys(pathKeys []*ecdh.PrivateKey) []*ecdh.PublicKey + func KeyExchange(sk *ecdh.PrivateKey, pk *ecdh.PublicKey) ([]byte, error) + func KeyExchangeKeyGen() (*ecdh.PrivateKey, error) + func MarshalPrivateEKToDER(key *ecdh.PrivateKey) ([]byte, error) + func MarshalPrivateEKToPEM(key *ecdh.PrivateKey) ([]byte, error) + func MarshalPrivateEKToRaw(key *ecdh.PrivateKey) ([]byte, error) + func MarshalPrivateIKToDER(key ed25519.PrivateKey) ([]byte, error) + func MarshalPrivateIKToPEM(key ed25519.PrivateKey) ([]byte, error) + func MarshalPrivateIKToRaw(key ed25519.PrivateKey) ([]byte, error) + func MarshalPublicEKToDER(key *ecdh.PublicKey) ([]byte, error) + func MarshalPublicEKToPEM(key *ecdh.PublicKey) ([]byte, error) + func MarshalPublicEKToRaw(key *ecdh.PublicKey) ([]byte, error) + func MarshalPublicIKToDER(key ed25519.PublicKey) ([]byte, error) + func MarshalPublicIKToPEM(key ed25519.PublicKey) ([]byte, error) + func MarshalPublicIKToRaw(key ed25519.PublicKey) ([]byte, error) + func MarshallTreeState(state *TreeState) *treeJson + func NewHMAC(key []byte) hash.Hash + func PathNodeKeys(leafKey *ecdh.PrivateKey, copathKeys []*ecdh.PublicKey) ([]*ecdh.PrivateKey, error) + func ReadPrivateEKFromFile(path string, encoding KeyEncoding) (*ecdh.PrivateKey, error) + func ReadPrivateIKFromFile(path string, encoding KeyEncoding) (ed25519.PrivateKey, error) + func ReadPublicEKFromFile(path string, encoding KeyEncoding) (*ecdh.PublicKey, error) + func ReadPublicIKFromFile(path string, encoding KeyEncoding) (ed25519.PublicKey, error) + func SetupGroup(configFile, initiator string) (*TreeState, *SetupMessage) + func SignFile(privIKFile string, msgFile string) ([]byte, error) + func UnmarshalPrivateEKFromDER(derData []byte) (*ecdh.PrivateKey, error) + func UnmarshalPrivateEKFromPEM(pemData []byte) (*ecdh.PrivateKey, error) + func UnmarshalPrivateEKFromRaw(data []byte) (*ecdh.PrivateKey, error) + func UnmarshalPrivateIKFromDER(derData []byte) (ed25519.PrivateKey, error) + func UnmarshalPrivateIKFromPEM(pemData []byte) (ed25519.PrivateKey, error) + func UnmarshalPrivateIKFromRaw(data []byte) (ed25519.PrivateKey, error) + func UnmarshalPrivateX25519FromRaw(data []byte) (*ecdh.PrivateKey, error) + func UnmarshalPublicEKFromDER(derData []byte) (*ecdh.PublicKey, error) + func UnmarshalPublicEKFromPEM(pemData []byte) (*ecdh.PublicKey, error) + func UnmarshalPublicEKFromRaw(data []byte) (*ecdh.PublicKey, error) + func UnmarshalPublicIKFromDER(derData []byte) (ed25519.PublicKey, error) + func UnmarshalPublicIKFromPEM(pemData []byte) (ed25519.PublicKey, error) + func UnmarshalPublicIKFromRaw(data []byte) (ed25519.PublicKey, error) + func UnmarshallPublicKeys(pathKeys [][]byte) []*ecdh.PublicKey + func UpdateCoPathNodes(index int, state *TreeState) []*ecdh.PrivateKey + func UpdateKey(index int, treeStateFile string) (*UpdateMessage, *TreeState, *ed25519.PrivateKey) + func VerifyMessageSignature(publicKeyPath, msgFile, sigFile string) + func VerifySignature(pkPath, msgFile, sigFile string) (bool, error) + func WritePrivateEKToFile(key *ecdh.PrivateKey, path string, encoding KeyEncoding) error + func WritePrivateIKToFile(key ed25519.PrivateKey, path string, encoding KeyEncoding) error + func WritePublicEKToFile(key *ecdh.PublicKey, path string, encoding KeyEncoding) error + func WritePublicIKToFile(key ed25519.PublicKey, path string, encoding KeyEncoding) error + type Group struct + type KeyEncoding int + const EncodingDER + const EncodingPEM + const EncodingRaw + const EncodingUnknown + func StringToKeyEncoding(keyform string) (KeyEncoding, error) + type Member struct + type Node struct + func CreateTree(leafKeys []*ecdh.PrivateKey) (*Node, error) + func UnmarshalKeysToPrivateTree(marshalledKeys [][]byte) (*Node, error) + func (Node *Node) GetSk() *ecdh.PrivateKey + func (node *Node) MarshalKeys() ([][]byte, error) + func (node *Node) PublicKeys() *PublicNode + type PublicNode struct + Height int + Left *PublicNode + Right *PublicNode + func UnmarshalKeysToPublicTree(marshalledKeys [][]byte) (*PublicNode, error) + func UpdatePublicTree(pathKeys []*ecdh.PublicKey, root *PublicNode, idx int) *PublicNode + func (publicNode *PublicNode) GetPk() *ecdh.PublicKey + func (publicNode *PublicNode) MarshalKeys() ([][]byte, error) + func (publicNode *PublicNode) UpdatePk(newPK *ecdh.PublicKey) + type SetupMessage struct + EKeys [][]byte + IKeys [][]byte + Suk []byte + TreeKeys [][]byte + func (sm *SetupMessage) Decode(file *os.File) + func (sm *SetupMessage) DeriveStageKey(treeSecret *ecdh.PrivateKey) []byte + func (sm *SetupMessage) GetPublicTree() *PublicNode + func (sm *SetupMessage) GetSetupKey() *ecdh.PublicKey + func (sm *SetupMessage) Read(msgFilePath string) + func (sm *SetupMessage) Save(fileName string) + func (sm *SetupMessage) SaveSign(sigFile, msgFile, privIKFile string) + type StageKeyInfo struct + IKeys [][]byte + PrevStageKey []byte + TreeKeys [][]byte + TreeSecretKey []byte + func (skInfo *StageKeyInfo) GetIKM() []byte + func (skInfo *StageKeyInfo) GetInfo() []byte + type TreeState struct + IKeys [][]byte + Lk *ecdh.PrivateKey + PublicTree *PublicNode + Sk ed25519.PrivateKey + func ProcessSetupMessage(index int, privEKFile, setupMsgFile, initiatorPubIKFile, sigFile string) *TreeState + func ProcessUpdateMessage(index int, treeStateFile, updateMsgFile, macFile string) *TreeState + func ReadTreeState(treeStateFile string) *TreeState + func UnMarshallTreeState(tree *treeJson) *TreeState + func (state *TreeState) DeriveStageKey(treeSecret *ecdh.PrivateKey) + func (treeState *TreeState) DeriveTreeKey(index int) *ecdh.PrivateKey + func (treeState *TreeState) Read(treeStateFile string) + func (treeState *TreeState) Save(fileName string) + func (treeState *TreeState) SaveStageKey(fileName string) + func (treeState *TreeState) StageKey() ed25519.PrivateKey + func (treeState *TreeState) UnMarshallTreeState(tree *treeJson) + type UpdateMessage struct + Idx int + PathPublicKeys [][]byte + func CreateUpdateMessage(index int, pathKeys []*ecdh.PrivateKey) UpdateMessage + func (um *UpdateMessage) Decode(file *os.File) + func (um *UpdateMessage) Read(msgFilePath string) + func (um *UpdateMessage) Save(fileName string) + func (um *UpdateMessage) SaveMac(sk ed25519.PrivateKey, macFile string) + func (um *UpdateMessage) VerifyUpdateMessage(sk ed25519.PrivateKey, macFile string)