         guard let (authenticatedCipherText, nonce): (NSData, Nonce) = seal(message, recipientPublicKey: recipientPublicKey, senderSecretKey: senderSecretKey) else {
             return nil
         }
-        let nonceAndAuthenticatedCipherText = NSMutableData(data: nonce)
-        nonceAndAuthenticatedCipherText.appendData(authenticatedCipherText)
+        let nonceAndAuthenticatedCipherText = NSMutableData(data: nonce as Data)
+        nonceAndAuthenticatedCipherText.appendData(authenticatedCipherText as Data)
         return nonceAndAuthenticatedCipherText
     }
     

        if crypto_box_seed_keypair(pk.mutableBytesPtr, sk.mutableBytesPtr, seed.bytesPtr) != 0 {
            return nil
        }
        return KeyPair(publicKey: PublicKey(data: pk), secretKey: SecretKey(data: sk))
    }
    
    public func nonce() -> Nonce? {

        guard let (authenticatedCipherText, nonce): (NSData, Nonce) = seal(message, beforenm: beforenm) else {
            return nil
        }
        let nonceAndAuthenticatedCipherText = NSMutableData(data: nonce as Data)
        nonceAndAuthenticatedCipherText.appendData(authenticatedCipherText as Data)
        return nonceAndAuthenticatedCipherText
    }
    
