INNER CODE UNIT · Swift
anonymousCipherText
jedisct1/swift-sodium · Sources/Sodium/Box.swift:225
var anonymousCipherText = Bytes(count: SealBytes + message.count)
guard crypto_box_seal(
&anonymousCipherText,
message, UInt64(message.count),
recipientPublicKey
).exitCode == .SUCCESS else { return nil }
return anonymousCipherText
}
}
public extension Box {
/**
Decrypts a message with a sender's public key and the recipient's secret key.
- Parameter nonceAndAuthenticatedCipherText: A `Bytes` object containing the nonce and authenticated ciphertext.
- Parameter senderPublicKey: The sender's public key.