6      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  3An escaper used to escape special characters, e.g. '<' , from XML. Given a 3, this function converts it into a fully valid XML  . Stephan Friedrichs"Identifies a user in the network. The users name. The users host. Henning Guenther9A class of types that have an internal signature status. DThe signature has been received via network. The signature might be  knwon or not. BThe message has been locally created, so we know the private key. No signature has been given. DThis type represents the possible results of verifying a signature. The signature could not be  checked, becuase a  was missing. The function B is a callback to be called when the missing certificate has been  acquired. The signature was invalid The signature was valid :Specifies the signature algorithm used to sign a message. (An unknown signature algorithm was used &MD5 has been used to sign the message A raw signature. The type of the signature The actual signature ?Given a certificate, this function verifies the Signature of a . eCalculates the concatenation of all text nodes in the list of contents, except for receiver elements      $Stephan Friedrichs, Henning Guenther"Generate an infinite(!) stream of s. This is just a . HSimplest possible generator type: counts from 0 upwards. Very insecure. Generates a stream of 7s by shuffling a sorted stream couting from 0 upwards ([0..]).   scrambler n gU would randomly remove the i-th element (where i is a random number between 0 and n) a from the sorted list and place it at the head of the result list. It deals with the following  elements in the same way. \Generates a stream of IDs by hashing an up-counting number and a random number with SHA512. VScrambles an infinite(!) list. The result will be a permutation of the original list. V The higher the offset (second argument), the further elements can occur from their  original indices. Henning Guenther1A class of types that can be encrypted with RSA. %Random generator to generate padding The  to use for encryption Data to be encrypted  MA class of types that can be encrypted with 64 bit keys and initial vectors. !Encrypts an object into an '& object The key to use The initial vector The object to be encrypted "Reverses the encrypt operation The key to use &The encrypted content to be decrypted #"Represents data encrypted by RSA. $%&Represents encrypted data. '()*=Packs a stream of 8-bit Words into a stream of 64-bit Words. +<Converts a list of 64-bit words into a list of 8-bit words. , Randomly creates a key for DES. -. !"#$%&'()*+,-.&'() !"#$%*+,-. !"!"#$%$%&'()'()*+,-.$Stephan Friedrichs, Henning Guenther / The unique 0/ type identifying each channel. 01&A locally set value, unique per host. 2The hostname of the 0/. 3The 3 type, see 4. 4Creates a new 3. Returns the ordering-relevant  of the 3. 5The anonymous 3 6Check 3 for validity. Return  if it is alright,  4 err if it is illegal (err is the reason for that). /01234563456/012/0120123456Henning GuentherY73A messages content can either be encrypted or not. 89:0Messages flooded throughout the entire network. ;@An anonymous message that has been unpacked and will be flooded <=>?@The users leaves a channel ABCJoin message for a channel DEFChannel announcements GHIJKL+Messages directed to a specified receiver. M"Key message for a private channel NOPQRS"Key request for a private channel TUVWA chat message XYZ[\]^Transmitting a certificate _`abRequesting a certificate cd Negative ACK e'Basic protocol message representation. fObscure messages g%Messages flooded through the network h%Messages with one specified receiver iORouting informations, a list of users and how much hops it takes to reach them jk9Sender of the original message and the sended message-id lmnkInforms about a user on the sending node, giving the user-id, the protocol version and a friendly greeting opqrAn external message. sFAn internal message that is subject to internal signature guidelines. tAn unsigned message. u(A class of messages that can be routed. vw The time-to-live of the message xReceiver of the routed message yID of the routed message z"The actual content of the message {Signature of the message |'An attachment that has been encrypted. }~Encrypted filename Encrypted mime-type Encrypted content *An attachmet as defined in the protocoll. Name of the attached file Mime-type of the very same The actual content of the file 3The message-delay can be represented by this type. ITimeToLive has a maximum of 360, so 16 bit unsigned is enough to hold it =Specifies the encryption algorithm used to encrypt a message An unknown cipher was used Uses DES to encrypt an . Key IV  to be encrypted Uses DES to decrypt an }|. Key Encrypted attachment  at failure,  when successful BDecrements the time-to-live of a message. If it sinks under zero,   is returned.  msg otherwise, where msg has a  decremented ttl. BExtracts the information from a message, that indicates, where to  route it. Y789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Y|}~uvwxyz{tsrenkihgfopqlmjLdb^WSMc_`aXYZ[\]TUVNOPQR:FC@;GHIJKDEAB<=>?798Y79889:FC@;GHIJKDEAB<=>?;<=>?@ABCDEFGHIJKLdb^WSMc_`aXYZ[\]TUVNOPQRMNOPQRSTUVWXYZ[\]^_`abcde nkihgfopqlmjfghijklmnopqrstuvwxyz{vwxyz{|}~}~ Martin Wegner!aThis structure represents an abstract element tree to be used for generating the XML afterwards. c It is designed for the special needs of the protocol schema and thus not as common as the HaXML  structures. HTakes the given element and puts it into the root element of a message. Generates the tree of s for an obscure message. Generates the tree of s for an anonymous message.  Takes an ) and generates the XML document from it.  Takes an s) and generates the XML document from it.  $Stephan Friedrichs, Henning GuentherBAbstracts addressed contents that can be sent to (several) users.  Routes an  datagram. The  to locate users. The data to be routed. /Starting-points and target-data of routes and, 7 optionally, an addressed, failed-to-route datagram. AThis class abstracts routing strategies for data-structures like Barracuda.RoutingTable.SimpleRT.  Minimal definition: one of  or . ,Tries to find a route for a given user. The  is the starting  point of the route. JFind routes for many users. The first object in the tuple maps nodes to a M list of users that should be reached over it. The second one is a list of  users that couldn't be reached.  Henning GuentherBParses a message without verifying the signature. It must only be ) used for testing or debugging issues! HGiven a validation function for signatures, this function parses an XML   into an r. &A validation function for signatures. The XML  to be parsed.  err on failure, err describs the error.  msg on success. Parses an Obscure-message. The XML  to be parsed.  err in case of a parsing failure;   msg on success. msg( either is one more obscured message or " the final message to be flooded.      !"#$%&'()*+,,-../01234566789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{{|}~   d9  adhoc-network-1.0.3Network.AdHoc.XMLRendererNetwork.AdHoc.UserIDNetwork.AdHoc.SignatureNetwork.AdHoc.MessageIDNetwork.AdHoc.EncryptionNetwork.AdHoc.ChannelNetwork.AdHoc.MessageNetwork.AdHoc.GeneratorNetwork.AdHoc.RoutingNetwork.AdHoc.ParserStrictescaperrenderDocumentUserIDuserNameuserHostToInternalSignature toInternalExternalSignatureInternalSignature NoSignatureSignatureStatusCertificateMissingSignatureWrong SignatureOKSignType SignUnknownMD5 Signature sign_type signatureverifySignature getHashStringMessageIDGenerator MessageIDcounter scramblerhasherRSAEncryptable rsaEncrypt rsaDecrypt Encryptableencryptdecrypt RSAEncryptedrsaData Encrypted encryptedIV encryptedDatapack64unpack64generateDESKey checkParity splitBlock ChannelID channelValue channelHost ChannelName mkChannelName anonymousvalidateChannelNameMessageContentUnencryptedMessageEncryptedMessage FloodContent Anonymous anonymousTextanonymousAttachments anonymousTimeanonymousDelayLeaveleaveChannelNameleaveChannelIDJoinjoinChannelName joinChannelIDChannelchannelChannelNamechannelChannelIDchannelChannelTitle channelUserschannelPrivate TargetContentKey keyReceiverkeyChannelName keyChannelID keyCipherTypekeyKeyGetKeygetKeyReceivergetKeyChannelNamegetKeyChannelIDMessagemessageReceiversmessageChannelNamemessageChannelIDmessageContent messageTime messageDelay CertificatecertificateReceiverscertificateForcertificateDataGetCertificategetCertificateForNackProtocolMessageObscureFloodTargetRouting routingRoutesAck ackSenderackMsgIdHello helloSenders helloVersion helloGreetingExternalMessageInternalMessageUnsignedMessageRouted routedTTL routedUserID routedMsgID routedContentroutedSignatureEncryptedAttachmentencryptedAttachmentFilenameencryptedAttachmentAppTypeencryptedAttachmentContent AttachmentattachmentFilenameattachmentAppTypeattachmentContentDelayTTL CipherType CipherUnknown CipherNone CipherDES_CBCencryptAttachmentdecryptAttachment decrementTTLrouteTo genRootElem genObscure genAnonymousgenerateMessage'generateMessage AddressedrouteRoutingStrategy routeSingle routeMultiparseMessageNoValidate parseMessageparseInnerMessage HaXml-1.20.2Text.XML.HaXml.TypesDocumentbaseGHC.BaseString renderProlog xmlEscape renderXMLDecl renderMiscrenderDocTypeDecl renderSymtab renderElementrenderAttributerenderAttValuerenderReference renderContenthsgnutls-0.2.3.2Network.GnuTLS.X509getHashStringContentscramblecoerceEncryptedgenParityWord8 mkWord8ParitycoerceRSAEncryptedstandardRSAEncryptstandardRSADecryptgetOrd Data.MaybeNothingJustAbstractElementshowTimegenStringToSign genSignature genXMLCont genXMLElem genXMLElemsgenRootElemDefaultstrgenAckgenHello genRoutinggenGetCertificategenCertificate genGetKeygenKey genAttachmentgenEncryptedAttachmentgenMessageContent genMessagegenNack genChannel genJoinLeavegenerateElementFromRoutedgenerateElementWithMsgIDgenerateElementgenerateDocumentnetwork-2.2.1.7Network.Socket.InternalSockAddrroutingSingleMaproutingMultiMap Data.EitherLeftRightparseTimestampparseID parseUserIDparseChannelIDparseAttachmentparseUnencryptedAttachmentparseEncryptedAttachmentgetIV parseMessage'anonymousCheck parseDate parseTimezone base64dec