Nonce
public class Nonce : KeyMaterial
This class represents a nonce (number used once) that is required for indeterministically encrypting a given message.
-
The size of the nonce in bytes.
Declaration
Swift
public static let SizeInBytes: UInt32 -
Creates a new random nonce.
Declaration
Swift
public init() -
Restores a nonce from a byte array. The byte array is copied to a secure location and overwritten with zeroes to avoid the nonce being compromised in memory. The nonce itself is not a secret value, but access in other contexts is not necessary.
Warning
Do not use this function to create nonces. This initializer is only intended to restore a nonce that was persisted.
Declaration
Swift
public override init?(bytes: inout Bytes)Parameters
bytesThe nonce.
-
Compares two nonces in constant time.
Parameters
lhsA nonce.
rhsAnother nonce.
Return Value
trueif both nonces are equal.
View on GitHub
Nonce Class Reference