INNER CODE UNIT · Swift

message

jedisct1/swift-sodium · Sources/Sodium/Box.swift:272

        var message = Bytes(count: authenticatedCipherText.count - MacBytes)

        guard crypto_box_open_easy(
            &message,
            authenticatedCipherText, UInt64(authenticatedCipherText.count),
            nonce,
            senderPublicKey,
            recipientSecretKey
        ).exitCode == .SUCCESS else { return nil }

        return message
    }

    /**
     Decrypts a message with a sender's public key, recipient's secret key, encryption nonce, and authentication tag.

     - Parameter authenticatedCipherText: The authenticated ciphertext.
     - Parameter senderPublicKey: The sender's public key.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…