mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
602 B
Swift
26 lines
602 B
Swift
2 years ago
|
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
|
||
|
|
||
|
import Sodium
|
||
|
|
||
2 years ago
|
public protocol NonceGenerator16ByteType {
|
||
2 years ago
|
var NonceBytes: Int { get }
|
||
|
|
||
2 years ago
|
func nonce() -> Array<UInt8>
|
||
|
}
|
||
|
|
||
2 years ago
|
public protocol NonceGenerator24ByteType {
|
||
|
var NonceBytes: Int { get }
|
||
2 years ago
|
|
||
2 years ago
|
func nonce() -> Array<UInt8>
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
extension OpenGroupAPI {
|
||
2 years ago
|
public class NonceGenerator16Byte: NonceGenerator, NonceGenerator16ByteType {
|
||
|
public var NonceBytes: Int { 16 }
|
||
2 years ago
|
}
|
||
2 years ago
|
|
||
|
public class NonceGenerator24Byte: NonceGenerator, NonceGenerator24ByteType {
|
||
|
public var NonceBytes: Int { 24 }
|
||
|
}
|
||
2 years ago
|
}
|