INNER CODE UNIT · Swift

verify

jedisct1/swift-sodium · Sources/Sodium/Auth.swift:40

    func verify(message: Bytes, secretKey: SecretKey, tag: Bytes) -> Bool {
        guard secretKey.count == KeyBytes else {
            return false
        }
        return crypto_auth_verify(
            tag,
            message, UInt64(message.count),
            secretKey
        ).exitCode == .SUCCESS
    }
}

extension Auth: SecretKeyGenerator {
    public var KeyBytes: Int {
        Int(crypto_auth_keybytes())
    }

    public typealias Key = Bytes

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…