     if @verify signature, message
       return [message, signature.toString()[0]]
 
-    throw new Error "Invalid message signature"
+    throw new InvalidMessageException "Invalid message signature"
 
   getIv: (raw) ->
     raw.slice 0, 16

    encryptedMessage = @encryptMessage signedMessage, message, key, iv
    new Buffer(iv + encryptedKey + encryptedMessage).toString "base64"

exports.Decryption = class Decryption

  constructor: (@recipientKey, @senderKey) ->


      encryptedKey = raw.slice 16, 16 + recipientKeyKytes
      @recipientKey.decrypt(encryptedKey)
    catch
      throw new DecryptionError "Incorrect message length."

  getDecryptedMessage: (iv, key, raw) ->
    recipientKeyKytes = @recipientKey.keyPair.cache.keyBitLength / 8
