Documentation ¶
Index ¶
- Constants
- Variables
- func ReceiverChoose(receiverPrivateKey *ecdsa.PrivateKey, senderPublicKey *ecdsa.PublicKey, ...) (*ecdsa.PublicKey, error)
- func ReceiverRetrieveMsg(receiverPrivateKey *ecdsa.PrivateKey, senderPublicKey *ecdsa.PublicKey, ...) (string, error)
- func SenderEncryptMsg(senderPrivateKey *ecdsa.PrivateKey, receiverPublicKey *ecdsa.PublicKey, ...) ([]string, error)
Constants ¶
View Source
const ( IndexOne = iota IndexTwo )
message index
Variables ¶
View Source
var (
IndexError = errors.New("chosenIndex is invalid. Must be 0 or 1")
)
Functions ¶
func ReceiverChoose ¶
func ReceiverChoose(receiverPrivateKey *ecdsa.PrivateKey, senderPublicKey *ecdsa.PublicKey, chosenIndex int) (*ecdsa.PublicKey, error)
ReceiverChoose 接收方Bob选择需要哪份数据,也就是做1 of 2选择
func ReceiverRetrieveMsg ¶
func ReceiverRetrieveMsg(receiverPrivateKey *ecdsa.PrivateKey, senderPublicKey *ecdsa.PublicKey, cts []string, chosenIndex int) (string, error)
ReceiverRetrieveMsg Bob根据之前的选择结果,解密并获取自己需要的数据
func SenderEncryptMsg ¶
func SenderEncryptMsg(senderPrivateKey *ecdsa.PrivateKey, receiverPublicKey *ecdsa.PublicKey, msgs []string) ([]string, error)
SenderEncryptMsg 发送方Alice根据接收方Bob发来的公钥,做进一步计算
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.