INNER CODE UNIT · Swift

authenticatedCipherText

jedisct1/swift-sodium · Sources/Sodium/Aead.swift:52

        var authenticatedCipherText = Bytes(count: message.count + ABytes)
        var authenticatedCipherTextLen: UInt64 = 0
        let nonce = nonce()

        guard crypto_aead_aegis128l_encrypt(
            &authenticatedCipherText, &authenticatedCipherTextLen,
            message, UInt64(message.count),
            additionalData, UInt64(additionalData?.count ?? 0),
            nil, nonce, secretKey
        ).exitCode == .SUCCESS else { return nil }

        return (authenticatedCipherText: authenticatedCipherText, nonce: nonce)
    }
}

public extension Aead.Aegis128L {
    /**
     Decrypts a message with a shared secret key.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…