Skip to content

Commit

Permalink
clarify decrypt function comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivia Thet committed Mar 11, 2024
1 parent 7d81613 commit 83c7615
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/enclave_encrypt/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (c *EnclaveEncryptClient) Encrypt(plaintext Bytes, msg ServerTargetMsg) (*C
}, nil
}

// Decrypt a message from the server.
// Decrypt a message from the server. This is used in private key and wallet export flows.
func (c *EnclaveEncryptClient) Decrypt(msg ServerSendMsg) (plaintext []byte, err error) {
if !P256Verify(c.enclaveAuthKey, *msg.EncappedPublic, *msg.EncappedPublicSignature) {
return nil, errors.New("invalid enclave auth key signature")
Expand All @@ -84,7 +84,7 @@ func (c *EnclaveEncryptClient) TargetPublic() ([]byte, error) {
return c.targetPrivate.Public().MarshalBinary()
}

// Decrypt a message from the server.
// Decrypt a base58-encoded payload from the server. This is used in email authentication and email recovery flows.
func (c *EnclaveEncryptClient) AuthDecrypt(payload string) (plaintext []byte, err error) {
payloadBytes := base58.Decode(payload)
err = ValidateChecksum(payloadBytes)
Expand Down

0 comments on commit 83c7615

Please sign in to comment.