spigots: move to new location unders assets

BUG=chromium-os:24826

Change-Id: Ibfbb8e9ffe2abf957ec00d351a77dbf8085342af
diff --git a/_locales/en/messages.json b/_locales/en/messages.json
deleted file mode 100644
index 208d424..0000000
--- a/_locales/en/messages.json
+++ /dev/null
@@ -1,517 +0,0 @@
-{
-  "acronymEapMd5": {
-    "message": "EAP-MD5"
-  },
-  "acronymEapMschapV2": {
-    "message": "EAP-MSCHAPv2"
-  },
-  "acronymEapPap": {
-    "message": "EAP-PAP"
-  },
-  "acronymEapTls": {
-    "message": "EAP-TLS"
-  },
-  "acronymEapTtls": {
-    "message": "EAP-TTLS"
-  },
-  "acronymLeap": {
-    "message": "LEAP"
-  },
-  "acronymPeap": {
-    "message": "PEAP"
-  },
-  "acronymSsid": {
-    "message": "Service set identifier (SSID):"
-  },
-  "applySettings": {
-    "message": "Apply Changes"
-  },
-  "automatic": {
-    "description": "Indicating that a choice is made automatically without further specification",
-    "message": "Automatic"
-  },
-  "automaticallyConnect": {
-    "message": "Automatically connect"
-  },
-  "cancelSettings": {
-    "message": "Cancel"
-  },
-  "certificate": {
-    "description": "Used as replacement text in helpMarkRemoveContent - mid-sentence.",
-    "message": "certificate"
-  },
-  "certificateEmpty": {
-    "message": "Empty"
-  },
-  "certificates": {
-    "message": "Certificates"
-  },
-  "certificateTab": {
-    "message": "Certificate Settings"
-  },
-  "certificateType": {
-    "message": "Certificate Type"
-  },
-  "certificateTypeClient": {
-    "message": "Client Certificate"
-  },
-  "certificateTypeServer": {
-    "message": "Server Certificate"
-  },
-  "certificateTypeAuthority": {
-    "message": "Certificate Authority"
-  },
-  "certificateTrust": {
-    "message": "Certificate trust settings"
-  },
-  "certificatesAndTrustTab": {
-    "message": "Add a certificate"
-  },
-  "clientCertificateAuthority": {
-    "message": "Client Certificate Authority"
-  },
-  "confirmRemoveMessage": {
-    "message": "Confirm removal"
-  },
-  "connectionName": {
-    "message": "Connection Name"
-  },
-  "doneSettings": {
-    "message": "Done"
-  },
-  "doNotCheckCA": {
-    "message": "Do not check (insecure)"
-  },
-  "dragCertificateHere": {
-    "message": "Drag and drop certificate authorities and other certificates to install on Chrome OS. You may drag and drop .pem and .der files."
-  },
-  "edit": {
-    "message": "Edit"
-  },
-  "encryptConfiguration": {
-    "message": "Encrypt"
-  },
-  "encryptConfigurationFile": {
-    "message": "Enter encryption passphrase"
-  },
-  "saveRequestTab": {
-    "message": "Encrypt configuration"
-  },
-  "enrollmentUri": {
-    "message": "Client Enrollment URI"
-  },
-  "errorBadCertReference": {
-    "description": "This is displayed when a reference to a cert does not match any certificate.",
-    "message": "Network $1 has certificate reference $2 to $3, but no such certificate exist."
-  },
-  "errorCertificateMissingGUID": {
-    "message": "Certificate missing GUID."
-  },
-  "errorCertificateMissingPayloadField": {
-    "message": "Certificate (GUID $1) missing X509 or PKCS12 field."
-  },
-  "errorDuringLoad": {
-    "message": "Error while loading: $1"
-  },
-  "errorEmptyOnc": {
-    "message": "The ONC file is empty (or has no recognized fields)."
-  },
-  "errorEmptyProxyHost": {
-    "message": "Proxy Host is empty"
-  },
-  "errorEmptyProxyURL": {
-    "message": "Proxy URL is empty"
-  },
-  "errorExpectedInt": {
-    "message": "The ONC field $1 expected to be an integer"
-  },
-  "errorInvalidConfigurationType": {
-    "message": "The ONC file type '$1' is not supported."
-  },
-  "errorJSONStringify": {
-    "description": "This is displayed when an internal error during conversion to JSON makes it impossible to generate an output file.  The positional arg is the system error message from json.Stringify.",
-    "message": "Internal error converting to JSON: $1."
-  },
-  "errorLoadParsingJSON": {
-    "message": "JSON parsing error during load: $1."
-  },
-  "errorLoadRequiredObjectMissing": {
-    "message": "Object is missing required '$1' field."
-  },
-  "errorLoadUnhandledEapType": {
-    "message": "Unhandled EAP Type '$1' in WiFi network '$2'."
-  },
-  "errorLoadUnhandledSecurityType": {
-    "message": "Unhandled Security Type '$1' in WiFi network '$2'."
-  },
-  "errorLoadUnknown": {
-    "message": "Unknown error during load."
-  },
-  "errorLoadUnknownNetworkConfigType": {
-    "message": "Unknown NetworkConfiguration type '$1'."
-  },
-  "errorLoadUnknownProxyType": {
-    "message": "Unknown ProxySettings type '$1'."
-  },
-  "errorMissingClientCA": {
-    "message": "Missing client certificate authority for network $1."
-  },
-  "errorMissingEncryptionField": {
-    "message": "Missing required encryption parameter '$1'."
-  },
-  "errorMissingNetworkName": {
-    "description": "This is displayed when a network has no network name.  The positional arg is the type of the network.",
-    "message": "Missing network name for $1 network."
-  },
-  "errorMissingVPNServerCA": {
-    "message": "VPN $1 specifies authentication using certificates, but is missing Server CA."
-  },
-  "errorMissingPassphrase": {
-    "description": "This is displayed when an ONC file is being loaded, and it's encrypted, but the user didn't specify a passphrase.",
-    "message": "Missing passphrase for encrypted ONC file."
-  },
-  "errorMissingVPNPreSharedKey": {
-    "message": "You selected '$1' for the VPN security for the network '$2', but didn't supply a pre-shared key."
-  },
-  "errorPassphraseMissing": {
-    "message": "You have not provided a passphrase for Wi-Fi network '$1'.  The user will need to know it when they connect."
-  },
-  "errorPassphraseTooShort": {
-    "message": "The passphrase you provided is too short, it must be at least eight characters long."
-  },
-  "errorPassphraseTooSimple": {
-    "message": "The passphrase you provided is too simple.  It must have at least one number or symbol or capital letter."
-  },
-  "errorPKCS12CertificatesNotYetSupported": {
-    "message": "PKCS12 certificates (GUID $1) not yet supported."
-  },
-  "errors": {
-    "message": "errors"
-  },
-  "errorUnableToDecrypt": {
-    "message": "Unable to decrypt file."
-  },
-  "errorUnsupportedVPNType": {
-    "message": "VPN named $1 has unsupported type $2."
-  },
-  "errorUnsupportedValue": {
-    "message": "Field $1 has unsupported value $2."
-  },
-  "errorUnsupportedEncryptionMode": {
-    "description": "parameter 1 is the unsupported mode.  parameter 2 is the name of the parameter that value was assigned to.",
-    "message": "Unsupported encryption mode '$1' for '$2'."
-  },
-  "errorUploadCertificate": {
-    "message": "You need to upload a certificate."
-  },
-  "errorWEPKeyInvalidLength": {
-    "message": "Your WEP ASCII passphrase for the network '$1' is not a valid length.  A WEP passphrase must be either 5, 13, 16, or 29 characters for an ASCII passphrase, or 10, 26, 32 or 58 characters for a hexadecimal passphrase, depending on the bit length of the key desired."
-  },
-  "errorWEPKeyNonHexCharacters": {
-    "message": "The hexadecimal WEP password for the network '$1' contains invalid hex characters.  Hexadecimal passwords can only contain the letters 'a' through 'f' and the numbers 0 through 9.  If you didn't intend to enter a hex password, then you must use an ASCII password of the correct length (5, 13, 16 or 29 characters, depending on the length of the key desired)."
-  },
-  "errorWiFiNetworkMissingSSID": {
-    "message": "Wi-Fi network must have SSID."
-  },
-  "errorX509CertificateIsInvalid": {
-    "message": "X509 certificate (GUID $1) is invalid."
-  },
-  "extDesc": {
-    "message": "Network configuration tool for Chrome OS"
-  },
-  "extName": {
-    "description": "Name of extension",
-    "message": "Spigots"
-  },
-  "extensibleAuthenticationProtocol": {
-    "message": "Extensible Authentication Protocol"
-  },
-  "fileNotSupported": {
-    "message": "File $1 is not supported"
-  },
-  "helpAutoConfigurationUrl": {
-    "message": "Autoconfiguration URL (leave blank for WPAD protocol)"
-  },
-  "helpClientCertificateAuthority": {
-    "message": "Select the certificate authority that will issue the client certificate.  This information is used to determine which of the user's certificates is appropriate to use to identify them to the network.  Add new certificate authorities under the Certificates tab."
-  },
-  "helpConnectionName": {
-    "message": "Name for this connection that user sees in menus"
-  },
-  "helpConfigurationPassphrase": {
-    "message": "You must enter a passphrase for encrypting the output file.  This passphrase will be protecting any information you entered into this tool, so choose your passphrase wisely."
-  },
-  "helpEnrollmentUri": {
-    "message": "If the user does not have a suitable client certificate, upon attempting to connect to this network, direct the user to this URI to guide them through certificate enrollment.  Note that this URI should not be an internal network resource as the user may not have internal network access.  This may be an extension or data URI."
-  },
-  "helpInnerProtocol": {
-    "message": "Select the inner protocol to use for authentication (or Automatic to use any)"
-  },
-  "helpLoadConfigurationFromFile": {
-    "message": "Choose a file to load."
-  },
-  "helpLoadPassphrase": {
-    "message": "Enter the passphrase for decrypting the ONC file (if encrypted)."
-  },
-  "helpMarkRemoveContent": {
-    "message": "The $1 \"$2\" was loaded from an existing configuration file.  To remove it from any devices which have already imported this file, it can be marked for removal.  If you know the $1 has not been imported you can remove it directly.  If you choose to remove it directly, the operation cannot be undone.  Neither of these operations can be undone."
-  },
-  "helpPassword": {
-    "message": "Enter password for logging into network"
-  },
-  "helpPresharedKey": {
-    "message": "Enter the pre-shared key used by the IPsec layer"
-  },
-  "helpProxySettings": {
-    "message": "Choose the proxy configuration used while connected to this network."
-  },
-  "helpRemoteHost": {
-    "message": "Enter the hostname or IP of the virtual private network server."
-  },
-  "helpRemoveContent": {
-    "message": "Are you sure you want to remove $1 \"$2\"?  This operation cannot be undone."
-  },
-  "helpDownloadConfigurationToFile": {
-    "message": "Right-click on the link below and save the link with an '.onc' suffix."
-  },
-  "helpSecurityType": {
-    "message": "Security and authentication settings for network"
-  },
-  "helpServerCertificateAuthority": {
-    "message": "Select the certificate authority to trust when authenticating to this network.  Add new certificate authorities under the Certificates tab."
-  },
-  "helpUniqueIdentifier": {
-    "message": "This random unique identifier (GUID) identifies this network connection in case you want to update or delete it in the future."
-  },
-  "helpUsername": {
-    "message": "Enter username/identity for logging into network"
-  },
-  "helpVpnType": {
-    "message": "Choose the type of Virtual Private Network connection"
-  },
-  "helpWirelessPassphrase": {
-    "description": "Prompt to ask the user for their network passphrase",
-    "message": "Passphrase required to connect to network"
-  },
-  "identificationOfTheWirelessNetwork": {
-    "message": "Identification of the wireless network"
-  },
-  "innerProtocol": {
-    "message": "Inner protocol"
-  },
-  "l2tpIpsecCert": {
-    "message": "L2TP over IPsec with Certificates"
-  },
-  "l2tpIpsecPsk": {
-    "description": "L2TP over IPsec is a kind of VPN.  Pre-Shared Key is a particular configuration of that VPN.",
-    "message": "L2TP over IPsec with Pre-Shared Key"
-  },
-  "loadConfigurationFromFile": {
-    "message": "Load configuration from file"
-  },
-  "loadConfigurationTab": {
-    "message": "Load configuration"
-  },
-  "loadFile": {
-    "message": "Load File"
-  },
-  "loadSucceeded": {
-    "message": "Configuration loaded successfully."
-  },
-  "markedForRemovalStatus": {
-    "description": "Status in a list when an entity has been marked/tagged that it should be removed on client devices.",
-    "message": "(Marked for removal)"
-  },
-  "markRemoveButton": {
-    "description": "This button text indicates that a certificate or network will be marked/tagged to be deleted at a later time on a remove device.",
-    "message": "Mark for removal"
-  },
-  "network": {
-    "description": "Used as replacement text in helpMarkRemoveContent - mid-sentence.",
-    "message": "network"
-  },
-  "networkconfigurations": {
-    "message": "Network Configurations"
-  },
-  "openvpnType": {
-    "message": "OpenVPN"
-  },
-  "password": {
-    "message": "Password"
-  },
-  "presharedKey": {
-    "message": "Pre-Shared Key"
-  },
-  "proxyAutoConfiguration": {
-    "message": "Automatic proxy configuration"
-  },
-  "proxyDirect": {
-    "message": "Direct Internet connection"
-  },
-  "proxyManual": {
-    "message": "Manual proxy configuration"
-  },
-  "proxyManualFtp": {
-    "message": "FTP proxy"
-  },
-  "proxyManualHttp": {
-    "message": "HTTP proxy"
-  },
-  "proxyManualSecureHttp": {
-    "message": "Secure HTTP proxy"
-  },
-  "proxyManualSocks": {
-    "message": "SOCKS host"
-  },
-  "proxyPort": {
-    "description": "TCP port number required for settings up a proxy",
-    "message": "Port"
-  },
-  "proxySettings": {
-    "message": "Proxy Settings"
-  },
-  "remoteHost": {
-    "message": "Remote host"
-  },
-  "remove": {
-    "message": "Remove"
-  },
-  "removeButton": {
-    "message": "Remove"
-  },
-  "downloadConfiguration": {
-    "message": "Download Configuration"
-  },
-  "downloadConfigurationTab": {
-    "message": "Download configuration"
-  },
-  "downloadConfigurationToFile": {
-    "message": "Download configuration to file"
-  },
-  "downloadConfigurationTab": {
-    "message": "Download configuration"
-  },
-  "downloadLinkText": {
-    "description": "This is the text of the link that starts the download of the newly creation configuration.",
-    "message": "Download Configuration"
-  },
-  "saveSucceeded": {
-    "message": "Save succeeded!"
-  },
-  "securityNone": {
-    "message": "None"
-  },
-  "securityType": {
-    "message": "Security type:"
-  },
-  "securityWep": {
-    "message": "WEP (insecure)"
-  },
-  "securityWpa": {
-    "message": "WPA"
-  },
-  "securityWpaEnterprise": {
-    "message": "WPA Enterprise (802.1X)"
-  },
-  "selectTheEapToPermit": {
-    "message": "Select the Extensible Authentication Protocol (EAP) to permit"
-  },
-  "serverCertificateAuthority": {
-    "message": "Server Certificate Authority"
-  },
-  "settings": {
-    "message": "Settings"
-  },
-  "specifyUsernameAndPassword": {
-    "message": "Save credentials (username, password, passphrases) so they do not need to be entered each time a connection is initiated"
-  },
-  "thisSsidIsNotBroadcast": {
-    "message": "This SSID is not broadcast"
-  },
-  "trustThisCertificateForWeb": {
-    "message": "Trust this certificate for identifying web sites"
-  },
-  "uniqueIdentifier": {
-    "message": "Unique identifier"
-  },
-  "unknownName": {
-    "description": "Shown when a network name is unknown",
-    "message": "Unknown name"
-  },
-  "unknownType": {
-    "description": "Shown when a network type is unknown",
-    "message": "Unknown type"
-  },
-  "useAnyDefaultCA": {
-    "message": "Use any default Certificate Authority"
-  },
-  "useEncryption": {
-    "message": "Use encryption"
-  },
-  "username": {
-    "message": "Username/Identity"
-  },
-  "vpnSettings": {
-    "message": "Virtual Private Network (VPN) settings"
-  },
-  "vpnTab": {
-    "message": "Add a Virtual Private Network"
-  },
-  "vpnType": {
-    "message": "VPN Type"
-  },
-  "warningConfigurationTypeMissing": {
-    "message": "Configuration 'Type' field is missing."
-  },
-  "warningEAPPasswordEmpty": {
-    "message": "You have not provided a password for Wi-Fi network '$1'.  The user will need to know it when they connect."
-  },
-  "warningIdentityMissing": {
-    "message": "You have not provided a username/identity for network '$1'.  The user will need to know it when they connect."
-  },
-  "warnings": {
-    "message": "warnings"
-  },
-  "warningPasswordMissing": {
-    "message": "You have not provided a password for network '$1'.  The user will need to know it when they connect."
-  },
-  "warningPreSharedKeyMissing": {
-    "message": "You have not provided a pre-shared key for network '$1'.  The user will need to know it when they connect."
-  },
-  "warningShortWPAPassphraseUnsafe": {
-    "message": "Your $1 password for the network named '$2' is only $3 characters long.  This is too short to be a secure password, and is easily compromised."
-  },
-  "warningUnrecognizedTopLevelField": {
-    "message": "Unrecognized top-level field in ONC file: $1."
-  },
-  "warningWEPInherentlyUnsafe": {
-    "message": "You are using WEP to secure the Wi-Fi network named '$1'.  WEP networks are inherently insecure.  Consider using WPA or WPA2 if possible."
-  },
-  "wifiSettings": {
-    "message": "Wi-Fi Network Settings"
-  },
-  "wifiSettingsTab": {
-    "message": "Add a Wi-Fi Network"
-  },
-  "wirelessPassphrase": {
-    "message": "Passphrase"
-  },
-  "X509CommonName": {
-    "message": "Common Name (CN)"
-  },
-  "X509IssuedBy": {
-    "message": "Issued By"
-  },
-  "X509IssuedTo": {
-    "message": "Issued To"
-  },
-  "X509Organization": {
-    "message": "Organization (O)"
-  },
-  "X509OrganizationalUnit": {
-    "message": "Organizational Unit (OU)"
-  },
-  "X509SerialNumber": {
-    "message": "Serial Number"
-  }
-}
diff --git a/asn1.js b/asn1.js
deleted file mode 100644
index b946b3b..0000000
--- a/asn1.js
+++ /dev/null
@@ -1,195 +0,0 @@
-// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview Provides basic ability to read ASN.1 format into a
- * JSON object.
- */
-
-const ASN1_SEQUENCE = 0x30;
-const ASN1_SET = 0x31;
-const ASN1_OBJECT_ID = 0x6;
-const ASN1_PRINTABLE = 0x13;
-
-/**
- * Namespace for ASN.1 functions.
- */
-var asn1 = {};
-
-/**
- * Parse object id out of byte ASN.1 byte stream.
- *
- * @param {String} bytes  Byte stream of ASN.1
- * @param {Number} offset  Offset within bytes where object ID begins.
- * @param {Number} len  Length of object ID.
- * @return {String}  Human readable object ID with dots.
- */
-asn1.parseObjectId = function(bytes, offset, len) {
-  var oid = '';
-  var accumulated = 0;
-  for (var i = 0; i < len; ++i) {
-    var byte = bytes[offset + i];
-    accumulated <<= 7;
-    accumulated |= (byte & ~0x80);
-    if (!(byte & 0x80)) {
-      if (oid == '') {
-        oid = Math.floor(accumulated / 40) + '.' + (accumulated % 40);
-      } else {
-        oid = oid + '.' + accumulated;
-      }
-      accumulated = 0;
-    }
-  }
-  return oid;
-};
-
-/**
- * Parse entire ASN.1 byte stream.
- *
- * @param {String} bytes  Byte stream of ASN.1
- * @return {Object}  Parsed JSON representation of ASN.1
- */
-asn1.parseAsn1 = function(bytes) {
-  if (typeof(bytes) == 'string') {
-    bytes = bytes.split('').map(function(c) { return c.charCodeAt(0) });
-  }
-  var offset = 0;
-  var result = [];
-  while (offset < bytes.length) {
-    var kind = bytes[offset];
-    var len = bytes[offset+1];
-    var prefix_length = 2;
-    if (len & 0x80) {
-      len &= ~0x80;
-      prefix_length += len;
-      if (len == 1)
-        len = bytes[offset+2];
-      else if (len == 2)
-        len = (bytes[offset+2] << 8) | bytes[offset+3];
-      else
-        return false;
-    }
-    var inner_result;
-    switch(kind) {
-      case ASN1_SEQUENCE:
-      case ASN1_SET:
-        inner_result = asn1.parseAsn1(bytes.slice(offset + prefix_length,
-                                                  offset + prefix_length + len))
-        if (typeof(inner_result) == 'boolean' && inner_result == false)
-          return false;
-        result.push(inner_result);
-        break;
-      case ASN1_OBJECT_ID:
-        inner_result = asn1.parseObjectId(bytes, offset + prefix_length, len);
-        if (typeof(inner_result) == 'boolean' && inner_result == false)
-          return false;
-        result.push({'object_id': inner_result});
-        break;
-      case ASN1_PRINTABLE:
-        var string = '';
-        for (var i = 0; i < len; ++i) {
-          string += String.fromCharCode(bytes[offset + prefix_length + i]);
-        }
-        result.push(string);
-        break;
-    }
-    offset += prefix_length + len;
-  }
-  return result;
-};
-
-/**
- * Convert OID to a mnemonic identifier if possible.
- *
- * @param {String} oid  Human readable form of object id.
- * @returns {String}  Mnemonic identifier or original dot form if not known.
- */
-asn1.convertOID = function(oid) {
-  if (!oid.object_id) return false;
-  switch(oid.object_id) {
-    case '2.5.4.3': return 'commonName';
-    case '2.5.4.5': return 'serialNumber';
-    case '2.5.4.6': return 'countryName';
-    case '2.5.4.7': return 'localityName';
-    case '2.5.4.8': return 'stateOrProvidenceName';
-    case '2.5.4.10': return 'organizationName';
-    case '2.5.4.11': return 'organizationalUnit';
-    default: return oid;
-  }
-};
-
-/**
- * Interpret given ASN.1 JSON object as an X.520 name.
- *
- * @param {Object} name  JSON ASN.1 that should be a X.520 name.
- * @returns {Object}  Dictionary of name attributes (like commonName) to values.
- */
-asn1.interpretName = function(name) {
-  // See structure below.
-  if (!(name instanceof Array))
-    return false;
-  var result = {};
-  for (i = 0; i < name.length; ++i) {
-    if (!(name[i] instanceof Array)) {
-      continue;
-    }
-    if (!(name[i][0] instanceof Array)) {
-      continue;
-    }
-    var pair = name[i][0];
-    result[asn1.convertOID(pair[0])] = pair[1];
-  }
-  return result;
-};
-
-/**
- * Interpret a given ASN.1 JSON object as an X.509 certificate.
- *
- * @param {Object} asn1  JSON ASN.1 that should be a X.509 certificate.
- * @returns {Object}  A dictionary including issuer and subject name
- * information.
- */
-asn1.interpretCert = function(asn1Data) {
-  // See RFC5280.  Expect asn of format somewhat like:
-  // struct Certificate {
-  //   struct TbsCertificate {
-  //     int version;
-  //     int serialNumber;
-  //     OID algorithm;
-  //     struct Name {
-  //       struct RNSequence {
-  //         struct AttributeTypeAndValue {
-  //           OID attribute;
-  //           string value;
-  //         } attributesAndValues[];
-  //       } rnSequence;
-  //     } issuer;
-  //     struct Validity {
-  //       UTCTime;
-  //       GeneralizedTime;
-  //     };
-  //     struct Name subject;
-  //     ...
-  //   } tbsCertificate;
-  //   ...
-  // }
-  // We are interested in the issuer and subject attributes and values.
-  //
-  if (!(asn1Data instanceof Array) ||
-      !(asn1Data[0] instanceof Array) ||
-      !(asn1Data[0][0] instanceof Array)) {
-    return false;
-  }
-  var tbsCertificate = asn1Data[0][0];
-  var result;
-  // Find issuer - currently always at the same offset since
-  // we ignore integer types currently. 0 is signing algorithm,
-  // 1 is issuer, 2 is timestamps, 3 is subject.
-  if (tbsCertificate.length < 5)
-    return false;
-  return {
-    'issuer': asn1.interpretName(tbsCertificate[1]),
-    'subject': asn1.interpretName(tbsCertificate[3])
-  };
-};
diff --git a/base64.js b/base64.js
deleted file mode 100644
index b84d46a..0000000
--- a/base64.js
+++ /dev/null
@@ -1,76 +0,0 @@
-// Base64 JavaScript decoder
-// Copyright (c) 2008 Lapo Luchini <lapo@lapo.it>
-
-// Permission to use, copy, modify, and/or distribute this software for any
-// purpose with or without fee is hereby granted, provided that the above
-// copyright notice and this permission notice appear in all copies.
-//
-// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-Base64 = {};
-
-Base64.decode = function(a) {
-    if (Base64.decoder == undefined) {
-        var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-        var allow = "= \f\n\r\t\u00A0\u2028\u2029";
-        var dec = [];
-        for (var i = 0; i < 64; ++i)
-            dec[b64.charAt(i)] = i;
-        for (var i = 0; i < allow.length; ++i)
-            dec[allow.charAt(i)] = -1;
-        Base64.decoder = dec;
-    }
-    var out = [];
-    var bits = 0, char_count = 0;
-    for (var i = 0; i < a.length; ++i) {
-        var c = a.charAt(i);
-        if (c == '=')
-            break;
-        c = Base64.decoder[c];
-        if (c == -1)
-            continue;
-        if (c == undefined)
-            throw 'Illegal character at offset ' + i;
-        bits |= c;
-        if (++char_count >= 4) {
-            out[out.length] = (bits >> 16);
-            out[out.length] = (bits >> 8) & 0xFF;
-            out[out.length] = bits & 0xFF;
-            bits = 0;
-            char_count = 0;
-        } else {
-            bits <<= 6;
-        }
-    }
-    switch (char_count) {
-      case 1:
-        throw "Base64 encoding incomplete: at least 2 bits missing";
-        break;
-      case 2:
-        out[out.length] = (bits >> 10);
-        break;
-      case 3:
-        out[out.length] = (bits >> 16);
-        out[out.length] = (bits >> 8) & 0xFF;
-        break;
-    }
-    return out;
-}
-
-Base64.re = /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/;
-Base64.unarmor = function(a) {
-    var m = Base64.re.exec(a);
-    if (m) {
-        if (m[1])
-            a = m[1];
-        else if (m[2])
-            a = m[2];
-    }
-    return Base64.decode(a);
-}
diff --git a/base64_encode.js b/base64_encode.js
deleted file mode 100644
index 0d88e20..0000000
--- a/base64_encode.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview  Provide way to encode binary data to base64.
- */
-
-/**
- * Encode given binary data to base64 format.
- * @param {Uint8Array} bytes  Binary data to encode.
- * @returns {String}  Base64 representation of binary data.
- */
-Base64.encode = function(bytes) {
-  var map = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
-  var result = [];
-  for (var i = 0; i < bytes.length; i += 3) {
-    result.push(map[(bytes[i] >> 2) & 0x3f]);
-    var x1 = ((bytes[i] << 4) & 0x3f);
-    if (i + 1 >= bytes.length) {
-      result.push(map[x1]);
-      result.push('=');
-      result.push('=');
-      break;
-    }
-    x1 |= (bytes[i + 1] >> 4) & 0x3f;
-    result.push(map[x1]);
-    x2 = (bytes[i + 1] << 2) & 0x3f;
-    if (i + 2 >= bytes.length) {
-      result.push(map[x2]);
-      result.push('=');
-      break;
-    }
-    x2 |= (bytes[i+2] >> 6) & 3;
-    result.push(map[x2]);
-    result.push(map[bytes[i+2] & 0x3f]);
-  }
-  return result.join('');
-};
diff --git a/cert-dialog.js b/cert-dialog.js
deleted file mode 100644
index 2e7dc2d..0000000
--- a/cert-dialog.js
+++ /dev/null
@@ -1,172 +0,0 @@
-// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview This file contains implementation for the certificate dialog.
- */
-
-/**
- * Namespace for certificate dialog.
- */
-var certDialog = {};
-
-/**
- * Update the certificate summary based on the currently loaded cert.
- */
-certDialog.updateBox = function() {
-  if (!certDialog.certData || !('X509' in certDialog.certData)) {
-    $('#cert-instructions').show();
-    $('#cert-summary').hide();
-    return;
-  }
-  $('#cert-instructions').hide();
-  $('#cert-summary').show();
-  var cert = main.interpretCertFromX509Pem(certDialog.certData.X509);
-  function updateEntity(table, entity) {
-    var fields = $('.cert-fill', table);
-    for (var i = 0; i < fields.length; ++i) {
-      if (fields[i].id in entity)
-        fields[i].innerText = entity[fields[i].id];
-      else
-        fields[i].innerText = '';
-    }
-  }
-  updateEntity($('#subject', '#cert-summary'), cert.subject);
-  updateEntity($('#issuer', '#cert-summary'), cert.issuer);
-};
-
-/**
- * Handle a drag and drop file list.  We validate the certificate
- * file, show a summary of the certificate, and store the
- * contents for later in certData.
- * @param {Array.<Object>} files  drag and drop file list.
- */
-certDialog.handleCertFileList = function(files) {
-  certDialog.loadedCert = null;
-  for (var i = 0; i < files.length; ++i) {
-    var file = files[i];
-    var reader = new FileReader();
-    reader.onload = function(theFile) {
-      var derUint8;
-      if (file.name.match(/\.pem$/) || file.name.match(/\.crt$/)) {
-        var der = Base64.unarmor(this.result);
-        derUint8 = main.arrayToUint8Array(der);
-      } else if (file.name.match(/\.der/)) {
-        // TODO: This is currently broken
-        var der = this.result;
-        derUint8 = main.arrayToUint8Array(der);
-      }
-      certDialog.certData = {};
-      if (derUint8)
-        certDialog.certData.X509 = Base64.encode(derUint8);
-      // Create a new ONC object.
-      var newCert = certDialog.getFromUi();
-      var oncTest = onc.createUpdate(newCert, 'Certificates');
-      var results = onc.validateCertificate(
-        onc.findCert(newCert.GUID, oncTest), oncTest);
-      ui.showMessages(results, '#cert-dialog');
-      certDialog.updateBox();
-    };
-    reader.readAsBinaryString(file);
-  }
-  return false;
-};
-
-/**
- * Set up the UI with the given certificate ONC.  Error checking is
- * not performed.
- * @param {Object} oncCert  Certificate
- */
-certDialog.setToUi = function(oncCert) {
-  certDialog.oncBase = oncCert;
-  certDialog.certData.X509 = oncCert.X509;
-  if ('Trust' in oncCert) {
-    for (var i = 0; i < oncCert.Trust.length; ++i) {
-      if (oncCert.Trust[i] == 'Web')
-        $('#web-trust')[0].checked = true;
-    }
-  }
-  $('#cert-type').val(oncCert.Type);
-  certDialog.updateBox();
-};
-
-/**
- * Called to hide/unhide UI fields.
- */
-certDialog.setUiVisibility = function() {
-};
-
-/**
- * Validate and convert the certificate configuration to ONC.
- * @returns {Object}  ONC Certificate object.
- */
-certDialog.getFromUi = function() {
-  // TODO: Handle or deprecate PKCS12 loading (in which case
-  // we load PKCS8).
-  var oncCert = {};
-  if ('oncBase' in certDialog)
-    oncCert = certDialog.oncBase;
-  onc.setUpArray(oncCert, 'Trust');
-  onc.setBitArray(oncCert.Trust, 'Web', $('#web-trust').is(':checked'));
-  oncCert.GUID = $('#cert-guid').val();
-  oncCert.Type = $('#cert-type').val();
-  if ('X509' in certDialog.certData)
-    oncCert.X509 = certDialog.certData.X509;
-  return oncCert;
-};
-
-/**
- * Configure the given DOM id as a drag and drop target for certificates.
- * @param {String} id  DOM id.
- */
-certDialog.configureDragDropTarget = function(id) {
-  function cancel(event) {
-    if (event.preventDefault)
-      event.preventDefault();
-    return false;
-  }
-  var drop = $('#' + id)[0];
-  drop.addEventListener('dragover', cancel, false);
-  drop.addEventListener('dragenter', cancel, false);
-  drop.addEventListener('drop', function(event) {
-    certDialog.handleCertFileList(event.dataTransfer.files);
-  }, false);
-};
-
-/**
- * Configure the certificate file picker.
- */
-certDialog.configureCertFilePicker = function() {
-  $('#cert-files').change(function(event) {
-    certDialog.handleCertFileList(event.target.files);
-  });
-};
-
-/**
- * Handles save of certificate.
- */
-
-certDialog.onApplyPress = function() {
-  var newCert = certDialog.getFromUi();
-  var oncTest = onc.createUpdate(newCert, 'Certificates');
-  var results = onc.validateCertificate(
-    onc.findCert(newCert.GUID, oncTest), oncTest);
-  ui.showMessagesAndApply(results, oncTest, $('#cert-dialog')[0]);
-};
-
-/**
- * Called to initialize the cert dialog.
- */
-certDialog.init = function() {
-  certDialog.certData = {};
-  $('#cert-guid').val(main.createGuid());
-  $('#web-trust')[0].checked = false;
-  ui.setSelectedI18n('#cert-type', 'certificateTypeAuthority');
-  $('#apply-button', '#cert-dialog').click(certDialog.onApplyPress);
-  ui.resetFilePicker('#cert-files');
-  certDialog.configureDragDropTarget('cert-summary');
-  certDialog.configureCertFilePicker();
-  $('#cert-files').focus();
-  certDialog.updateBox();
-};
diff --git a/crypto-js/README.chromium b/crypto-js/README.chromium
deleted file mode 100644
index e9a3ce3..0000000
--- a/crypto-js/README.chromium
+++ /dev/null
@@ -1,35 +0,0 @@
-Name: crypto-js
-URL: http://code.google.com/p/crypto-js/
-License: BSD 2-Clause (http://www.opensource.org/licenses/bsd-license.php)
-Version: 2.5.1
-Security Critical: yes
-Downloaded: December 20, 2011
-
-Description:
-JavaScript implementation of cryptographic algorithms.
-
-Local Modifications:
-- Renamed all src/ files to lowercase names so that build succeeds on Linux.
-- Changed randomBytes function to use crypto.getRandomValue for more
-  secure random number generation (see patch below).
-- Moved Closure-generated built file (the only one we use) into this
-  directory after building (crypto-sha1-hmac-pbkdf2-blockmodes-aes.js)
-
---------------------------------------------------------------------------
-
---- crypto-js-read-only/src/Crypto.js 
-+++ crypto-js/src/crypto.js 
-@@ -38,9 +38,10 @@
- 
- 	// Generate an array of any length of random bytes
- 	randomBytes: function (n) {
--		for (var bytes = []; n > 0; n--)
--			bytes.push(Math.floor(Math.random() * 256));
--		return bytes;
-+    var array = new Uint8Array(n);
-+    crypto.getRandomValues(array);
-+    // Now convert them from a Uint8Array to a regular array of ints.
-+    return [].map.call(array, function(_){ return _; });
- 	},
- 
- 	// Convert a byte array to big-endian 32-bit words
diff --git a/crypto-js/builder/builder.php b/crypto-js/builder/builder.php
deleted file mode 100644
index 4909f27..0000000
--- a/crypto-js/builder/builder.php
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php

-

-$copyrightInfo = '/*

- * Crypto-JS v2.5.1

- * http://code.google.com/p/crypto-js/

- * (c) 2009-2011 by Jeff Mott. All rights reserved.

- * http://code.google.com/p/crypto-js/wiki/License

- */

-';

-

-$files = array('crypto', 'md5', 'sha1', 'sha256', 'hmac', 'pbkdf2', 'pbkdf2async',

-               'marc4', 'rabbit', 'aes', 'des', 'blockmodes');

-$rollups = array(

-	array('crypto', 'md5'),

-	array('crypto', 'sha1'),

-	array('crypto', 'sha256'),

-	array('crypto', 'md5', 'hmac'),

-	array('crypto', 'sha1', 'hmac'),

-	array('crypto', 'sha256', 'hmac'),

-	array('crypto', 'sha1', 'hmac', 'pbkdf2'),

-	array('crypto', 'sha1', 'hmac', 'pbkdf2async'),

-	array('crypto', 'sha1', 'hmac', 'pbkdf2', 'marc4'),

-	array('crypto', 'sha1', 'hmac', 'pbkdf2', 'rabbit'),

-	array('crypto', 'sha1', 'hmac', 'pbkdf2', 'blockmodes', 'aes'),

-	array('crypto', 'sha1', 'hmac', 'pbkdf2', 'blockmodes', 'des')

-);

-

-foreach ($files as $file) {

-	mkdir("../build/$file");

-	$js = file_get_contents("../src/$file.js");

-	file_put_contents("../build/$file/$file.js", $copyrightInfo . $js);

-	file_put_contents("../build/$file/$file-min.js", $copyrightInfo . compress($js));

-}

-

-foreach ($rollups as $rollup) {

-	$rollupName = implode("-", $rollup);

-	mkdir("../build/$rollupName");

-	$js = '';

-	foreach ($rollup as $file) $js .= file_get_contents("../src/$file.js");

-	file_put_contents("../build/$rollupName/$rollupName.js", $copyrightInfo . compress($js));

-}

-

-function compress($js) {

-

-	$cmd = 'java -jar compiler/compiler.jar';

-

-	$descriptors = array(

-		0 => array('pipe', 'r'),

-		1 => array('pipe', 'w'),

-		2 => array('pipe', 'w')

-	);

-

-	$process = proc_open($cmd, $descriptors, $pipes);

-	if ($process === false) die();

-

-	fwrite($pipes[0], $js);

-	fclose($pipes[0]);

-

-	$compressed = stream_get_contents($pipes[1]);

-	fclose($pipes[1]);

-

-	$errors = stream_get_contents($pipes[2]);

-	fclose($pipes[2]);

-

-	$exitStatus = proc_close($process);

-

-	if ($exitStatus != 0 or $errors != '') die();

-

-	return $compressed;

-

-}

diff --git a/crypto-js/builder/compiler/COPYING b/crypto-js/builder/compiler/COPYING
deleted file mode 100644
index d645695..0000000
--- a/crypto-js/builder/compiler/COPYING
+++ /dev/null
@@ -1,202 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
diff --git a/crypto-js/builder/compiler/README b/crypto-js/builder/compiler/README
deleted file mode 100644
index e6d12c4..0000000
--- a/crypto-js/builder/compiler/README
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- * Copyright 2009 The Closure Compiler Authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-//
-// Contents
-//
-
-The Closure Compiler performs checking, instrumentation, and
-optimizations on JavaScript code. The purpose of this README is to
-explain how to build and run the Closure Compiler.
-
-The Closure Compiler requires Java 6 or higher.
-http://www.java.com/
-
-
-//
-// Building The Closure Compiler
-//
-
-There are three ways to get a Closure Compiler executable.
-
-1) Use one we built for you.
-
-Pre-built Closure binaries can be found at
-http://code.google.com/p/closure-compiler/downloads/list
-
-
-2) Check out the source and build it with Apache Ant.
-
-First, check out the full source tree of the Closure Compiler. There
-are instructions on how to do this at the project site.
-http://code.google.com/p/closure-compiler/source/checkout
-
-Apache Ant is a cross-platform build tool.
-http://ant.apache.org/
-
-At the root of the source tree, there is an Ant file named
-build.xml. To use it, navigate to the same directory and type the
-command
-
-ant jar
-
-This will produce a jar file called "build/compiler.jar".
-
-
-3) Check out the source and build it with Eclipse.
-
-Eclipse is a cross-platform IDE.
-http://www.eclipse.org/
-
-Under Eclipse's File menu, click "New > Project ..." and create a
-"Java Project."  You will see an options screen. Give the project a
-name, select "Create project from existing source," and choose the
-root of the checked-out source tree as the existing directory. Verify
-that you are using JRE version 6 or higher.
-
-Eclipse can use the build.xml file to discover rules. When you
-navigate to the build.xml file, you will see all the build rules in
-the "Outline" pane. Run the "jar" rule to build the compiler in
-build/compiler.jar.
-
-
-//
-// Running The Closure Compiler
-//
-
-Once you have the jar binary, running the Closure Compiler is straightforward.
-
-On the command line, type
-
-java -jar compiler.jar
-
-This starts the compiler in interactive mode. Type
-
-var x = 17 + 25;
-
-then hit "Enter", then hit "Ctrl-Z" (on Windows) or "Ctrl-D" (on Mac or Linux)
-and "Enter" again. The Compiler will respond:
-
-var x=42;
-
-The Closure Compiler has many options for reading input from a file,
-writing output to a file, checking your code, and running
-optimizations. To learn more, type
-
-java -jar compiler.jar --help
-
-You can read more detailed documentation about the many flags at
-http://code.google.com/closure/compiler/docs/gettingstarted_app.html
-
-
-//
-// Compiling Multiple Scripts
-//
-
-If you have multiple scripts, you should compile them all together with
-one compile command.
-
-java -jar compiler.jar --js=in1.js --js=in2.js ... --js_output_file=out.js
-
-The Closure Compiler will concatenate the files in the order they're
-passed at the command line.
-
-If you need to compile many, many scripts together, you may start to
-run into problems with managing dependencies between scripts. You
-should check out the Closure Library. It contains functions for
-enforcing dependencies between scripts, and a tool called calcdeps.py
-that knows how to give scripts to the Closure Compiler in the right
-order.
-
-http://code.google.com/p/closure-library/
-
-//
-// Licensing
-//
-
-Unless otherwise stated, all source files are licensed under
-the Apache License, Version 2.0.
-
-
------
-Code under:
-src/com/google/javascript/rhino
-test/com/google/javascript/rhino
-
-URL: http://www.mozilla.org/rhino
-Version:  1.5R3, with heavy modifications
-License:  Netscape Public License and MPL / GPL dual license
-
-Description: A partial copy of Mozilla Rhino. Mozilla Rhino is an
-implementation of JavaScript for the JVM.  The JavaScript parser and
-the parse tree data structures were extracted and modified
-significantly for use by Google's JavaScript compiler.
-
-Local Modifications: The packages have been renamespaced. All code not
-relavant to parsing has been removed. A JSDoc parser and static typing
-system have been added.
-
-
------
-Code in:
-lib/rhino
-
-Rhino
-URL: http://www.mozilla.org/rhino
-Version:  Trunk
-License:  Netscape Public License and MPL / GPL dual license
-
-Description: Mozilla Rhino is an implementation of JavaScript for the JVM.
-
-Local Modifications: Minor changes to parsing JSDoc that usually get pushed
-up-stream to Rhino trunk.
-
-
------
-Code in:
-lib/args4j.jar
-
-Args4j
-URL: https://args4j.dev.java.net/
-Version: 2.0.12
-License: MIT
-
-Description:
-args4j is a small Java class library that makes it easy to parse command line
-options/arguments in your CUI application.
-
-Local Modifications: None.
-
-
------
-Code in:
-lib/guava.jar
-
-Guava Libraries
-URL: http://code.google.com/p/guava-libraries/
-Version:  r08
-License: Apache License 2.0
-
-Description: Google's core Java libraries.
-
-Local Modifications: None.
-
-
------
-Code in:
-lib/jsr305.jar
-
-Annotations for software defect detection
-URL: http://code.google.com/p/jsr-305/
-Version: svn revision 47
-License: BSD License
-
-Description: Annotations for software defect detection.
-
-Local Modifications: None.
-
-
------
-Code in:
-lib/jarjar.jar
-
-Jar Jar Links
-URL: http://jarjar.googlecode.com/
-Version: 1.1
-License: Apache License 2.0
-
-Description:
-A utility for repackaging Java libraries.
-
-Local Modifications: None.
-
-
-----
-Code in:
-lib/junit.jar
-
-JUnit
-URL:  http://sourceforge.net/projects/junit/
-Version:  4.8.2
-License:  Common Public License 1.0
-
-Description: A framework for writing and running automated tests in Java.
-
-Local Modifications: None.
-
-
----
-Code in:
-lib/protobuf-java.jar
-
-Protocol Buffers
-URL: http://code.google.com/p/protobuf/
-Version: 2.3.0
-License: New BSD License
-
-Description: Supporting libraries for protocol buffers,
-an encoding of structured data.
-
-Local Modifications: None
-
-
----
-Code in:
-lib/ant.jar
-lib/ant-launcher.jar
-
-URL: http://ant.apache.org/bindownload.cgi
-Version: 1.8.1
-License: Apache License 2.0
-Description:
-  Ant is a Java based build tool. In theory it is kind of like "make"
-  without make's wrinkles and with the full portability of pure java code.
-
-Local Modifications: None
-
-
----
-Code in:
-lib/json.jar
-URL: http://json.org/java/index.html
-Version: JSON version 20090211
-License: MIT license
-Description:
-JSON is a set of java files for use in transmitting data in JSON format.
-
-Local Modifications: None
-
----
-Code in:
-tools/maven-ant-tasks-2.1.1.jar
-URL: http://maven.apache.org
-Version 2.1.1
-License: Apache License 2.0
-Description:
-  Maven Ant tasks are used to manage dependencies and to install/deploy to
-  maven repositories.
-
-Local Modifications: None
diff --git a/crypto-js/builder/compiler/compiler.jar b/crypto-js/builder/compiler/compiler.jar
deleted file mode 100644
index 62cfdd0..0000000
--- a/crypto-js/builder/compiler/compiler.jar
+++ /dev/null
Binary files differ
diff --git a/crypto-js/crypto-sha1-hmac-pbkdf2-blockmodes-aes.js b/crypto-js/crypto-sha1-hmac-pbkdf2-blockmodes-aes.js
deleted file mode 100644
index 0db925d..0000000
--- a/crypto-js/crypto-sha1-hmac-pbkdf2-blockmodes-aes.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Crypto-JS v2.5.1
- * http://code.google.com/p/crypto-js/
- * (c) 2009-2011 by Jeff Mott. All rights reserved.
- * http://code.google.com/p/crypto-js/wiki/License
- */
-(typeof Crypto=="undefined"||!Crypto.util)&&function(){var d=window.Crypto={},k=d.util={rotl:function(b,c){return b<<c|b>>>32-c},rotr:function(b,c){return b<<32-c|b>>>c},endian:function(b){if(b.constructor==Number)return k.rotl(b,8)&16711935|k.rotl(b,24)&4278255360;for(var c=0;c<b.length;c++)b[c]=k.endian(b[c]);return b},randomBytes:function(b){b=new Uint8Array(b);crypto.getRandomValues(b);return[].map.call(b,function(b){return b})},bytesToWords:function(b){for(var c=[],a=0,e=0;a<b.length;a++,e+=
-8)c[e>>>5]|=b[a]<<24-e%32;return c},wordsToBytes:function(b){for(var c=[],a=0;a<b.length*32;a+=8)c.push(b[a>>>5]>>>24-a%32&255);return c},bytesToHex:function(b){for(var c=[],a=0;a<b.length;a++)c.push((b[a]>>>4).toString(16)),c.push((b[a]&15).toString(16));return c.join("")},hexToBytes:function(b){for(var c=[],a=0;a<b.length;a+=2)c.push(parseInt(b.substr(a,2),16));return c},bytesToBase64:function(b){if(typeof btoa=="function")return btoa(h.bytesToString(b));for(var c=[],a=0;a<b.length;a+=3)for(var e=
-b[a]<<16|b[a+1]<<8|b[a+2],l=0;l<4;l++)a*8+l*6<=b.length*8?c.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>>6*(3-l)&63)):c.push("=");return c.join("")},base64ToBytes:function(b){if(typeof atob=="function")return h.stringToBytes(atob(b));for(var b=b.replace(/[^A-Z0-9+\/]/ig,""),c=[],a=0,e=0;a<b.length;e=++a%4)e!=0&&c.push(("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(b.charAt(a-1))&Math.pow(2,-2*e+8)-1)<<e*2|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(b.charAt(a))>>>
-6-e*2);return c}},d=d.charenc={};d.UTF8={stringToBytes:function(b){return h.stringToBytes(unescape(encodeURIComponent(b)))},bytesToString:function(b){return decodeURIComponent(escape(h.bytesToString(b)))}};var h=d.Binary={stringToBytes:function(b){for(var c=[],a=0;a<b.length;a++)c.push(b.charCodeAt(a)&255);return c},bytesToString:function(b){for(var c=[],a=0;a<b.length;a++)c.push(String.fromCharCode(b[a]));return c.join("")}}}();
-(function(){var d=Crypto,k=d.util,h=d.charenc,b=h.UTF8,c=h.Binary,a=d.SHA1=function(e,l){var b=k.wordsToBytes(a._sha1(e));return l&&l.asBytes?b:l&&l.asString?c.bytesToString(b):k.bytesToHex(b)};a._sha1=function(e){e.constructor==String&&(e=b.stringToBytes(e));var a=k.bytesToWords(e),g=e.length*8,e=[],c=1732584193,j=-271733879,d=-1732584194,h=271733878,s=-1009589776;a[g>>5]|=128<<24-g%32;a[(g+64>>>9<<4)+15]=g;for(g=0;g<a.length;g+=16){for(var f=c,n=j,r=d,m=h,o=s,p=0;p<80;p++){if(p<16)e[p]=a[g+p];else{var v=
-e[p-3]^e[p-8]^e[p-14]^e[p-16];e[p]=v<<1|v>>>31}v=(c<<5|c>>>27)+s+(e[p]>>>0)+(p<20?(j&d|~j&h)+1518500249:p<40?(j^d^h)+1859775393:p<60?(j&d|j&h|d&h)-1894007588:(j^d^h)-899497514);s=h;h=d;d=j<<30|j>>>2;j=c;c=v}c+=f;j+=n;d+=r;h+=m;s+=o}return[c,j,d,h,s]};a._blocksize=16;a._digestsize=20})();
-(function(){var d=Crypto,k=d.util,h=d.charenc,b=h.UTF8,c=h.Binary;d.HMAC=function(a,e,l,g){e.constructor==String&&(e=b.stringToBytes(e));l.constructor==String&&(l=b.stringToBytes(l));l.length>a._blocksize*4&&(l=a(l,{asBytes:!0}));for(var d=l.slice(0),l=l.slice(0),j=0;j<a._blocksize*4;j++)d[j]^=92,l[j]^=54;a=a(d.concat(a(l.concat(e),{asBytes:!0})),{asBytes:!0});return g&&g.asBytes?a:g&&g.asString?c.bytesToString(a):k.bytesToHex(a)}})();
-(function(){var d=Crypto,k=d.util,h=d.charenc,b=h.UTF8,c=h.Binary;d.PBKDF2=function(a,e,l,g){function t(a,e){return d.HMAC(j,e,a,{asBytes:!0})}a.constructor==String&&(a=b.stringToBytes(a));e.constructor==String&&(e=b.stringToBytes(e));for(var j=g&&g.hasher||d.SHA1,h=g&&g.iterations||1,q=[],s=1;q.length<l;){for(var f=t(a,e.concat(k.wordsToBytes([s]))),n=f,r=1;r<h;r++)for(var n=t(a,n),m=0;m<f.length;m++)f[m]^=n[m];q=q.concat(f);s++}q.length=l;return g&&g.asBytes?q:g&&g.asString?c.bytesToString(q):k.bytesToHex(q)}})();
-(function(d){function k(a,e){var b=a._blocksize*4;return b-e.length%b}var h=d.pad={},b=function(a){for(var e=a.pop(),b=1;b<e;b++)a.pop()};h.NoPadding={pad:function(){},unpad:function(){}};h.ZeroPadding={pad:function(a,e){var b=a._blocksize*4,g=e.length%b;if(g!=0)for(g=b-g;g>0;g--)e.push(0)},unpad:function(){}};h.iso7816={pad:function(a,e){var b=k(a,e);for(e.push(128);b>1;b--)e.push(0)},unpad:function(a){for(;a.pop()!=128;);}};h.ansix923={pad:function(a,e){for(var b=k(a,e),g=1;g<b;g++)e.push(0);e.push(b)},
-unpad:b};h.iso10126={pad:function(a,e){for(var b=k(a,e),g=1;g<b;g++)e.push(Math.floor(Math.random()*256));e.push(b)},unpad:b};h.pkcs7={pad:function(a,e){for(var b=k(a,e),g=0;g<b;g++)e.push(b)},unpad:b};var d=d.mode={},c=d.Mode=function(a){if(a)this._padding=a};c.prototype={encrypt:function(a,e,b){this._padding.pad(a,e);this._doEncrypt(a,e,b)},decrypt:function(a,e,b){this._doDecrypt(a,e,b);this._padding.unpad(e)},_padding:h.iso7816};b=(d.ECB=function(){c.apply(this,arguments)}).prototype=new c;b._doEncrypt=
-function(a,e){for(var b=a._blocksize*4,g=0;g<e.length;g+=b)a._encryptblock(e,g)};b._doDecrypt=function(a,b){for(var c=a._blocksize*4,g=0;g<b.length;g+=c)a._decryptblock(b,g)};b.fixOptions=function(b){b.iv=[]};b=(d.CBC=function(){c.apply(this,arguments)}).prototype=new c;b._doEncrypt=function(b,e,c){for(var g=b._blocksize*4,d=0;d<e.length;d+=g){if(d==0)for(var j=0;j<g;j++)e[j]^=c[j];else for(j=0;j<g;j++)e[d+j]^=e[d+j-g];b._encryptblock(e,d)}};b._doDecrypt=function(b,e,c){for(var g=b._blocksize*4,d=
-0;d<e.length;d+=g){var j=e.slice(d,d+g);b._decryptblock(e,d);for(var h=0;h<g;h++)e[d+h]^=c[h];c=j}};b=(d.CFB=function(){c.apply(this,arguments)}).prototype=new c;b._padding=h.NoPadding;b._doEncrypt=function(b,e,c){for(var g=b._blocksize*4,c=c.slice(0),d=0;d<e.length;d++){var j=d%g;j==0&&b._encryptblock(c,0);e[d]^=c[j];c[j]=e[d]}};b._doDecrypt=function(b,e,c){for(var g=b._blocksize*4,c=c.slice(0),d=0;d<e.length;d++){var j=d%g;j==0&&b._encryptblock(c,0);var h=e[d];e[d]^=c[j];c[j]=h}};b=(d.OFB=function(){c.apply(this,
-arguments)}).prototype=new c;b._padding=h.NoPadding;b._doEncrypt=function(b,e,c){for(var d=b._blocksize*4,c=c.slice(0),h=0;h<e.length;h++)h%d==0&&b._encryptblock(c,0),e[h]^=c[h%d]};b._doDecrypt=b._doEncrypt;d=(d.CTR=function(){c.apply(this,arguments)}).prototype=new c;d._padding=h.NoPadding;d._doEncrypt=function(b,e,c){for(var d=b._blocksize*4,c=c.slice(0),h=0;h<e.length;){var j=c.slice(0);b._encryptblock(j,0);for(var k=0;h<e.length&&k<d;k++,h++)e[h]^=j[k];++c[d-1]==256&&(c[d-1]=0,++c[d-2]==256&&
-(c[d-2]=0,++c[d-3]==256&&(c[d-3]=0,++c[d-4])))}};d._doDecrypt=d._doEncrypt})(Crypto);
-(function(){function d(b,e){for(var c=0,i=0;i<8;i++){e&1&&(c^=b);var a=b&128,b=b<<1&255;a&&(b^=27);e>>>=1}return c}for(var k=Crypto,h=k.util,b=k.charenc.UTF8,c=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,
-208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,
-206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],a=[],e=0;e<256;e++)a[c[e]]=e;for(var l=[],g=[],t=[],j=[],u=[],q=[],e=0;e<256;e++)l[e]=d(e,2),g[e]=d(e,3),t[e]=d(e,9),j[e]=d(e,11),u[e]=d(e,13),q[e]=d(e,14);var s=[0,1,2,4,8,16,32,64,128,27,54],f=[[],[],[],[]],n,r,m,o=k.AES={encrypt:function(e,c,a){var a=a||{},i=a.mode||new k.mode.OFB;i.fixOptions&&i.fixOptions(a);var e=e.constructor==String?b.stringToBytes(e):e,d=a.iv||h.randomBytes(o._blocksize*4),c=c.constructor==String?k.PBKDF2(c,
-d,32,{asBytes:!0}):c;o._init(c);i.encrypt(o,e,d);e=a.iv?e:d.concat(e);return a&&a.asBytes?e:h.bytesToBase64(e)},decrypt:function(e,c,a){var a=a||{},i=a.mode||new k.mode.OFB;i.fixOptions&&i.fixOptions(a);var e=e.constructor==String?h.base64ToBytes(e):e,d=a.iv||e.splice(0,o._blocksize*4),c=c.constructor==String?k.PBKDF2(c,d,32,{asBytes:!0}):c;o._init(c);i.decrypt(o,e,d);return a&&a.asBytes?e:b.bytesToString(e)},_blocksize:4,_encryptblock:function(b,e){for(var a=0;a<o._blocksize;a++)for(var i=0;i<4;i++)f[a][i]=
-b[e+i*4+a];for(a=0;a<4;a++)for(i=0;i<4;i++)f[a][i]^=m[i][a];for(var d=1;d<r;d++){for(a=0;a<4;a++)for(i=0;i<4;i++)f[a][i]=c[f[a][i]];f[1].push(f[1].shift());f[2].push(f[2].shift());f[2].push(f[2].shift());f[3].unshift(f[3].pop());for(i=0;i<4;i++){var a=f[0][i],h=f[1][i],j=f[2][i],k=f[3][i];f[0][i]=l[a]^g[h]^j^k;f[1][i]=a^l[h]^g[j]^k;f[2][i]=a^h^l[j]^g[k];f[3][i]=g[a]^h^j^l[k]}for(a=0;a<4;a++)for(i=0;i<4;i++)f[a][i]^=m[d*4+i][a]}for(a=0;a<4;a++)for(i=0;i<4;i++)f[a][i]=c[f[a][i]];f[1].push(f[1].shift());
-f[2].push(f[2].shift());f[2].push(f[2].shift());f[3].unshift(f[3].pop());for(a=0;a<4;a++)for(i=0;i<4;i++)f[a][i]^=m[r*4+i][a];for(a=0;a<o._blocksize;a++)for(i=0;i<4;i++)b[e+i*4+a]=f[a][i]},_decryptblock:function(b,e){for(var c=0;c<o._blocksize;c++)for(var d=0;d<4;d++)f[c][d]=b[e+d*4+c];for(c=0;c<4;c++)for(d=0;d<4;d++)f[c][d]^=m[r*4+d][c];for(var h=1;h<r;h++){f[1].unshift(f[1].pop());f[2].push(f[2].shift());f[2].push(f[2].shift());f[3].push(f[3].shift());for(c=0;c<4;c++)for(d=0;d<4;d++)f[c][d]=a[f[c][d]];
-for(c=0;c<4;c++)for(d=0;d<4;d++)f[c][d]^=m[(r-h)*4+d][c];for(d=0;d<4;d++){var c=f[0][d],g=f[1][d],k=f[2][d],l=f[3][d];f[0][d]=q[c]^j[g]^u[k]^t[l];f[1][d]=t[c]^q[g]^j[k]^u[l];f[2][d]=u[c]^t[g]^q[k]^j[l];f[3][d]=j[c]^u[g]^t[k]^q[l]}}f[1].unshift(f[1].pop());f[2].push(f[2].shift());f[2].push(f[2].shift());f[3].push(f[3].shift());for(c=0;c<4;c++)for(d=0;d<4;d++)f[c][d]=a[f[c][d]];for(c=0;c<4;c++)for(d=0;d<4;d++)f[c][d]^=m[d][c];for(c=0;c<o._blocksize;c++)for(d=0;d<4;d++)b[e+d*4+c]=f[c][d]},_init:function(c){n=
-c.length/4;r=n+6;o._keyexpansion(c)},_keyexpansion:function(a){m=[];for(var b=0;b<n;b++)m[b]=[a[b*4],a[b*4+1],a[b*4+2],a[b*4+3]];for(b=n;b<o._blocksize*(r+1);b++)a=[m[b-1][0],m[b-1][1],m[b-1][2],m[b-1][3]],b%n==0?(a.push(a.shift()),a[0]=c[a[0]],a[1]=c[a[1]],a[2]=c[a[2]],a[3]=c[a[3]],a[0]^=s[b/n]):n>6&&b%n==4&&(a[0]=c[a[0]],a[1]=c[a[1]],a[2]=c[a[2]],a[3]=c[a[3]]),m[b]=[m[b-n][0]^a[0],m[b-n][1]^a[1],m[b-n][2]^a[2],m[b-n][3]^a[3]]}}})();
diff --git a/crypto-js/docs/QuickStartGuide.wiki b/crypto-js/docs/QuickStartGuide.wiki
deleted file mode 100644
index 89ad324..0000000
--- a/crypto-js/docs/QuickStartGuide.wiki
+++ /dev/null
@@ -1,234 +0,0 @@
-= Quick-start Guide =

-

-== MD5 ==

-

-MD5 is a widely used hash function. It's been used in a variety of security applications and is also commonly used to check the integrity of files. Though, MD5 is not collision resistant, and it isn't suitable for applications like SSL certificates or digital signatures that rely on this property.

-

-{{{

-<script type="text/javascript" src="http://crypto-js.googlecode.com/files/2.3.0-crypto-md5.js"></script>

-<script type="text/javascript">

-

-var digest = Crypto.MD5("Message");

-

-var digestBytes = Crypto.MD5("Message", { asBytes: true });

-var digestString = Crypto.MD5("Message", { asString: true });

-

-</script>

-}}}

-

-== SHA-1 ==

-

-The SHA hash functions were designed by the National Security Agency (NSA). SHA-1 is the most established of the existing SHA hash functions, and it's used in a variety of security applications and protocols. Though, SHA-1's collision resistance has been weakening as new attacks are discovered or improved.

-

-{{{

-<script type="text/javascript" src="http://crypto-js.googlecode.com/files/2.3.0-crypto-sha1.js"></script>

-<script type="text/javascript">

-

-var digest = Crypto.SHA1("Message");

-

-var digestBytes = Crypto.SHA1("Message", { asBytes: true });

-var digestString = Crypto.SHA1("Message", { asString: true });

-

-</script>

-}}}

-

-== SHA-256 ==

-

-SHA-256 is one of the three variants in the SHA-2 set. It isn't as widely used as SHA-1, though it appears to provide much better security.

-

-{{{

-<script type="text/javascript" src="http://crypto-js.googlecode.com/files/2.3.0-crypto-sha256.js"></script>

-<script type="text/javascript">

-

-var digest = Crypto.SHA256("Message");

-

-var digestBytes = Crypto.SHA256("Message", { asBytes: true });

-var digestString = Crypto.SHA256("Message", { asString: true });

-

-</script>

-}}}

-

-== AES ==

-

-The Advanced Encryption Standard (AES) is a U.S. Federal Information Processing Standard (FIPS). It was selected after a 5-year process where 15 competing designs were evaluated.

-

-{{{

-<script type="text/javascript" src="http://crypto-js.googlecode.com/files/2.3.0-crypto-sha1-hmac-pbkdf2-blockmodes-aes.js"></script>

-<script type="text/javascript">

-

-var crypted = Crypto.AES.encrypt("Message", "Secret Passphrase");

-var plain = Crypto.AES.decrypt(crypted, "Secret Passphrase");

-

-</script>

-}}}

-

-Thanks to contributions from Simon Greatrix, Crypto-JS now includes a variety of modes of operation as well as padding schemes.

-

-{{{

-<script type="text/javascript" src="http://crypto-js.googlecode.com/files/2.3.0-crypto-sha1-hmac-pbkdf2-blockmodes-aes.js"></script>

-<script type="text/javascript">

-

-// CBC with default padding scheme (iso7816)

-var crypted = Crypto.AES.encrypt("Message", "Secret Passphrase", { mode: new Crypto.mode.CBC });

-var plain = Crypto.AES.decrypt(crypted, "Secret Passphrase", { mode: new Crypto.mode.CBC });

-

-// CBC with ansix923 padding scheme

-var crypted = Crypto.AES.encrypt("Message", "Secret Passphrase", { mode: new Crypto.mode.CBC(Crypto.pad.ansix923) });

-var plain = Crypto.AES.decrypt(crypted, "Secret Passphrase", { mode: new Crypto.mode.CBC(Crypto.pad.ansix923) });

-

-</script>

-}}}

-

-The modes of operation currently available are:

-  * ECB

-  * CBC

-  * CFB

-  * OFB

-

-And the padding schemes currently available are:

-  * iso7816

-  * ansix923

-  * iso10126

-  * pkcs7

-  * ZeroPadding

-  * NoPadding

-

-== Rabbit ==

-

-Rabbit is a high-performance stream cipher and a finalist in the eSTREAM Portfolio. It is one of the four designs selected after a 3 1/2-year process where 22 designs were evaluated.

-

-{{{

-<script type="text/javascript" src="http://crypto-js.googlecode.com/files/2.3.0-crypto-sha1-hmac-pbkdf2-rabbit.js"></script>

-<script type="text/javascript">

-

-var crypted = Crypto.Rabbit.encrypt("Message", "Secret Passphrase");

-var plain = Crypto.Rabbit.decrypt(crypted, "Secret Passphrase");

-

-</script>

-}}}

-

-== MARC4 ==

-

-MARC4 (Modified Allegedly RC4) is based on RC4, a widely-used stream cipher. RC4 is used in popular protocols such as SSL and WEP. But though it's remarkable for its simplicity and speed, it has weaknesses. Crypto-JS provides a modified version that corrects these weaknesses, but the algorithm's history still doesn't inspire confidence in its security.

-

-{{{

-<script type="text/javascript" src="http://crypto-js.googlecode.com/files/2.3.0-crypto-sha1-hmac-pbkdf2-marc4.js"></script>

-<script type="text/javascript">

-

-var crypted = Crypto.MARC4.encrypt("Message", "Secret Passphrase");

-var plain = Crypto.MARC4.decrypt(crypted, "Secret Passphrase");

-

-</script>

-}}}

-

-== HMAC ==

-

-Keyed-hash message authentication codes (HMAC) is a mechanism for message authentication using cryptographic hash functions. HMAC can be used in combination with any iterated cryptographic hash function.

-

-=== HMAC-MD5 ===

-

-{{{

-<script type="text/javascript" src="http://crypto-js.googlecode.com/files/2.3.0-crypto-md5-hmac.js"></script>

-<script type="text/javascript">

-

-var hmac = Crypto.HMAC(Crypto.MD5, "Message", "Secret Passphrase");

-

-var hmacBytes = Crypto.HMAC(Crypto.MD5, "Message", "Secret Passphrase", { asBytes: true });

-var hmacString = Crypto.HMAC(Crypto.MD5, "Message", "Secret Passphrase", { asString: true });

-

-</script>

-}}}

-

-=== HMAC-SHA1 ===

-

-{{{

-<script type="text/javascript" src="http://crypto-js.googlecode.com/files/2.3.0-crypto-sha1-hmac.js"></script>

-<script type="text/javascript">

-

-var hmac = Crypto.HMAC(Crypto.SHA1, "Message", "Secret Passphrase");

-

-var hmacBytes = Crypto.HMAC(Crypto.SHA1, "Message", "Secret Passphrase", { asBytes: true });

-var hmacString = Crypto.HMAC(Crypto.SHA1, "Message", "Secret Passphrase", { asString: true });

-

-</script>

-}}}

-

-=== HMAC-SHA256 ===

-

-{{{

-<script type="text/javascript" src="http://crypto-js.googlecode.com/files/2.3.0-crypto-sha256-hmac.js"></script>

-<script type="text/javascript">

-

-var hmac = Crypto.HMAC(Crypto.SHA256, "Message", "Secret Passphrase");

-

-var hmacBytes = Crypto.HMAC(Crypto.SHA256, "Message", "Secret Passphrase", { asBytes: true });

-var hmacString = Crypto.HMAC(Crypto.SHA256, "Message", "Secret Passphrase", { asString: true });

-

-</script>

-}}}

-

-== PBKDF2 ==

-

-PBKDF2 is a password-based key derivation function. In many applications of cryptography, user security is ultimately dependent on a password, and because a password usually can't be used directly as a cryptographic key, some processing is required.

-

-A salt provides a large set of keys for any given password, and an iteration count increases the cost of producing keys from a password, thereby also increasing the difficulty of attack.

-

-{{{

-<script type="text/javascript" src="http://crypto-js.googlecode.com/files/2.3.0-crypto-sha1-hmac-pbkdf2.js"></script>

-<script type="text/javascript">

-

-var salt = Crypto.util.randomBytes(16);

-

-var key128bit = Crypto.PBKDF2("Secret Passphrase", salt, 16);

-var key256bit = Crypto.PBKDF2("Secret Passphrase", salt, 32);

-var key512bit = Crypto.PBKDF2("Secret Passphrase", salt, 64);

-

-var key512bit1000 = Crypto.PBKDF2("Secret Passphrase", salt, 64, { iterations: 1000 });

-

-</script>

-}}}

-

-PBKDF2 with a large iteration count can take a long time to compute. To avoid long-running script warnings, Crypto-JS provided an alternative version that executes asyncronously and passes the result to a callback. You also have the option to specify an onProgressChange callback that allows you to keep the user updated.

-

-{{{

-<script type="text/javascript" src="http://crypto-js.googlecode.com/files/2.3.0-crypto-sha1-hmac-pbkdf2async.js"></script>

-<script type="text/javascript">

-

-var salt = Crypto.util.randomBytes(16);

-

-function onCompleteHandler(result) {

-    document.getElementById('result').innerHTML = result;

-}

-

-function onProgressChangeHandler(percent) {

-    document.getElementById('progress').innerHTML = percent + '%';

-}

-

-Crypto.PBKDF2Async("Secret Passphrase", salt, 64, onCompleteHandler, { iterations: 1000, onProgressChange: onProgressChangeHandler });

-

-</script>

-

-<div id="progress"></div>

-<div id="result"></div>

-}}}

-

-== Utilities ==

-

-{{{

-<script type="text/javascript" src="http://crypto-js.googlecode.com/files/2.3.0-crypto-min.js"></script>

-<script type="text/javascript">

-

-var helloBytes = Crypto.charenc.Binary.stringToBytes("Hello, World!");

-var helloString = Crypto.charenc.Binary.bytesToString(helloBytes);

-

-var utf8Bytes = Crypto.charenc.UTF8.stringToBytes("България");

-var unicodeString = Crypto.charenc.UTF8.bytesToString(utf8Bytes);

-

-var helloHex = Crypto.util.bytesToHex(helloBytes);

-var helloBytes = Crypto.util.hexToBytes(helloHex);

-

-var helloBase64 = Crypto.util.bytesToBase64(helloBytes);

-var helloBytes = Crypto.util.base64ToBytes(helloBase64);

-

-</script>

-}}}

diff --git a/crypto-js/src/aes.js b/crypto-js/src/aes.js
deleted file mode 100644
index 7aca055..0000000
--- a/crypto-js/src/aes.js
+++ /dev/null
@@ -1,401 +0,0 @@
-(function(){

-

-// Shortcuts

-var C = Crypto,

-    util = C.util,

-    charenc = C.charenc,

-    UTF8 = charenc.UTF8;

-

-// Precomputed SBOX

-var SBOX = [ 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5,

-             0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,

-             0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0,

-             0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,

-             0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc,

-             0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,

-             0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a,

-             0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,

-             0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0,

-             0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,

-             0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b,

-             0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,

-             0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85,

-             0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,

-             0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5,

-             0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,

-             0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17,

-             0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,

-             0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88,

-             0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,

-             0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c,

-             0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,

-             0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9,

-             0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,

-             0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6,

-             0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,

-             0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e,

-             0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,

-             0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94,

-             0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,

-             0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68,

-             0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 ];

-

-// Compute inverse SBOX lookup table

-for (var INVSBOX = [], i = 0; i < 256; i++) INVSBOX[SBOX[i]] = i;

-

-// Compute mulitplication in GF(2^8) lookup tables

-var MULT2 = [],

-    MULT3 = [],

-    MULT9 = [],

-    MULTB = [],

-    MULTD = [],

-    MULTE = [];

-

-function xtime(a, b) {

-	for (var result = 0, i = 0; i < 8; i++) {

-		if (b & 1) result ^= a;

-		var hiBitSet = a & 0x80;

-		a = (a << 1) & 0xFF;

-		if (hiBitSet) a ^= 0x1b;

-		b >>>= 1;

-	}

-	return result;

-}

-

-for (var i = 0; i < 256; i++) {

-	MULT2[i] = xtime(i,2);

-	MULT3[i] = xtime(i,3);

-	MULT9[i] = xtime(i,9);

-	MULTB[i] = xtime(i,0xB);

-	MULTD[i] = xtime(i,0xD);

-	MULTE[i] = xtime(i,0xE);

-}

-

-// Precomputed RCon lookup

-var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];

-

-// Inner state

-var state = [[], [], [], []],

-    keylength,

-    nrounds,

-    keyschedule;

-

-var AES = C.AES = {

-

-	/**

-	 * Public API

-	 */

-

-	encrypt: function (message, password, options) {

-

-		options = options || {};

-

-		// Determine mode

-		var mode = options.mode || new C.mode.OFB;

-

-		// Allow mode to override options

-		if (mode.fixOptions) mode.fixOptions(options);

-

-		var

-

-			// Convert to bytes if message is a string

-			m = (

-				message.constructor == String ?

-				UTF8.stringToBytes(message) :

-				message

-			),

-

-			// Generate random IV

-			iv = options.iv || util.randomBytes(AES._blocksize * 4),

-

-			// Generate key

-			k = (

-				password.constructor == String ?

-				// Derive key from passphrase

-				C.PBKDF2(password, iv, 32, { asBytes: true }) :

-				// else, assume byte array representing cryptographic key

-				password

-			);

-

-		// Encrypt

-		AES._init(k);

-		mode.encrypt(AES, m, iv);

-

-		// Return ciphertext

-		m = options.iv ? m : iv.concat(m);

-		return (options && options.asBytes) ? m : util.bytesToBase64(m);

-

-	},

-

-	decrypt: function (ciphertext, password, options) {

-

-		options = options || {};

-

-		// Determine mode

-		var mode = options.mode || new C.mode.OFB;

-

-		// Allow mode to override options

-		if (mode.fixOptions) mode.fixOptions(options);

-

-		var

-

-			// Convert to bytes if ciphertext is a string

-			c = (

-				ciphertext.constructor == String ?

-				util.base64ToBytes(ciphertext):

-			    ciphertext

-			),

-

-			// Separate IV and message

-			iv = options.iv || c.splice(0, AES._blocksize * 4),

-

-			// Generate key

-			k = (

-				password.constructor == String ?

-				// Derive key from passphrase

-				C.PBKDF2(password, iv, 32, { asBytes: true }) :

-				// else, assume byte array representing cryptographic key

-				password

-			);

-

-		// Decrypt

-		AES._init(k);

-		mode.decrypt(AES, c, iv);

-

-		// Return plaintext

-		return (options && options.asBytes) ? c : UTF8.bytesToString(c);

-

-	},

-

-

-	/**

-	 * Package private methods and properties

-	 */

-

-	_blocksize: 4,

-

-	_encryptblock: function (m, offset) {

-

-		// Set input

-		for (var row = 0; row < AES._blocksize; row++) {

-			for (var col = 0; col < 4; col++)

-				state[row][col] = m[offset + col * 4 + row];

-		}

-

-		// Add round key

-		for (var row = 0; row < 4; row++) {

-			for (var col = 0; col < 4; col++)

-				state[row][col] ^= keyschedule[col][row];

-		}

-

-		for (var round = 1; round < nrounds; round++) {

-

-			// Sub bytes

-			for (var row = 0; row < 4; row++) {

-				for (var col = 0; col < 4; col++)

-					state[row][col] = SBOX[state[row][col]];

-			}

-

-			// Shift rows

-			state[1].push(state[1].shift());

-			state[2].push(state[2].shift());

-			state[2].push(state[2].shift());

-			state[3].unshift(state[3].pop());

-

-			// Mix columns

-			for (var col = 0; col < 4; col++) {

-

-				var s0 = state[0][col],

-				    s1 = state[1][col],

-				    s2 = state[2][col],

-				    s3 = state[3][col];

-

-				state[0][col] = MULT2[s0] ^ MULT3[s1] ^ s2 ^ s3;

-				state[1][col] = s0 ^ MULT2[s1] ^ MULT3[s2] ^ s3;

-				state[2][col] = s0 ^ s1 ^ MULT2[s2] ^ MULT3[s3];

-				state[3][col] = MULT3[s0] ^ s1 ^ s2 ^ MULT2[s3];

-

-			}

-

-			// Add round key

-			for (var row = 0; row < 4; row++) {

-				for (var col = 0; col < 4; col++)

-					state[row][col] ^= keyschedule[round * 4 + col][row];

-			}

-

-		}

-

-		// Sub bytes

-		for (var row = 0; row < 4; row++) {

-			for (var col = 0; col < 4; col++)

-				state[row][col] = SBOX[state[row][col]];

-		}

-

-		// Shift rows

-		state[1].push(state[1].shift());

-		state[2].push(state[2].shift());

-		state[2].push(state[2].shift());

-		state[3].unshift(state[3].pop());

-

-		// Add round key

-		for (var row = 0; row < 4; row++) {

-			for (var col = 0; col < 4; col++)

-				state[row][col] ^= keyschedule[nrounds * 4 + col][row];

-		}

-

-		// Set output

-		for (var row = 0; row < AES._blocksize; row++) {

-			for (var col = 0; col < 4; col++)

-				m[offset + col * 4 + row] = state[row][col];

-		}

-

-	},

-

-	_decryptblock: function (c, offset) {

-

-		// Set input

-		for (var row = 0; row < AES._blocksize; row++) {

-			for (var col = 0; col < 4; col++)

-				state[row][col] = c[offset + col * 4 + row];

-		}

-

-		// Add round key

-		for (var row = 0; row < 4; row++) {

-			for (var col = 0; col < 4; col++)

-				state[row][col] ^= keyschedule[nrounds * 4 + col][row];

-		}

-

-		for (var round = 1; round < nrounds; round++) {

-

-			// Inv shift rows

-			state[1].unshift(state[1].pop());

-			state[2].push(state[2].shift());

-			state[2].push(state[2].shift());

-			state[3].push(state[3].shift());

-

-			// Inv sub bytes

-			for (var row = 0; row < 4; row++) {

-				for (var col = 0; col < 4; col++)

-					state[row][col] = INVSBOX[state[row][col]];

-			}

-

-			// Add round key

-			for (var row = 0; row < 4; row++) {

-				for (var col = 0; col < 4; col++)

-					state[row][col] ^= keyschedule[(nrounds - round) * 4 + col][row];

-			}

-

-			// Inv mix columns

-			for (var col = 0; col < 4; col++) {

-

-				var s0 = state[0][col],

-				    s1 = state[1][col],

-				    s2 = state[2][col],

-				    s3 = state[3][col];

-

-				state[0][col] = MULTE[s0] ^ MULTB[s1] ^ MULTD[s2] ^ MULT9[s3];

-				state[1][col] = MULT9[s0] ^ MULTE[s1] ^ MULTB[s2] ^ MULTD[s3];

-				state[2][col] = MULTD[s0] ^ MULT9[s1] ^ MULTE[s2] ^ MULTB[s3];

-				state[3][col] = MULTB[s0] ^ MULTD[s1] ^ MULT9[s2] ^ MULTE[s3];

-

-			}

-

-		}

-

-		// Inv shift rows

-		state[1].unshift(state[1].pop());

-		state[2].push(state[2].shift());

-		state[2].push(state[2].shift());

-		state[3].push(state[3].shift());

-

-		// Inv sub bytes

-		for (var row = 0; row < 4; row++) {

-			for (var col = 0; col < 4; col++)

-				state[row][col] = INVSBOX[state[row][col]];

-		}

-

-		// Add round key

-		for (var row = 0; row < 4; row++) {

-			for (var col = 0; col < 4; col++)

-				state[row][col] ^= keyschedule[col][row];

-		}

-

-		// Set output

-		for (var row = 0; row < AES._blocksize; row++) {

-			for (var col = 0; col < 4; col++)

-				c[offset + col * 4 + row] = state[row][col];

-		}

-

-	},

-

-

-	/**

-	 * Private methods

-	 */

-

-	_init: function (k) {

-		keylength = k.length / 4;

-		nrounds = keylength + 6;

-		AES._keyexpansion(k);

-	},

-

-	// Generate a key schedule

-	_keyexpansion: function (k) {

-

-		keyschedule = [];

-

-		for (var row = 0; row < keylength; row++) {

-			keyschedule[row] = [

-				k[row * 4],

-				k[row * 4 + 1],

-				k[row * 4 + 2],

-				k[row * 4 + 3]

-			];

-		}

-

-		for (var row = keylength; row < AES._blocksize * (nrounds + 1); row++) {

-

-			var temp = [

-				keyschedule[row - 1][0],

-				keyschedule[row - 1][1],

-				keyschedule[row - 1][2],

-				keyschedule[row - 1][3]

-			];

-

-			if (row % keylength == 0) {

-

-				// Rot word

-				temp.push(temp.shift());

-

-				// Sub word

-				temp[0] = SBOX[temp[0]];

-				temp[1] = SBOX[temp[1]];

-				temp[2] = SBOX[temp[2]];

-				temp[3] = SBOX[temp[3]];

-

-				temp[0] ^= RCON[row / keylength];

-

-			} else if (keylength > 6 && row % keylength == 4) {

-

-				// Sub word

-				temp[0] = SBOX[temp[0]];

-				temp[1] = SBOX[temp[1]];

-				temp[2] = SBOX[temp[2]];

-				temp[3] = SBOX[temp[3]];

-

-			}

-

-			keyschedule[row] = [

-				keyschedule[row - keylength][0] ^ temp[0],

-				keyschedule[row - keylength][1] ^ temp[1],

-				keyschedule[row - keylength][2] ^ temp[2],

-				keyschedule[row - keylength][3] ^ temp[3]

-			];

-

-		}

-

-	}

-

-};

-

-})();

diff --git a/crypto-js/src/blockmodes.js b/crypto-js/src/blockmodes.js
deleted file mode 100644
index 1606799..0000000
--- a/crypto-js/src/blockmodes.js
+++ /dev/null
@@ -1,376 +0,0 @@
-/*!

- * Crypto-JS contribution from Simon Greatrix

- */

-

-(function(C){

-

-// Create pad namespace

-var C_pad = C.pad = {};

-

-// Calculate the number of padding bytes required.

-function _requiredPadding(cipher, message) {

-    var blockSizeInBytes = cipher._blocksize * 4;

-    var reqd = blockSizeInBytes - message.length % blockSizeInBytes;

-    return reqd;

-};

-

-// Remove padding when the final byte gives the number of padding bytes.

-var _unpadLength = function (message) {

-        var pad = message.pop();

-        for (var i = 1; i < pad; i++) {

-            message.pop();

-        }

-    };

-

-// No-operation padding, used for stream ciphers

-C_pad.NoPadding = {

-        pad : function (cipher,message) {},

-        unpad : function (message) {}

-    };

-

-// Zero Padding.

-//

-// If the message is not an exact number of blocks, the final block is

-// completed with 0x00 bytes. There is no unpadding.

-C_pad.ZeroPadding = {

-    pad : function (cipher, message) {

-        var blockSizeInBytes = cipher._blocksize * 4;

-        var reqd = message.length % blockSizeInBytes;

-        if( reqd!=0 ) {

-            for(reqd = blockSizeInBytes - reqd; reqd>0; reqd--) {

-                message.push(0x00);

-            }

-        }

-    },

-

-    unpad : function (message) {}

-};

-

-// ISO/IEC 7816-4 padding.

-//

-// Pads the plain text with an 0x80 byte followed by as many 0x00

-// bytes are required to complete the block.

-C_pad.iso7816 = {

-    pad : function (cipher, message) {

-        var reqd = _requiredPadding(cipher, message);

-        message.push(0x80);

-        for (; reqd > 1; reqd--) {

-            message.push(0x00);

-        }

-    },

-

-    unpad : function (message) {

-        while (message.pop() != 0x80) {}

-    }

-};

-

-// ANSI X.923 padding

-//

-// The final block is padded with zeros except for the last byte of the

-// last block which contains the number of padding bytes.

-C_pad.ansix923 = {

-    pad : function (cipher, message) {

-        var reqd = _requiredPadding(cipher, message);

-        for (var i = 1; i < reqd; i++) {

-            message.push(0x00);

-        }

-        message.push(reqd);

-    },

-

-    unpad : _unpadLength

-};

-

-// ISO 10126

-//

-// The final block is padded with random bytes except for the last

-// byte of the last block which contains the number of padding bytes.

-C_pad.iso10126 = {

-    pad : function (cipher, message) {

-        var reqd = _requiredPadding(cipher, message);

-        for (var i = 1; i < reqd; i++) {

-            message.push(Math.floor(Math.random() * 256));

-        }

-        message.push(reqd);

-    },

-

-    unpad : _unpadLength

-};

-

-// PKCS7 padding

-//

-// PKCS7 is described in RFC 5652. Padding is in whole bytes. The

-// value of each added byte is the number of bytes that are added,

-// i.e. N bytes, each of value N are added.

-C_pad.pkcs7 = {

-    pad : function (cipher, message) {

-        var reqd = _requiredPadding(cipher, message);

-        for (var i = 0; i < reqd; i++) {

-            message.push(reqd);

-        }

-    },

-

-    unpad : _unpadLength

-};

-

-// Create mode namespace

-var C_mode = C.mode = {};

-

-/**

- * Mode base "class".

- */

-var Mode = C_mode.Mode = function (padding) {

-    if (padding) {

-        this._padding = padding;

-    }

-};

-

-Mode.prototype = {

-    encrypt: function (cipher, m, iv) {

-        this._padding.pad(cipher, m);

-        this._doEncrypt(cipher, m, iv);

-    },

-

-    decrypt: function (cipher, m, iv) {

-        this._doDecrypt(cipher, m, iv);

-        this._padding.unpad(m);

-    },

-

-    // Default padding

-    _padding: C_pad.iso7816

-};

-

-

-/**

- * Electronic Code Book mode.

- * 

- * ECB applies the cipher directly against each block of the input.

- * 

- * ECB does not require an initialization vector.

- */

-var ECB = C_mode.ECB = function () {

-    // Call parent constructor

-    Mode.apply(this, arguments);

-};

-

-// Inherit from Mode

-var ECB_prototype = ECB.prototype = new Mode;

-

-// Concrete steps for Mode template

-ECB_prototype._doEncrypt = function (cipher, m, iv) {

-    var blockSizeInBytes = cipher._blocksize * 4;

-    // Encrypt each block

-    for (var offset = 0; offset < m.length; offset += blockSizeInBytes) {

-        cipher._encryptblock(m, offset);

-    }

-};

-ECB_prototype._doDecrypt = function (cipher, c, iv) {

-    var blockSizeInBytes = cipher._blocksize * 4;

-    // Decrypt each block

-    for (var offset = 0; offset < c.length; offset += blockSizeInBytes) {

-        cipher._decryptblock(c, offset);

-    }

-};

-

-// ECB never uses an IV

-ECB_prototype.fixOptions = function (options) {

-    options.iv = [];

-};

-

-

-/**

- * Cipher block chaining

- * 

- * The first block is XORed with the IV. Subsequent blocks are XOR with the

- * previous cipher output.

- */

-var CBC = C_mode.CBC = function () {

-    // Call parent constructor

-    Mode.apply(this, arguments);

-};

-

-// Inherit from Mode

-var CBC_prototype = CBC.prototype = new Mode;

-

-// Concrete steps for Mode template

-CBC_prototype._doEncrypt = function (cipher, m, iv) {

-    var blockSizeInBytes = cipher._blocksize * 4;

-

-    // Encrypt each block

-    for (var offset = 0; offset < m.length; offset += blockSizeInBytes) {

-        if (offset == 0) {

-            // XOR first block using IV

-            for (var i = 0; i < blockSizeInBytes; i++)

-            m[i] ^= iv[i];

-        } else {

-            // XOR this block using previous crypted block

-            for (var i = 0; i < blockSizeInBytes; i++)

-            m[offset + i] ^= m[offset + i - blockSizeInBytes];

-        }

-        // Encrypt block

-        cipher._encryptblock(m, offset);

-    }

-};

-CBC_prototype._doDecrypt = function (cipher, c, iv) {

-    var blockSizeInBytes = cipher._blocksize * 4;

-

-    // At the start, the previously crypted block is the IV

-    var prevCryptedBlock = iv;

-

-    // Decrypt each block

-    for (var offset = 0; offset < c.length; offset += blockSizeInBytes) {

-        // Save this crypted block

-        var thisCryptedBlock = c.slice(offset, offset + blockSizeInBytes);

-        // Decrypt block

-        cipher._decryptblock(c, offset);

-        // XOR decrypted block using previous crypted block

-        for (var i = 0; i < blockSizeInBytes; i++) {

-            c[offset + i] ^= prevCryptedBlock[i];

-        }

-        prevCryptedBlock = thisCryptedBlock;

-    }

-};

-

-

-/**

- * Cipher feed back

- * 

- * The cipher output is XORed with the plain text to produce the cipher output,

- * which is then fed back into the cipher to produce a bit pattern to XOR the

- * next block with.

- * 

- * This is a stream cipher mode and does not require padding.

- */

-var CFB = C_mode.CFB = function () {

-    // Call parent constructor

-    Mode.apply(this, arguments);

-};

-

-// Inherit from Mode

-var CFB_prototype = CFB.prototype = new Mode;

-

-// Override padding

-CFB_prototype._padding = C_pad.NoPadding;

-

-// Concrete steps for Mode template

-CFB_prototype._doEncrypt = function (cipher, m, iv) {

-    var blockSizeInBytes = cipher._blocksize * 4,

-        keystream = iv.slice(0);

-

-    // Encrypt each byte

-    for (var i = 0; i < m.length; i++) {

-

-        var j = i % blockSizeInBytes;

-        if (j == 0) cipher._encryptblock(keystream, 0);

-

-        m[i] ^= keystream[j];

-        keystream[j] = m[i];

-    }

-};

-CFB_prototype._doDecrypt = function (cipher, c, iv) {

-    var blockSizeInBytes = cipher._blocksize * 4,

-        keystream = iv.slice(0);

-

-    // Encrypt each byte

-    for (var i = 0; i < c.length; i++) {

-

-        var j = i % blockSizeInBytes;

-        if (j == 0) cipher._encryptblock(keystream, 0);

-

-        var b = c[i];

-        c[i] ^= keystream[j];

-        keystream[j] = b;

-    }

-};

-

-

-/**

- * Output feed back

- * 

- * The cipher repeatedly encrypts its own output. The output is XORed with the

- * plain text to produce the cipher text.

- * 

- * This is a stream cipher mode and does not require padding.

- */

-var OFB = C_mode.OFB = function () {

-    // Call parent constructor

-    Mode.apply(this, arguments);

-};

-

-// Inherit from Mode

-var OFB_prototype = OFB.prototype = new Mode;

-

-// Override padding

-OFB_prototype._padding = C_pad.NoPadding;

-

-// Concrete steps for Mode template

-OFB_prototype._doEncrypt = function (cipher, m, iv) {

-

-    var blockSizeInBytes = cipher._blocksize * 4,

-        keystream = iv.slice(0);

-

-    // Encrypt each byte

-    for (var i = 0; i < m.length; i++) {

-

-        // Generate keystream

-        if (i % blockSizeInBytes == 0)

-            cipher._encryptblock(keystream, 0);

-

-        // Encrypt byte

-        m[i] ^= keystream[i % blockSizeInBytes];

-

-    }

-};

-OFB_prototype._doDecrypt = OFB_prototype._doEncrypt;

-

-/**

- * Counter

- * @author Gergely Risko

- *

- * After every block the last 4 bytes of the IV is increased by one

- * with carry and that IV is used for the next block.

- *

- * This is a stream cipher mode and does not require padding.

- */

-var CTR = C_mode.CTR = function () {

-    // Call parent constructor

-    Mode.apply(this, arguments);

-};

-

-// Inherit from Mode

-var CTR_prototype = CTR.prototype = new Mode;

-

-// Override padding

-CTR_prototype._padding = C_pad.NoPadding;

-

-CTR_prototype._doEncrypt = function (cipher, m, iv) {

-    var blockSizeInBytes = cipher._blocksize * 4;

-    var counter = iv.slice(0);

-

-    for (var i = 0; i < m.length;) {

-        // do not lose iv

-        var keystream = counter.slice(0);

-

-        // Generate keystream for next block

-        cipher._encryptblock(keystream, 0);

-

-        // XOR keystream with block

-        for (var j = 0; i < m.length && j < blockSizeInBytes; j++, i++) {

-            m[i] ^= keystream[j];

-        }

-

-        // Increase counter

-        if(++(counter[blockSizeInBytes-1]) == 256) {

-            counter[blockSizeInBytes-1] = 0;

-            if(++(counter[blockSizeInBytes-2]) == 256) {

-                counter[blockSizeInBytes-2] = 0;

-                if(++(counter[blockSizeInBytes-3]) == 256) {

-                    counter[blockSizeInBytes-3] = 0;

-                    ++(counter[blockSizeInBytes-4]);

-                }

-            }

-        }

-    }

-};

-CTR_prototype._doDecrypt = CTR_prototype._doEncrypt;

-

-})(Crypto);

diff --git a/crypto-js/src/crypto.js b/crypto-js/src/crypto.js
deleted file mode 100644
index d596851..0000000
--- a/crypto-js/src/crypto.js
+++ /dev/null
@@ -1,155 +0,0 @@
-if (typeof Crypto == "undefined" || ! Crypto.util)

-{

-(function(){

-

-var base64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

-

-// Global Crypto object

-var Crypto = window.Crypto = {};

-

-// Crypto utilities

-var util = Crypto.util = {

-

-	// Bit-wise rotate left

-	rotl: function (n, b) {

-		return (n << b) | (n >>> (32 - b));

-	},

-

-	// Bit-wise rotate right

-	rotr: function (n, b) {

-		return (n << (32 - b)) | (n >>> b);

-	},

-

-	// Swap big-endian to little-endian and vice versa

-	endian: function (n) {

-

-		// If number given, swap endian

-		if (n.constructor == Number) {

-			return util.rotl(n,  8) & 0x00FF00FF |

-			       util.rotl(n, 24) & 0xFF00FF00;

-		}

-

-		// Else, assume array and swap all items

-		for (var i = 0; i < n.length; i++)

-			n[i] = util.endian(n[i]);

-		return n;

-

-	},

-

-	// Generate an array of any length of random bytes

-	randomBytes: function (n) {

-    var array = new Uint8Array(n);

-    crypto.getRandomValues(array);

-    // Now convert them from a Uint8Array to a regular array of ints.

-    return [].map.call(array, function(_){ return _; });

-	},

-

-	// Convert a byte array to big-endian 32-bit words

-	bytesToWords: function (bytes) {

-		for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)

-			words[b >>> 5] |= bytes[i] << (24 - b % 32);

-		return words;

-	},

-

-	// Convert big-endian 32-bit words to a byte array

-	wordsToBytes: function (words) {

-		for (var bytes = [], b = 0; b < words.length * 32; b += 8)

-			bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);

-		return bytes;

-	},

-

-	// Convert a byte array to a hex string

-	bytesToHex: function (bytes) {

-		for (var hex = [], i = 0; i < bytes.length; i++) {

-			hex.push((bytes[i] >>> 4).toString(16));

-			hex.push((bytes[i] & 0xF).toString(16));

-		}

-		return hex.join("");

-	},

-

-	// Convert a hex string to a byte array

-	hexToBytes: function (hex) {

-		for (var bytes = [], c = 0; c < hex.length; c += 2)

-			bytes.push(parseInt(hex.substr(c, 2), 16));

-		return bytes;

-	},

-

-	// Convert a byte array to a base-64 string

-	bytesToBase64: function (bytes) {

-

-		// Use browser-native function if it exists

-		if (typeof btoa == "function") return btoa(Binary.bytesToString(bytes));

-

-		for(var base64 = [], i = 0; i < bytes.length; i += 3) {

-			var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];

-			for (var j = 0; j < 4; j++) {

-				if (i * 8 + j * 6 <= bytes.length * 8)

-					base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));

-				else base64.push("=");

-			}

-		}

-

-		return base64.join("");

-

-	},

-

-	// Convert a base-64 string to a byte array

-	base64ToBytes: function (base64) {

-

-		// Use browser-native function if it exists

-		if (typeof atob == "function") return Binary.stringToBytes(atob(base64));

-

-		// Remove non-base-64 characters

-		base64 = base64.replace(/[^A-Z0-9+\/]/ig, "");

-

-		for (var bytes = [], i = 0, imod4 = 0; i < base64.length; imod4 = ++i % 4) {

-			if (imod4 == 0) continue;

-			bytes.push(((base64map.indexOf(base64.charAt(i - 1)) & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2)) |

-			           (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));

-		}

-

-		return bytes;

-

-	}

-

-};

-

-// Crypto character encodings

-var charenc = Crypto.charenc = {};

-

-// UTF-8 encoding

-var UTF8 = charenc.UTF8 = {

-

-	// Convert a string to a byte array

-	stringToBytes: function (str) {

-		return Binary.stringToBytes(unescape(encodeURIComponent(str)));

-	},

-

-	// Convert a byte array to a string

-	bytesToString: function (bytes) {

-		return decodeURIComponent(escape(Binary.bytesToString(bytes)));

-	}

-

-};

-

-// Binary encoding

-var Binary = charenc.Binary = {

-

-	// Convert a string to a byte array

-	stringToBytes: function (str) {

-		for (var bytes = [], i = 0; i < str.length; i++)

-			bytes.push(str.charCodeAt(i) & 0xFF);

-		return bytes;

-	},

-

-	// Convert a byte array to a string

-	bytesToString: function (bytes) {

-		for (var str = [], i = 0; i < bytes.length; i++)

-			str.push(String.fromCharCode(bytes[i]));

-		return str.join("");

-	}

-

-};

-

-})();

-}

diff --git a/crypto-js/src/cryptomath.js b/crypto-js/src/cryptomath.js
deleted file mode 100644
index f696d79..0000000
--- a/crypto-js/src/cryptomath.js
+++ /dev/null
@@ -1,35 +0,0 @@
-(function(){

-

-// Shortcut

-var util = Crypto.util;

-

-// Convert n to unsigned 32-bit integer

-util.u32 = function (n) {

-	return n >>> 0;

-};

-

-// Unsigned 32-bit addition

-util.add = function () {

-	var result = this.u32(arguments[0]);

-	for (var i = 1; i < arguments.length; i++)

-		result = this.u32(result + this.u32(arguments[i]));

-	return result;

-};

-

-// Unsigned 32-bit multiplication

-util.mult = function (m, n) {

-	return this.add((n & 0xFFFF0000) * m,

-			(n & 0x0000FFFF) * m);

-};

-

-// Unsigned 32-bit greater than (>) comparison

-util.gt = function (m, n) {

-	return this.u32(m) > this.u32(n);

-};

-

-// Unsigned 32-bit less than (<) comparison

-util.lt = function (m, n) {

-	return this.u32(m) < this.u32(n);

-};

-

-})();

diff --git a/crypto-js/src/des.js b/crypto-js/src/des.js
deleted file mode 100644
index 889f1ef..0000000
--- a/crypto-js/src/des.js
+++ /dev/null
@@ -1,1001 +0,0 @@
-/**

- * Definition of Data Encryption Standard (DES) taken from:

- * http://www.itl.nist.gov/fipspubs/fip46-2.htm

- */

-

-(function() {

-

-    // Shortcuts

-    var C = Crypto, util = C.util, charenc = C.charenc, UTF8 = charenc.UTF8;

-

-    /***************************************************************************

-     * 

-     * DES Key Schedule.

-     * 

-     * The Key consists of 16 sub-keys of 48 bits each. As each sub-key is

-     * applied to an expanded 32-bit value where each 4 bits of input is

-     * expanded into 6 bits of output the sub-key can be broken down into 8

-     * 32-bit values which allows the key to be used without expansion.

-     * 

-     * To create the 16 sub-keys, 56 bits are selected from the input 64 bit key

-     * according to <i>PC1</i>. Each sub-key is generated by left rotating the

-     * bits a different amount and then selecting 48 bits according to <i>PC2</i>.

-     * 

-     **************************************************************************/

-

-    var KeySchedule;

-

-    /**

-     * Representation of a DES key schedule.

-     * 

-     * @param {Array

-     *            of 8 bytes} key The cipher key

-     * 

-     * @constructor

-     */

-    KeySchedule = function(key) {

-        /**

-         * The schedule of 16 keys

-         */

-        this.keys = new Array(16);

-        this._initialiseKeys(key);

-    };

-

-    /**

-     * Permuted Choice 1 (PC1) byte offsets into the key. Each of the 56 entries

-     * selects one bit of DES's 56 bit key.

-     * <p>

-     * 

-     * <pre>

-     * The PC1 is defined as:

-     * 

-     * 57,   49,    41,   33,    25,    17,    9,

-     *  1,   58,    50,   42,    34,    26,   18,

-     * 10,    2,    59,   51,    43,    35,   27,

-     * 19,   11,     3,   60,    52,    44,   36,

-     * 63,   55,    47,   39,    31,    23,   15,

-     *  7,   62,    54,   46,    38,    30,   22,

-     * 14,    6,    61,   53,    45,    37,   29,

-     * 21,   13,     5,   28,    20,    12,    4

-     * </pre>

-     * 

-     * We represent this as an offset into an 8-byte array and a bit mask upon

-     * that byte. For example 57=(7*8)+1 so is the first (MSB) of the 7th byte.

-     * 

-     * @constant

-     */

-    KeySchedule.PC1_offsets = [ 7, 6, 5, 4, 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1, 0,

-            7, 6, 5, 4, 3, 2, 1, 0, 7, 6, 5, 4, 7, 6, 5, 4, 3, 2, 1, 0, 7, 6,

-            5, 4, 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1, 0, 3, 2, 1, 0 ];

-

-    /**

-     * Permuted Choice 1 (PC1) bit masks. Each of the 56 entries selects one bit

-     * of DES's 56 bit key.

-     * 

-     * @constant

-     */

-    KeySchedule.PC1_masks = [ 128, 128, 128, 128, 128, 128, 128, 128, 64, 64,

-            64, 64, 64, 64, 64, 64, 32, 32, 32, 32, 32, 32, 32, 32, 16, 16, 16,

-            16, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8,

-            8, 8, 8, 16, 16, 16, 16 ];

-

-    /**

-     * Permuted Choice 2 (PC2) selects the active 48 bits from the 56 bits of

-     * the key.

-     * <p>

-     * 

-     * <pre>

-     * The PC2 is defined as:

-     * 

-     * 14,   17,   11,   24,    1,    5,

-     *  3,   28,   15,    6,   21,   10,

-     * 23,   19,   12,    4,   26,    8,

-     * 16,    7,   27,   20,   13,    2,

-     * 41,   52,   31,   37,   47,   55,

-     * 30,   40,   51,   45,   33,   48,

-     * 44,   49,   39,   56,   34,   53,

-     * 46,   42,   50,   36,   29,   32

-     * </pre>

-     * 

-     * We invert the choice to specify what each bit adds to each 6-bit value of

-     * the key. For example, bit 1 is the 5th bit selected so this add 2 to the

-     * first 6-bit value.

-     * 

-     * @constant

-     */

-    KeySchedule.PC2_offsets1 = [ 0, 3, 1, 2, 0, 1, 3, 2, 0, 1, 0, 2, 3, 0, 1,

-            3, 0, 0, 2, 3, 1, 0, 2, 0, 0, 2, 3, 1 ];

-

-    /**

-     * PC2 offsets for 2nd block.

-     * 

-     * @constant

-     */

-    KeySchedule.PC2_offsets2 = [ 7, 5, 4, 7, 5, 6, 0, 7, 4, 0, 6, 5, 4, 7, 0,

-            6, 5, 7, 4, 5, 6, 7, 5, 4, 6, 0, 4, 6 ];

-

-    /**

-     * Permuted Choice 2 (PC2) masks for 1st block.

-     * 

-     * @constant

-     */

-    KeySchedule.PC2_masks1 = [ 2, 1, 32, 4, 1, 4, 16, 1, 0, 1, 8, 8, 2, 32, 8,

-            32, 16, 0, 16, 4, 2, 0, 32, 4, 0, 2, 8, 16 ];

-

-    /**

-     * PC2 masks for 2nd block.

-     * 

-     * @constant

-     */

-    KeySchedule.PC2_masks2 = [ 2, 32, 8, 1, 2, 2, 0, 4, 4, 0, 8, 16, 32, 16, 0,

-            32, 4, 32, 2, 1, 16, 8, 8, 16, 1, 0, 1, 4 ];

-

-    /**

-     * Cumulative key shifts.

-     * 

-     * @constant

-     */

-    KeySchedule.keyShifts = [ 1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23,

-            25, 27, 28 ];

-

-    KeySchedule.prototype._initialiseKeys = function(key) {

-        var i;

-

-        // extract 56 key bits in order determined by PC1

-        var bits = new Array(56);

-        for (i = 0; i < 56; i++) {

-            bits[i] = (key[KeySchedule.PC1_offsets[i]] & KeySchedule.PC1_masks[i]) != 0;

-        }

-

-        // split 56 bits into two 28-bit chunks

-        var bits1 = bits.slice(0, 28);

-        var bits2 = bits.slice(28, 56);

-

-        // duplicate each half to allow for easy bit shifts

-        bits1 = bits1.concat(bits1);

-        bits2 = bits2.concat(bits2);

-

-        // assemble the 16 keys

-        for (i = 0; i < 16; i++) {

-            var k = [ 0, 0, 0, 0, 0, 0, 0, 0 ];

-

-            // select the bits of the key according to PC2

-            var s = KeySchedule.keyShifts[i];

-            for ( var j = 0; j < 28; j++) {

-                if (bits1[j + s]) {

-                    k[KeySchedule.PC2_offsets1[j]] += KeySchedule.PC2_masks1[j];

-                }

-                if (bits2[j + s]) {

-                    k[KeySchedule.PC2_offsets2[j]] += KeySchedule.PC2_masks2[j];

-                }

-            }

-

-            // Scale each of the 8 blocks to a 32-bit mask.

-            k[0] = ((k[0] & 0x1f) << 27) + ((k[0] & 0x20) >> 5);

-            for ( var j = 1; j <= 6; j++) {

-                k[j] = k[j] << (27 - 4 * j);

-            }

-            k[7] = ((k[7] & 0x3e) >> 1) + ((k[7] & 0x1) << 31);

-            this.keys[i] = k;

-        }

-    };

-

-    /**

-     * Retrieve the key for a specified round

-     * 

-     * @param i

-     *            the round

-     * @returns the key

-     */

-    KeySchedule.prototype.getKey = function(i) {

-        return this.keys[i];

-    };

-

-    /***************************************************************************

-     * 

-     * DES Engine State

-     * 

-     **************************************************************************/

-

-    var State;

-

-    /**

-     * The algorithm's state. DES operates on two sets of 32-bits, with each

-     * block of 32-bits treated as a single number.

-     * 

-     * @class

-     */

-    State = function() {

-        /** The LHS of the Feistel scheme */

-        this.lhs = 0;

-        /** The RHS of the Feistel scheme */

-        this.rhs = 0;

-    };

-

-    /**

-     * The masks that select the SBOX input. Each SBOX accepts 6 bits from the

-     * input.

-     * 

-     * @constant

-     */

-    State.SBOX_MASK = [ 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000,

-            0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f ];

-

-    /**

-     * The SBOXes. The 8 SBOXes each map 6 bit masked bit of the input to 4 bits

-     * of output. These SBOXes include the post SBOX permutation and benefit

-     * from JavaScript's sparse arrays to make specifying the input match

-     * simple.

-     * 

-     * @constant

-     */

-    State.SBOX = new Array(8);

-

-    var SBOX = State.SBOX;

-

-    SBOX[0] = new Array();

-    SBOX[0][0] = 0x808200; // 0 (0, 0) = 14

-    SBOX[0][268435456] = 0x8000; // 10000000 (0, 1) = 4

-    SBOX[0][536870912] = 0x808002; // 20000000 (0, 2) = 13

-    SBOX[0][805306368] = 0x2; // 30000000 (0, 3) = 1

-    SBOX[0][1073741824] = 0x200; // 40000000 (0, 4) = 2

-    SBOX[0][1342177280] = 0x808202; // 50000000 (0, 5) = 15

-    SBOX[0][1610612736] = 0x800202; // 60000000 (0, 6) = 11

-    SBOX[0][1879048192] = 0x800000; // 70000000 (0, 7) = 8

-    SBOX[0][-2147483648] = 0x202; // 80000000 (0, 8) = 3

-    SBOX[0][-1879048192] = 0x800200; // 90000000 (0, 9) = 10

-    SBOX[0][-1610612736] = 0x8200; // a0000000 (0, 10) = 6

-    SBOX[0][-1342177280] = 0x808000; // b0000000 (0, 11) = 12

-    SBOX[0][-1073741824] = 0x8002; // c0000000 (0, 12) = 5

-    SBOX[0][-805306368] = 0x800002; // d0000000 (0, 13) = 9

-    SBOX[0][-536870912] = 0x0; // e0000000 (0, 14) = 0

-    SBOX[0][-268435456] = 0x8202; // f0000000 (0, 15) = 7

-    SBOX[0][134217728] = 0x0; // 8000000 (1, 0) = 0

-    SBOX[0][402653184] = 0x808202; // 18000000 (1, 1) = 15

-    SBOX[0][671088640] = 0x8202; // 28000000 (1, 2) = 7

-    SBOX[0][939524096] = 0x8000; // 38000000 (1, 3) = 4

-    SBOX[0][1207959552] = 0x808200; // 48000000 (1, 4) = 14

-    SBOX[0][1476395008] = 0x200; // 58000000 (1, 5) = 2

-    SBOX[0][1744830464] = 0x808002; // 68000000 (1, 6) = 13

-    SBOX[0][2013265920] = 0x2; // 78000000 (1, 7) = 1

-    SBOX[0][-2013265920] = 0x800200; // 88000000 (1, 8) = 10

-    SBOX[0][-1744830464] = 0x8200; // 98000000 (1, 9) = 6

-    SBOX[0][-1476395008] = 0x808000; // a8000000 (1, 10) = 12

-    SBOX[0][-1207959552] = 0x800202; // b8000000 (1, 11) = 11

-    SBOX[0][-939524096] = 0x800002; // c8000000 (1, 12) = 9

-    SBOX[0][-671088640] = 0x8002; // d8000000 (1, 13) = 5

-    SBOX[0][-402653184] = 0x202; // e8000000 (1, 14) = 3

-    SBOX[0][-134217728] = 0x800000; // f8000000 (1, 15) = 8

-    SBOX[0][1] = 0x8000; // 1 (2, 0) = 4

-    SBOX[0][268435457] = 0x2; // 10000001 (2, 1) = 1

-    SBOX[0][536870913] = 0x808200; // 20000001 (2, 2) = 14

-    SBOX[0][805306369] = 0x800000; // 30000001 (2, 3) = 8

-    SBOX[0][1073741825] = 0x808002; // 40000001 (2, 4) = 13

-    SBOX[0][1342177281] = 0x8200; // 50000001 (2, 5) = 6

-    SBOX[0][1610612737] = 0x200; // 60000001 (2, 6) = 2

-    SBOX[0][1879048193] = 0x800202; // 70000001 (2, 7) = 11

-    SBOX[0][-2147483647] = 0x808202; // 80000001 (2, 8) = 15

-    SBOX[0][-1879048191] = 0x808000; // 90000001 (2, 9) = 12

-    SBOX[0][-1610612735] = 0x800002; // a0000001 (2, 10) = 9

-    SBOX[0][-1342177279] = 0x8202; // b0000001 (2, 11) = 7

-    SBOX[0][-1073741823] = 0x202; // c0000001 (2, 12) = 3

-    SBOX[0][-805306367] = 0x800200; // d0000001 (2, 13) = 10

-    SBOX[0][-536870911] = 0x8002; // e0000001 (2, 14) = 5

-    SBOX[0][-268435455] = 0x0; // f0000001 (2, 15) = 0

-    SBOX[0][134217729] = 0x808202; // 8000001 (3, 0) = 15

-    SBOX[0][402653185] = 0x808000; // 18000001 (3, 1) = 12

-    SBOX[0][671088641] = 0x800000; // 28000001 (3, 2) = 8

-    SBOX[0][939524097] = 0x200; // 38000001 (3, 3) = 2

-    SBOX[0][1207959553] = 0x8000; // 48000001 (3, 4) = 4

-    SBOX[0][1476395009] = 0x800002; // 58000001 (3, 5) = 9

-    SBOX[0][1744830465] = 0x2; // 68000001 (3, 6) = 1

-    SBOX[0][2013265921] = 0x8202; // 78000001 (3, 7) = 7

-    SBOX[0][-2013265919] = 0x8002; // 88000001 (3, 8) = 5

-    SBOX[0][-1744830463] = 0x800202; // 98000001 (3, 9) = 11

-    SBOX[0][-1476395007] = 0x202; // a8000001 (3, 10) = 3

-    SBOX[0][-1207959551] = 0x808200; // b8000001 (3, 11) = 14

-    SBOX[0][-939524095] = 0x800200; // c8000001 (3, 12) = 10

-    SBOX[0][-671088639] = 0x0; // d8000001 (3, 13) = 0

-    SBOX[0][-402653183] = 0x8200; // e8000001 (3, 14) = 6

-    SBOX[0][-134217727] = 0x808002; // f8000001 (3, 15) = 13

-

-    SBOX[1] = new Array();

-    SBOX[1][0] = 0x40084010; // 0 (0, 0) = 15

-    SBOX[1][16777216] = 0x4000; // 1000000 (0, 1) = 1

-    SBOX[1][33554432] = 0x80000; // 2000000 (0, 2) = 8

-    SBOX[1][50331648] = 0x40080010; // 3000000 (0, 3) = 14

-    SBOX[1][67108864] = 0x40000010; // 4000000 (0, 4) = 6

-    SBOX[1][83886080] = 0x40084000; // 5000000 (0, 5) = 11

-    SBOX[1][100663296] = 0x40004000; // 6000000 (0, 6) = 3

-    SBOX[1][117440512] = 0x10; // 7000000 (0, 7) = 4

-    SBOX[1][134217728] = 0x84000; // 8000000 (0, 8) = 9

-    SBOX[1][150994944] = 0x40004010; // 9000000 (0, 9) = 7

-    SBOX[1][167772160] = 0x40000000; // a000000 (0, 10) = 2

-    SBOX[1][184549376] = 0x84010; // b000000 (0, 11) = 13

-    SBOX[1][201326592] = 0x80010; // c000000 (0, 12) = 12

-    SBOX[1][218103808] = 0x0; // d000000 (0, 13) = 0

-    SBOX[1][234881024] = 0x4010; // e000000 (0, 14) = 5

-    SBOX[1][251658240] = 0x40080000; // f000000 (0, 15) = 10

-    SBOX[1][8388608] = 0x40004000; // 800000 (1, 0) = 3

-    SBOX[1][25165824] = 0x84010; // 1800000 (1, 1) = 13

-    SBOX[1][41943040] = 0x10; // 2800000 (1, 2) = 4

-    SBOX[1][58720256] = 0x40004010; // 3800000 (1, 3) = 7

-    SBOX[1][75497472] = 0x40084010; // 4800000 (1, 4) = 15

-    SBOX[1][92274688] = 0x40000000; // 5800000 (1, 5) = 2

-    SBOX[1][109051904] = 0x80000; // 6800000 (1, 6) = 8

-    SBOX[1][125829120] = 0x40080010; // 7800000 (1, 7) = 14

-    SBOX[1][142606336] = 0x80010; // 8800000 (1, 8) = 12

-    SBOX[1][159383552] = 0x0; // 9800000 (1, 9) = 0

-    SBOX[1][176160768] = 0x4000; // a800000 (1, 10) = 1

-    SBOX[1][192937984] = 0x40080000; // b800000 (1, 11) = 10

-    SBOX[1][209715200] = 0x40000010; // c800000 (1, 12) = 6

-    SBOX[1][226492416] = 0x84000; // d800000 (1, 13) = 9

-    SBOX[1][243269632] = 0x40084000; // e800000 (1, 14) = 11

-    SBOX[1][260046848] = 0x4010; // f800000 (1, 15) = 5

-    SBOX[1][268435456] = 0x0; // 10000000 (2, 0) = 0

-    SBOX[1][285212672] = 0x40080010; // 11000000 (2, 1) = 14

-    SBOX[1][301989888] = 0x40004010; // 12000000 (2, 2) = 7

-    SBOX[1][318767104] = 0x40084000; // 13000000 (2, 3) = 11

-    SBOX[1][335544320] = 0x40080000; // 14000000 (2, 4) = 10

-    SBOX[1][352321536] = 0x10; // 15000000 (2, 5) = 4

-    SBOX[1][369098752] = 0x84010; // 16000000 (2, 6) = 13

-    SBOX[1][385875968] = 0x4000; // 17000000 (2, 7) = 1

-    SBOX[1][402653184] = 0x4010; // 18000000 (2, 8) = 5

-    SBOX[1][419430400] = 0x80000; // 19000000 (2, 9) = 8

-    SBOX[1][436207616] = 0x80010; // 1a000000 (2, 10) = 12

-    SBOX[1][452984832] = 0x40000010; // 1b000000 (2, 11) = 6

-    SBOX[1][469762048] = 0x84000; // 1c000000 (2, 12) = 9

-    SBOX[1][486539264] = 0x40004000; // 1d000000 (2, 13) = 3

-    SBOX[1][503316480] = 0x40000000; // 1e000000 (2, 14) = 2

-    SBOX[1][520093696] = 0x40084010; // 1f000000 (2, 15) = 15

-    SBOX[1][276824064] = 0x84010; // 10800000 (3, 0) = 13

-    SBOX[1][293601280] = 0x80000; // 11800000 (3, 1) = 8

-    SBOX[1][310378496] = 0x40080000; // 12800000 (3, 2) = 10

-    SBOX[1][327155712] = 0x4000; // 13800000 (3, 3) = 1

-    SBOX[1][343932928] = 0x40004000; // 14800000 (3, 4) = 3

-    SBOX[1][360710144] = 0x40084010; // 15800000 (3, 5) = 15

-    SBOX[1][377487360] = 0x10; // 16800000 (3, 6) = 4

-    SBOX[1][394264576] = 0x40000000; // 17800000 (3, 7) = 2

-    SBOX[1][411041792] = 0x40084000; // 18800000 (3, 8) = 11

-    SBOX[1][427819008] = 0x40000010; // 19800000 (3, 9) = 6

-    SBOX[1][444596224] = 0x40004010; // 1a800000 (3, 10) = 7

-    SBOX[1][461373440] = 0x80010; // 1b800000 (3, 11) = 12

-    SBOX[1][478150656] = 0x0; // 1c800000 (3, 12) = 0

-    SBOX[1][494927872] = 0x4010; // 1d800000 (3, 13) = 5

-    SBOX[1][511705088] = 0x40080010; // 1e800000 (3, 14) = 14

-    SBOX[1][528482304] = 0x84000; // 1f800000 (3, 15) = 9

-

-    SBOX[2] = new Array();

-    SBOX[2][0] = 0x104; // 0 (0, 0) = 10

-    SBOX[2][1048576] = 0x0; // 100000 (0, 1) = 0

-    SBOX[2][2097152] = 0x4000100; // 200000 (0, 2) = 9

-    SBOX[2][3145728] = 0x10104; // 300000 (0, 3) = 14

-    SBOX[2][4194304] = 0x10004; // 400000 (0, 4) = 6

-    SBOX[2][5242880] = 0x4000004; // 500000 (0, 5) = 3

-    SBOX[2][6291456] = 0x4010104; // 600000 (0, 6) = 15

-    SBOX[2][7340032] = 0x4010000; // 700000 (0, 7) = 5

-    SBOX[2][8388608] = 0x4000000; // 800000 (0, 8) = 1

-    SBOX[2][9437184] = 0x4010100; // 900000 (0, 9) = 13

-    SBOX[2][10485760] = 0x10100; // a00000 (0, 10) = 12

-    SBOX[2][11534336] = 0x4010004; // b00000 (0, 11) = 7

-    SBOX[2][12582912] = 0x4000104; // c00000 (0, 12) = 11

-    SBOX[2][13631488] = 0x10000; // d00000 (0, 13) = 4

-    SBOX[2][14680064] = 0x4; // e00000 (0, 14) = 2

-    SBOX[2][15728640] = 0x100; // f00000 (0, 15) = 8

-    SBOX[2][524288] = 0x4010100; // 80000 (1, 0) = 13

-    SBOX[2][1572864] = 0x4010004; // 180000 (1, 1) = 7

-    SBOX[2][2621440] = 0x0; // 280000 (1, 2) = 0

-    SBOX[2][3670016] = 0x4000100; // 380000 (1, 3) = 9

-    SBOX[2][4718592] = 0x4000004; // 480000 (1, 4) = 3

-    SBOX[2][5767168] = 0x10000; // 580000 (1, 5) = 4

-    SBOX[2][6815744] = 0x10004; // 680000 (1, 6) = 6

-    SBOX[2][7864320] = 0x104; // 780000 (1, 7) = 10

-    SBOX[2][8912896] = 0x4; // 880000 (1, 8) = 2

-    SBOX[2][9961472] = 0x100; // 980000 (1, 9) = 8

-    SBOX[2][11010048] = 0x4010000; // a80000 (1, 10) = 5

-    SBOX[2][12058624] = 0x10104; // b80000 (1, 11) = 14

-    SBOX[2][13107200] = 0x10100; // c80000 (1, 12) = 12

-    SBOX[2][14155776] = 0x4000104; // d80000 (1, 13) = 11

-    SBOX[2][15204352] = 0x4010104; // e80000 (1, 14) = 15

-    SBOX[2][16252928] = 0x4000000; // f80000 (1, 15) = 1

-    SBOX[2][16777216] = 0x4010100; // 1000000 (2, 0) = 13

-    SBOX[2][17825792] = 0x10004; // 1100000 (2, 1) = 6

-    SBOX[2][18874368] = 0x10000; // 1200000 (2, 2) = 4

-    SBOX[2][19922944] = 0x4000100; // 1300000 (2, 3) = 9

-    SBOX[2][20971520] = 0x100; // 1400000 (2, 4) = 8

-    SBOX[2][22020096] = 0x4010104; // 1500000 (2, 5) = 15

-    SBOX[2][23068672] = 0x4000004; // 1600000 (2, 6) = 3

-    SBOX[2][24117248] = 0x0; // 1700000 (2, 7) = 0

-    SBOX[2][25165824] = 0x4000104; // 1800000 (2, 8) = 11

-    SBOX[2][26214400] = 0x4000000; // 1900000 (2, 9) = 1

-    SBOX[2][27262976] = 0x4; // 1a00000 (2, 10) = 2

-    SBOX[2][28311552] = 0x10100; // 1b00000 (2, 11) = 12

-    SBOX[2][29360128] = 0x4010000; // 1c00000 (2, 12) = 5

-    SBOX[2][30408704] = 0x104; // 1d00000 (2, 13) = 10

-    SBOX[2][31457280] = 0x10104; // 1e00000 (2, 14) = 14

-    SBOX[2][32505856] = 0x4010004; // 1f00000 (2, 15) = 7

-    SBOX[2][17301504] = 0x4000000; // 1080000 (3, 0) = 1

-    SBOX[2][18350080] = 0x104; // 1180000 (3, 1) = 10

-    SBOX[2][19398656] = 0x4010100; // 1280000 (3, 2) = 13

-    SBOX[2][20447232] = 0x0; // 1380000 (3, 3) = 0

-    SBOX[2][21495808] = 0x10004; // 1480000 (3, 4) = 6

-    SBOX[2][22544384] = 0x4000100; // 1580000 (3, 5) = 9

-    SBOX[2][23592960] = 0x100; // 1680000 (3, 6) = 8

-    SBOX[2][24641536] = 0x4010004; // 1780000 (3, 7) = 7

-    SBOX[2][25690112] = 0x10000; // 1880000 (3, 8) = 4

-    SBOX[2][26738688] = 0x4010104; // 1980000 (3, 9) = 15

-    SBOX[2][27787264] = 0x10104; // 1a80000 (3, 10) = 14

-    SBOX[2][28835840] = 0x4000004; // 1b80000 (3, 11) = 3

-    SBOX[2][29884416] = 0x4000104; // 1c80000 (3, 12) = 11

-    SBOX[2][30932992] = 0x4010000; // 1d80000 (3, 13) = 5

-    SBOX[2][31981568] = 0x4; // 1e80000 (3, 14) = 2

-    SBOX[2][33030144] = 0x10100; // 1f80000 (3, 15) = 12

-

-    SBOX[3] = new Array();

-    SBOX[3][0] = 0x80401000; // 0 (0, 0) = 7

-    SBOX[3][65536] = 0x80001040; // 10000 (0, 1) = 13

-    SBOX[3][131072] = 0x401040; // 20000 (0, 2) = 14

-    SBOX[3][196608] = 0x80400000; // 30000 (0, 3) = 3

-    SBOX[3][262144] = 0x0; // 40000 (0, 4) = 0

-    SBOX[3][327680] = 0x401000; // 50000 (0, 5) = 6

-    SBOX[3][393216] = 0x80000040; // 60000 (0, 6) = 9

-    SBOX[3][458752] = 0x400040; // 70000 (0, 7) = 10

-    SBOX[3][524288] = 0x80000000; // 80000 (0, 8) = 1

-    SBOX[3][589824] = 0x400000; // 90000 (0, 9) = 2

-    SBOX[3][655360] = 0x40; // a0000 (0, 10) = 8

-    SBOX[3][720896] = 0x80001000; // b0000 (0, 11) = 5

-    SBOX[3][786432] = 0x80400040; // c0000 (0, 12) = 11

-    SBOX[3][851968] = 0x1040; // d0000 (0, 13) = 12

-    SBOX[3][917504] = 0x1000; // e0000 (0, 14) = 4

-    SBOX[3][983040] = 0x80401040; // f0000 (0, 15) = 15

-    SBOX[3][32768] = 0x80001040; // 8000 (1, 0) = 13

-    SBOX[3][98304] = 0x40; // 18000 (1, 1) = 8

-    SBOX[3][163840] = 0x80400040; // 28000 (1, 2) = 11

-    SBOX[3][229376] = 0x80001000; // 38000 (1, 3) = 5

-    SBOX[3][294912] = 0x401000; // 48000 (1, 4) = 6

-    SBOX[3][360448] = 0x80401040; // 58000 (1, 5) = 15

-    SBOX[3][425984] = 0x0; // 68000 (1, 6) = 0

-    SBOX[3][491520] = 0x80400000; // 78000 (1, 7) = 3

-    SBOX[3][557056] = 0x1000; // 88000 (1, 8) = 4

-    SBOX[3][622592] = 0x80401000; // 98000 (1, 9) = 7

-    SBOX[3][688128] = 0x400000; // a8000 (1, 10) = 2

-    SBOX[3][753664] = 0x1040; // b8000 (1, 11) = 12

-    SBOX[3][819200] = 0x80000000; // c8000 (1, 12) = 1

-    SBOX[3][884736] = 0x400040; // d8000 (1, 13) = 10

-    SBOX[3][950272] = 0x401040; // e8000 (1, 14) = 14

-    SBOX[3][1015808] = 0x80000040; // f8000 (1, 15) = 9

-    SBOX[3][1048576] = 0x400040; // 100000 (2, 0) = 10

-    SBOX[3][1114112] = 0x401000; // 110000 (2, 1) = 6

-    SBOX[3][1179648] = 0x80000040; // 120000 (2, 2) = 9

-    SBOX[3][1245184] = 0x0; // 130000 (2, 3) = 0

-    SBOX[3][1310720] = 0x1040; // 140000 (2, 4) = 12

-    SBOX[3][1376256] = 0x80400040; // 150000 (2, 5) = 11

-    SBOX[3][1441792] = 0x80401000; // 160000 (2, 6) = 7

-    SBOX[3][1507328] = 0x80001040; // 170000 (2, 7) = 13

-    SBOX[3][1572864] = 0x80401040; // 180000 (2, 8) = 15

-    SBOX[3][1638400] = 0x80000000; // 190000 (2, 9) = 1

-    SBOX[3][1703936] = 0x80400000; // 1a0000 (2, 10) = 3

-    SBOX[3][1769472] = 0x401040; // 1b0000 (2, 11) = 14

-    SBOX[3][1835008] = 0x80001000; // 1c0000 (2, 12) = 5

-    SBOX[3][1900544] = 0x400000; // 1d0000 (2, 13) = 2

-    SBOX[3][1966080] = 0x40; // 1e0000 (2, 14) = 8

-    SBOX[3][2031616] = 0x1000; // 1f0000 (2, 15) = 4

-    SBOX[3][1081344] = 0x80400000; // 108000 (3, 0) = 3

-    SBOX[3][1146880] = 0x80401040; // 118000 (3, 1) = 15

-    SBOX[3][1212416] = 0x0; // 128000 (3, 2) = 0

-    SBOX[3][1277952] = 0x401000; // 138000 (3, 3) = 6

-    SBOX[3][1343488] = 0x400040; // 148000 (3, 4) = 10

-    SBOX[3][1409024] = 0x80000000; // 158000 (3, 5) = 1

-    SBOX[3][1474560] = 0x80001040; // 168000 (3, 6) = 13

-    SBOX[3][1540096] = 0x40; // 178000 (3, 7) = 8

-    SBOX[3][1605632] = 0x80000040; // 188000 (3, 8) = 9

-    SBOX[3][1671168] = 0x1000; // 198000 (3, 9) = 4

-    SBOX[3][1736704] = 0x80001000; // 1a8000 (3, 10) = 5

-    SBOX[3][1802240] = 0x80400040; // 1b8000 (3, 11) = 11

-    SBOX[3][1867776] = 0x1040; // 1c8000 (3, 12) = 12

-    SBOX[3][1933312] = 0x80401000; // 1d8000 (3, 13) = 7

-    SBOX[3][1998848] = 0x400000; // 1e8000 (3, 14) = 2

-    SBOX[3][2064384] = 0x401040; // 1f8000 (3, 15) = 14

-

-    SBOX[4] = new Array();

-    SBOX[4][0] = 0x80; // 0 (0, 0) = 2

-    SBOX[4][4096] = 0x1040000; // 1000 (0, 1) = 12

-    SBOX[4][8192] = 0x40000; // 2000 (0, 2) = 4

-    SBOX[4][12288] = 0x20000000; // 3000 (0, 3) = 1

-    SBOX[4][16384] = 0x20040080; // 4000 (0, 4) = 7

-    SBOX[4][20480] = 0x1000080; // 5000 (0, 5) = 10

-    SBOX[4][24576] = 0x21000080; // 6000 (0, 6) = 11

-    SBOX[4][28672] = 0x40080; // 7000 (0, 7) = 6

-    SBOX[4][32768] = 0x1000000; // 8000 (0, 8) = 8

-    SBOX[4][36864] = 0x20040000; // 9000 (0, 9) = 5

-    SBOX[4][40960] = 0x20000080; // a000 (0, 10) = 3

-    SBOX[4][45056] = 0x21040080; // b000 (0, 11) = 15

-    SBOX[4][49152] = 0x21040000; // c000 (0, 12) = 13

-    SBOX[4][53248] = 0x0; // d000 (0, 13) = 0

-    SBOX[4][57344] = 0x1040080; // e000 (0, 14) = 14

-    SBOX[4][61440] = 0x21000000; // f000 (0, 15) = 9

-    SBOX[4][2048] = 0x1040080; // 800 (1, 0) = 14

-    SBOX[4][6144] = 0x21000080; // 1800 (1, 1) = 11

-    SBOX[4][10240] = 0x80; // 2800 (1, 2) = 2

-    SBOX[4][14336] = 0x1040000; // 3800 (1, 3) = 12

-    SBOX[4][18432] = 0x40000; // 4800 (1, 4) = 4

-    SBOX[4][22528] = 0x20040080; // 5800 (1, 5) = 7

-    SBOX[4][26624] = 0x21040000; // 6800 (1, 6) = 13

-    SBOX[4][30720] = 0x20000000; // 7800 (1, 7) = 1

-    SBOX[4][34816] = 0x20040000; // 8800 (1, 8) = 5

-    SBOX[4][38912] = 0x0; // 9800 (1, 9) = 0

-    SBOX[4][43008] = 0x21040080; // a800 (1, 10) = 15

-    SBOX[4][47104] = 0x1000080; // b800 (1, 11) = 10

-    SBOX[4][51200] = 0x20000080; // c800 (1, 12) = 3

-    SBOX[4][55296] = 0x21000000; // d800 (1, 13) = 9

-    SBOX[4][59392] = 0x1000000; // e800 (1, 14) = 8

-    SBOX[4][63488] = 0x40080; // f800 (1, 15) = 6

-    SBOX[4][65536] = 0x40000; // 10000 (2, 0) = 4

-    SBOX[4][69632] = 0x80; // 11000 (2, 1) = 2

-    SBOX[4][73728] = 0x20000000; // 12000 (2, 2) = 1

-    SBOX[4][77824] = 0x21000080; // 13000 (2, 3) = 11

-    SBOX[4][81920] = 0x1000080; // 14000 (2, 4) = 10

-    SBOX[4][86016] = 0x21040000; // 15000 (2, 5) = 13

-    SBOX[4][90112] = 0x20040080; // 16000 (2, 6) = 7

-    SBOX[4][94208] = 0x1000000; // 17000 (2, 7) = 8

-    SBOX[4][98304] = 0x21040080; // 18000 (2, 8) = 15

-    SBOX[4][102400] = 0x21000000; // 19000 (2, 9) = 9

-    SBOX[4][106496] = 0x1040000; // 1a000 (2, 10) = 12

-    SBOX[4][110592] = 0x20040000; // 1b000 (2, 11) = 5

-    SBOX[4][114688] = 0x40080; // 1c000 (2, 12) = 6

-    SBOX[4][118784] = 0x20000080; // 1d000 (2, 13) = 3

-    SBOX[4][122880] = 0x0; // 1e000 (2, 14) = 0

-    SBOX[4][126976] = 0x1040080; // 1f000 (2, 15) = 14

-    SBOX[4][67584] = 0x21000080; // 10800 (3, 0) = 11

-    SBOX[4][71680] = 0x1000000; // 11800 (3, 1) = 8

-    SBOX[4][75776] = 0x1040000; // 12800 (3, 2) = 12

-    SBOX[4][79872] = 0x20040080; // 13800 (3, 3) = 7

-    SBOX[4][83968] = 0x20000000; // 14800 (3, 4) = 1

-    SBOX[4][88064] = 0x1040080; // 15800 (3, 5) = 14

-    SBOX[4][92160] = 0x80; // 16800 (3, 6) = 2

-    SBOX[4][96256] = 0x21040000; // 17800 (3, 7) = 13

-    SBOX[4][100352] = 0x40080; // 18800 (3, 8) = 6

-    SBOX[4][104448] = 0x21040080; // 19800 (3, 9) = 15

-    SBOX[4][108544] = 0x0; // 1a800 (3, 10) = 0

-    SBOX[4][112640] = 0x21000000; // 1b800 (3, 11) = 9

-    SBOX[4][116736] = 0x1000080; // 1c800 (3, 12) = 10

-    SBOX[4][120832] = 0x40000; // 1d800 (3, 13) = 4

-    SBOX[4][124928] = 0x20040000; // 1e800 (3, 14) = 5

-    SBOX[4][129024] = 0x20000080; // 1f800 (3, 15) = 3

-

-    SBOX[5] = new Array();

-    SBOX[5][0] = 0x10000008; // 0 (0, 0) = 12

-    SBOX[5][256] = 0x2000; // 100 (0, 1) = 1

-    SBOX[5][512] = 0x10200000; // 200 (0, 2) = 10

-    SBOX[5][768] = 0x10202008; // 300 (0, 3) = 15

-    SBOX[5][1024] = 0x10002000; // 400 (0, 4) = 9

-    SBOX[5][1280] = 0x200000; // 500 (0, 5) = 2

-    SBOX[5][1536] = 0x200008; // 600 (0, 6) = 6

-    SBOX[5][1792] = 0x10000000; // 700 (0, 7) = 8

-    SBOX[5][2048] = 0x0; // 800 (0, 8) = 0

-    SBOX[5][2304] = 0x10002008; // 900 (0, 9) = 13

-    SBOX[5][2560] = 0x202000; // a00 (0, 10) = 3

-    SBOX[5][2816] = 0x8; // b00 (0, 11) = 4

-    SBOX[5][3072] = 0x10200008; // c00 (0, 12) = 14

-    SBOX[5][3328] = 0x202008; // d00 (0, 13) = 7

-    SBOX[5][3584] = 0x2008; // e00 (0, 14) = 5

-    SBOX[5][3840] = 0x10202000; // f00 (0, 15) = 11

-    SBOX[5][128] = 0x10200000; // 80 (1, 0) = 10

-    SBOX[5][384] = 0x10202008; // 180 (1, 1) = 15

-    SBOX[5][640] = 0x8; // 280 (1, 2) = 4

-    SBOX[5][896] = 0x200000; // 380 (1, 3) = 2

-    SBOX[5][1152] = 0x202008; // 480 (1, 4) = 7

-    SBOX[5][1408] = 0x10000008; // 580 (1, 5) = 12

-    SBOX[5][1664] = 0x10002000; // 680 (1, 6) = 9

-    SBOX[5][1920] = 0x2008; // 780 (1, 7) = 5

-    SBOX[5][2176] = 0x200008; // 880 (1, 8) = 6

-    SBOX[5][2432] = 0x2000; // 980 (1, 9) = 1

-    SBOX[5][2688] = 0x10002008; // a80 (1, 10) = 13

-    SBOX[5][2944] = 0x10200008; // b80 (1, 11) = 14

-    SBOX[5][3200] = 0x0; // c80 (1, 12) = 0

-    SBOX[5][3456] = 0x10202000; // d80 (1, 13) = 11

-    SBOX[5][3712] = 0x202000; // e80 (1, 14) = 3

-    SBOX[5][3968] = 0x10000000; // f80 (1, 15) = 8

-    SBOX[5][4096] = 0x10002000; // 1000 (2, 0) = 9

-    SBOX[5][4352] = 0x10200008; // 1100 (2, 1) = 14

-    SBOX[5][4608] = 0x10202008; // 1200 (2, 2) = 15

-    SBOX[5][4864] = 0x2008; // 1300 (2, 3) = 5

-    SBOX[5][5120] = 0x200000; // 1400 (2, 4) = 2

-    SBOX[5][5376] = 0x10000000; // 1500 (2, 5) = 8

-    SBOX[5][5632] = 0x10000008; // 1600 (2, 6) = 12

-    SBOX[5][5888] = 0x202000; // 1700 (2, 7) = 3

-    SBOX[5][6144] = 0x202008; // 1800 (2, 8) = 7

-    SBOX[5][6400] = 0x0; // 1900 (2, 9) = 0

-    SBOX[5][6656] = 0x8; // 1a00 (2, 10) = 4

-    SBOX[5][6912] = 0x10200000; // 1b00 (2, 11) = 10

-    SBOX[5][7168] = 0x2000; // 1c00 (2, 12) = 1

-    SBOX[5][7424] = 0x10002008; // 1d00 (2, 13) = 13

-    SBOX[5][7680] = 0x10202000; // 1e00 (2, 14) = 11

-    SBOX[5][7936] = 0x200008; // 1f00 (2, 15) = 6

-    SBOX[5][4224] = 0x8; // 1080 (3, 0) = 4

-    SBOX[5][4480] = 0x202000; // 1180 (3, 1) = 3

-    SBOX[5][4736] = 0x200000; // 1280 (3, 2) = 2

-    SBOX[5][4992] = 0x10000008; // 1380 (3, 3) = 12

-    SBOX[5][5248] = 0x10002000; // 1480 (3, 4) = 9

-    SBOX[5][5504] = 0x2008; // 1580 (3, 5) = 5

-    SBOX[5][5760] = 0x10202008; // 1680 (3, 6) = 15

-    SBOX[5][6016] = 0x10200000; // 1780 (3, 7) = 10

-    SBOX[5][6272] = 0x10202000; // 1880 (3, 8) = 11

-    SBOX[5][6528] = 0x10200008; // 1980 (3, 9) = 14

-    SBOX[5][6784] = 0x2000; // 1a80 (3, 10) = 1

-    SBOX[5][7040] = 0x202008; // 1b80 (3, 11) = 7

-    SBOX[5][7296] = 0x200008; // 1c80 (3, 12) = 6

-    SBOX[5][7552] = 0x0; // 1d80 (3, 13) = 0

-    SBOX[5][7808] = 0x10000000; // 1e80 (3, 14) = 8

-    SBOX[5][8064] = 0x10002008; // 1f80 (3, 15) = 13

-

-    SBOX[6] = new Array();

-    SBOX[6][0] = 0x100000; // 0 (0, 0) = 4

-    SBOX[6][16] = 0x2000401; // 10 (0, 1) = 11

-    SBOX[6][32] = 0x400; // 20 (0, 2) = 2

-    SBOX[6][48] = 0x100401; // 30 (0, 3) = 14

-    SBOX[6][64] = 0x2100401; // 40 (0, 4) = 15

-    SBOX[6][80] = 0x0; // 50 (0, 5) = 0

-    SBOX[6][96] = 0x1; // 60 (0, 6) = 8

-    SBOX[6][112] = 0x2100001; // 70 (0, 7) = 13

-    SBOX[6][128] = 0x2000400; // 80 (0, 8) = 3

-    SBOX[6][144] = 0x100001; // 90 (0, 9) = 12

-    SBOX[6][160] = 0x2000001; // a0 (0, 10) = 9

-    SBOX[6][176] = 0x2100400; // b0 (0, 11) = 7

-    SBOX[6][192] = 0x2100000; // c0 (0, 12) = 5

-    SBOX[6][208] = 0x401; // d0 (0, 13) = 10

-    SBOX[6][224] = 0x100400; // e0 (0, 14) = 6

-    SBOX[6][240] = 0x2000000; // f0 (0, 15) = 1

-    SBOX[6][8] = 0x2100001; // 8 (1, 0) = 13

-    SBOX[6][24] = 0x0; // 18 (1, 1) = 0

-    SBOX[6][40] = 0x2000401; // 28 (1, 2) = 11

-    SBOX[6][56] = 0x2100400; // 38 (1, 3) = 7

-    SBOX[6][72] = 0x100000; // 48 (1, 4) = 4

-    SBOX[6][88] = 0x2000001; // 58 (1, 5) = 9

-    SBOX[6][104] = 0x2000000; // 68 (1, 6) = 1

-    SBOX[6][120] = 0x401; // 78 (1, 7) = 10

-    SBOX[6][136] = 0x100401; // 88 (1, 8) = 14

-    SBOX[6][152] = 0x2000400; // 98 (1, 9) = 3

-    SBOX[6][168] = 0x2100000; // a8 (1, 10) = 5

-    SBOX[6][184] = 0x100001; // b8 (1, 11) = 12

-    SBOX[6][200] = 0x400; // c8 (1, 12) = 2

-    SBOX[6][216] = 0x2100401; // d8 (1, 13) = 15

-    SBOX[6][232] = 0x1; // e8 (1, 14) = 8

-    SBOX[6][248] = 0x100400; // f8 (1, 15) = 6

-    SBOX[6][256] = 0x2000000; // 100 (2, 0) = 1

-    SBOX[6][272] = 0x100000; // 110 (2, 1) = 4

-    SBOX[6][288] = 0x2000401; // 120 (2, 2) = 11

-    SBOX[6][304] = 0x2100001; // 130 (2, 3) = 13

-    SBOX[6][320] = 0x100001; // 140 (2, 4) = 12

-    SBOX[6][336] = 0x2000400; // 150 (2, 5) = 3

-    SBOX[6][352] = 0x2100400; // 160 (2, 6) = 7

-    SBOX[6][368] = 0x100401; // 170 (2, 7) = 14

-    SBOX[6][384] = 0x401; // 180 (2, 8) = 10

-    SBOX[6][400] = 0x2100401; // 190 (2, 9) = 15

-    SBOX[6][416] = 0x100400; // 1a0 (2, 10) = 6

-    SBOX[6][432] = 0x1; // 1b0 (2, 11) = 8

-    SBOX[6][448] = 0x0; // 1c0 (2, 12) = 0

-    SBOX[6][464] = 0x2100000; // 1d0 (2, 13) = 5

-    SBOX[6][480] = 0x2000001; // 1e0 (2, 14) = 9

-    SBOX[6][496] = 0x400; // 1f0 (2, 15) = 2

-    SBOX[6][264] = 0x100400; // 108 (3, 0) = 6

-    SBOX[6][280] = 0x2000401; // 118 (3, 1) = 11

-    SBOX[6][296] = 0x2100001; // 128 (3, 2) = 13

-    SBOX[6][312] = 0x1; // 138 (3, 3) = 8

-    SBOX[6][328] = 0x2000000; // 148 (3, 4) = 1

-    SBOX[6][344] = 0x100000; // 158 (3, 5) = 4

-    SBOX[6][360] = 0x401; // 168 (3, 6) = 10

-    SBOX[6][376] = 0x2100400; // 178 (3, 7) = 7

-    SBOX[6][392] = 0x2000001; // 188 (3, 8) = 9

-    SBOX[6][408] = 0x2100000; // 198 (3, 9) = 5

-    SBOX[6][424] = 0x0; // 1a8 (3, 10) = 0

-    SBOX[6][440] = 0x2100401; // 1b8 (3, 11) = 15

-    SBOX[6][456] = 0x100401; // 1c8 (3, 12) = 14

-    SBOX[6][472] = 0x400; // 1d8 (3, 13) = 2

-    SBOX[6][488] = 0x2000400; // 1e8 (3, 14) = 3

-    SBOX[6][504] = 0x100001; // 1f8 (3, 15) = 12

-

-    SBOX[7] = new Array();

-    SBOX[7][0] = 0x8000820; // 0 (0, 0) = 13

-    SBOX[7][1] = 0x20000; // 1 (0, 1) = 2

-    SBOX[7][2] = 0x8000000; // 2 (0, 2) = 8

-    SBOX[7][3] = 0x20; // 3 (0, 3) = 4

-    SBOX[7][4] = 0x20020; // 4 (0, 4) = 6

-    SBOX[7][5] = 0x8020820; // 5 (0, 5) = 15

-    SBOX[7][6] = 0x8020800; // 6 (0, 6) = 11

-    SBOX[7][7] = 0x800; // 7 (0, 7) = 1

-    SBOX[7][8] = 0x8020000; // 8 (0, 8) = 10

-    SBOX[7][9] = 0x8000800; // 9 (0, 9) = 9

-    SBOX[7][10] = 0x20800; // a (0, 10) = 3

-    SBOX[7][11] = 0x8020020; // b (0, 11) = 14

-    SBOX[7][12] = 0x820; // c (0, 12) = 5

-    SBOX[7][13] = 0x0; // d (0, 13) = 0

-    SBOX[7][14] = 0x8000020; // e (0, 14) = 12

-    SBOX[7][15] = 0x20820; // f (0, 15) = 7

-    SBOX[7][-2147483648] = 0x800; // 80000000 (1, 0) = 1

-    SBOX[7][-2147483647] = 0x8020820; // 80000001 (1, 1) = 15

-    SBOX[7][-2147483646] = 0x8000820; // 80000002 (1, 2) = 13

-    SBOX[7][-2147483645] = 0x8000000; // 80000003 (1, 3) = 8

-    SBOX[7][-2147483644] = 0x8020000; // 80000004 (1, 4) = 10

-    SBOX[7][-2147483643] = 0x20800; // 80000005 (1, 5) = 3

-    SBOX[7][-2147483642] = 0x20820; // 80000006 (1, 6) = 7

-    SBOX[7][-2147483641] = 0x20; // 80000007 (1, 7) = 4

-    SBOX[7][-2147483640] = 0x8000020; // 80000008 (1, 8) = 12

-    SBOX[7][-2147483639] = 0x820; // 80000009 (1, 9) = 5

-    SBOX[7][-2147483638] = 0x20020; // 8000000a (1, 10) = 6

-    SBOX[7][-2147483637] = 0x8020800; // 8000000b (1, 11) = 11

-    SBOX[7][-2147483636] = 0x0; // 8000000c (1, 12) = 0

-    SBOX[7][-2147483635] = 0x8020020; // 8000000d (1, 13) = 14

-    SBOX[7][-2147483634] = 0x8000800; // 8000000e (1, 14) = 9

-    SBOX[7][-2147483633] = 0x20000; // 8000000f (1, 15) = 2

-    SBOX[7][16] = 0x20820; // 10 (2, 0) = 7

-    SBOX[7][17] = 0x8020800; // 11 (2, 1) = 11

-    SBOX[7][18] = 0x20; // 12 (2, 2) = 4

-    SBOX[7][19] = 0x800; // 13 (2, 3) = 1

-    SBOX[7][20] = 0x8000800; // 14 (2, 4) = 9

-    SBOX[7][21] = 0x8000020; // 15 (2, 5) = 12

-    SBOX[7][22] = 0x8020020; // 16 (2, 6) = 14

-    SBOX[7][23] = 0x20000; // 17 (2, 7) = 2

-    SBOX[7][24] = 0x0; // 18 (2, 8) = 0

-    SBOX[7][25] = 0x20020; // 19 (2, 9) = 6

-    SBOX[7][26] = 0x8020000; // 1a (2, 10) = 10

-    SBOX[7][27] = 0x8000820; // 1b (2, 11) = 13

-    SBOX[7][28] = 0x8020820; // 1c (2, 12) = 15

-    SBOX[7][29] = 0x20800; // 1d (2, 13) = 3

-    SBOX[7][30] = 0x820; // 1e (2, 14) = 5

-    SBOX[7][31] = 0x8000000; // 1f (2, 15) = 8

-    SBOX[7][-2147483632] = 0x20000; // 80000010 (3, 0) = 2

-    SBOX[7][-2147483631] = 0x800; // 80000011 (3, 1) = 1

-    SBOX[7][-2147483630] = 0x8020020; // 80000012 (3, 2) = 14

-    SBOX[7][-2147483629] = 0x20820; // 80000013 (3, 3) = 7

-    SBOX[7][-2147483628] = 0x20; // 80000014 (3, 4) = 4

-    SBOX[7][-2147483627] = 0x8020000; // 80000015 (3, 5) = 10

-    SBOX[7][-2147483626] = 0x8000000; // 80000016 (3, 6) = 8

-    SBOX[7][-2147483625] = 0x8000820; // 80000017 (3, 7) = 13

-    SBOX[7][-2147483624] = 0x8020820; // 80000018 (3, 8) = 15

-    SBOX[7][-2147483623] = 0x8000020; // 80000019 (3, 9) = 12

-    SBOX[7][-2147483622] = 0x8000800; // 8000001a (3, 10) = 9

-    SBOX[7][-2147483621] = 0x0; // 8000001b (3, 11) = 0

-    SBOX[7][-2147483620] = 0x20800; // 8000001c (3, 12) = 3

-    SBOX[7][-2147483619] = 0x820; // 8000001d (3, 13) = 5

-    SBOX[7][-2147483618] = 0x20020; // 8000001e (3, 14) = 6

-    SBOX[7][-2147483617] = 0x8020800; // 8000001f (3, 15) = 11

-

-    State.prototype._exchangeLR = function(v, m) {

-        var t = ((this.lhs >> v) ^ this.rhs) & m;

-        this.rhs ^= t;

-        this.lhs ^= (t << v);

-    };

-

-    State.prototype._exchangeRL = function(v, m) {

-        var t = ((this.rhs >> v) ^ this.lhs) & m;

-        this.lhs ^= t;

-        this.rhs ^= (t << v);

-    };

-

-    /**

-     * Perform the initial permutation of the input to create the starting state

-     * of the algorithm. The initial permutation maps each consecutive bit of

-     * the input into a different byte of the state.

-     * 

-     * <pre>

-     * The initial permutation is defined to be:

-     * 

-     *      58    50   42    34    26   18    10    2  

-     *      60    52   44    36    28   20    12    4

-     *      62    54   46    38    30   22    14    6

-     *      64    56   48    40    32   24    16    8

-     *      57    49   41    33    25   17     9    1

-     *      59    51   43    35    27   19    11    3

-     *      61    53   45    37    29   21    13    5

-     *      63    55   47    39    31   23    15    7

-     * </pre>

-     * 

-     * 

-     * @param message

-     *            The message as an array of unsigned bytes.

-     * @param offset

-     *            The offset into the message that the current 64-bit block

-     *            begins.

-     * @returns the initial engine state

-     */

-    State.prototype.initialPerm = function(message, offset) {

-        var input = message.slice(offset, offset + 8);

-

-        this.lhs = (input[0] << 24) + (input[1] << 16) + (input[2] << 8)

-                + input[3];

-        this.rhs = (input[4] << 24) + (input[5] << 16) + (input[6] << 8)

-                + input[7];

-

-        this._exchangeLR(4, 0x0f0f0f0f);

-        this._exchangeLR(16, 0x0000ffff);

-        this._exchangeRL(2, 0x33333333);

-        this._exchangeRL(8, 0x00ff00ff);

-        this._exchangeLR(1, 0x55555555);

-    };

-

-    /**

-     * Perform one round of the DES algorithm using the given key. A round is

-     * defined as:

-     * 

-     * <pre>

-     * L&amp;rsquo = R

-     * R&amp;rsquo = L &circ; f(R, k)

-     * </pre>

-     * 

-     * where f consists of expanding, XORing with the key and contracting back

-     * with the SBOXes.

-     * 

-     * Note that the final round is defined slightly differently as:

-     * 

-     * <pre>

-     * L&amp;rsquo = L &circ; f(R, k)

-     * R&amp;rsquo = R

-     * </pre>

-     * 

-     * Therefore in the final round this function produces LHS and RHS the wrong

-     * way around.

-     * 

-     * @param k

-     *            the key

-     */

-    State.prototype.round = function(k) {

-        var r = this.rhs, l = this.lhs;

-        var f = 0;

-        for ( var i = 0; i < 8; i++) {

-            var v = (r ^ k[i]) & State.SBOX_MASK[i];

-            f += State.SBOX[i][v];

-        }

-

-        this.lhs = r;

-        this.rhs = l ^ f;

-    };

-

-    /**

-     * Apply the inverse of the initial permutation.

-     * 

-     * <pre>

-     * The inverse is defined to be:

-     * 

-     *      40     8   48    16    56   24    64   32

-     *      39     7   47    15    55   23    63   31

-     *      38     6   46    14    54   22    62   30

-     *      37     5   45    13    53   21    61   29

-     *      36     4   44    12    52   20    60   28

-     *      35     3   43    11    51   19    59   27

-     *      34     2   42    10    50   18    58   26

-     *      33     1   41     9    49   17    57   25

-     * </pre>

-     * 

-     * @param cipherText

-     * @param offset

-     */

-    State.prototype.finalPerm = function(cipherText, offset) {

-        var t = this.lhs;

-        this.lhs = this.rhs;

-        this.rhs = t;

-

-        this._exchangeLR(1, 0x55555555);

-        this._exchangeRL(8, 0x00ff00ff);

-        this._exchangeRL(2, 0x33333333);

-        this._exchangeLR(16, 0x0000ffff);

-        this._exchangeLR(4, 0x0f0f0f0f);

-

-        cipherText[offset] = (this.lhs >> 24) & 0xff;

-        cipherText[offset + 1] = (this.lhs >> 16) & 0xff;

-        cipherText[offset + 2] = (this.lhs >> 8) & 0xff;

-        cipherText[offset + 3] = (this.lhs) & 0xff;

-        cipherText[offset + 4] = (this.rhs >> 24) & 0xff;

-        cipherText[offset + 5] = (this.rhs >> 16) & 0xff;

-        cipherText[offset + 6] = (this.rhs >> 8) & 0xff;

-        cipherText[offset + 7] = (this.rhs) & 0xff;

-    };

-

-    /**

-     * DES cipher

-     */

-    var DES = C.DES = {

-        _blocksize : 2,

-

-        _keyschedule : null,

-

-        _state : new State(),

-

-        _init : function(k) {

-            this._keyschedule = new KeySchedule(k);

-        },

-

-        encrypt : function(message, password, options) {

-

-            options = options || {};

-

-            // Determine mode

-            var mode = options.mode || new C.mode.OFB;

-

-            // Allow mode to override options

-            if (mode.fixOptions)

-                mode.fixOptions(options);

-

-            var

-            // Convert to bytes if message is a string

-            m = (message.constructor == String ? UTF8.stringToBytes(message)

-                    : message),

-

-            // Generate random IV

-            iv = options.iv || util.randomBytes(8),

-

-            // Generate key

-            k = (password.constructor == String ?

-            // Derive key from passphrase

-            C.PBKDF2(password, iv, 8, {

-                asBytes : true

-            }) :

-            // else, assume byte array representing cryptographic key

-            password);

-

-            // Create key schedule

-            this._keyschedule = new KeySchedule(k);

-

-            // Encrypt

-            mode.encrypt(DES, m, iv);

-

-            // Return ciphertext

-            m = options.iv ? m : iv.concat(m);

-            return (options && options.asBytes) ? m : util.bytesToBase64(m);

-        },

-

-        _encryptblock : function(message, offset) {

-            this._state.initialPerm(message, offset);

-            for ( var i = 0; i <= 15; i++) {

-                this._state.round(this._keyschedule.getKey(i));

-            }

-            this._state.finalPerm(message, offset);

-        },

-

-        decrypt : function(ciphertext, password, options) {

-            options = options || {};

-

-            // Determine mode

-            var mode = options.mode || new C.mode.OFB;

-

-            // Allow mode to override options

-            if (mode.fixOptions)

-                mode.fixOptions(options);

-

-            var

-

-            // Convert to bytes if ciphertext is a string

-            c = (ciphertext.constructor == String ? util

-                    .base64ToBytes(ciphertext) : ciphertext),

-

-            // Separate IV and message

-            iv = options.iv || c.splice(0, 8),

-

-            // Generate key

-            k = (password.constructor == String ?

-            // Derive key from passphrase

-            C.PBKDF2(password, iv, 32, {

-                asBytes : true

-            }) :

-            // else, assume byte array representing cryptographic key

-            password);

-

-            // Create key schedule

-            this._keyschedule = new KeySchedule(k);

-

-            mode.decrypt(DES, c, iv);

-

-            // Return plaintext

-            return (options && options.asBytes) ? c : UTF8.bytesToString(c);

-        },

-

-        _decryptblock : function(message, offset) {

-            this._state.initialPerm(message, offset);

-            for ( var i = 15; i >= 0; i--) {

-                this._state.round(this._keyschedule.getKey(i));

-            }

-            this._state.finalPerm(message, offset);

-        }

-

-    };

-})();
\ No newline at end of file
diff --git a/crypto-js/src/hmac.js b/crypto-js/src/hmac.js
deleted file mode 100644
index 500954b..0000000
--- a/crypto-js/src/hmac.js
+++ /dev/null
@@ -1,37 +0,0 @@
-(function(){

-

-// Shortcuts

-var C = Crypto,

-    util = C.util,

-    charenc = C.charenc,

-    UTF8 = charenc.UTF8,

-    Binary = charenc.Binary;

-

-C.HMAC = function (hasher, message, key, options) {

-

-	// Convert to byte arrays

-	if (message.constructor == String) message = UTF8.stringToBytes(message);

-	if (key.constructor == String) key = UTF8.stringToBytes(key);

-	/* else, assume byte arrays already */

-

-	// Allow arbitrary length keys

-	if (key.length > hasher._blocksize * 4)

-		key = hasher(key, { asBytes: true });

-

-	// XOR keys with pad constants

-	var okey = key.slice(0),

-	    ikey = key.slice(0);

-	for (var i = 0; i < hasher._blocksize * 4; i++) {

-		okey[i] ^= 0x5C;

-		ikey[i] ^= 0x36;

-	}

-

-	var hmacbytes = hasher(okey.concat(hasher(ikey.concat(message), { asBytes: true })), { asBytes: true });

-

-	return options && options.asBytes ? hmacbytes :

-	       options && options.asString ? Binary.bytesToString(hmacbytes) :

-	       util.bytesToHex(hmacbytes);

-

-};

-

-})();

diff --git a/crypto-js/src/marc4.js b/crypto-js/src/marc4.js
deleted file mode 100644
index 28f76f0..0000000
--- a/crypto-js/src/marc4.js
+++ /dev/null
@@ -1,116 +0,0 @@
-(function(){

-

-// Shortcuts

-var C = Crypto,

-    util = C.util,

-    charenc = C.charenc,

-    UTF8 = charenc.UTF8,

-    Binary = charenc.Binary;

-

-var MARC4 = C.MARC4 = {

-

-	/**

-	 * Public API

-	 */

-

-	encrypt: function (message, password) {

-

-		var

-

-		    // Convert to bytes

-		    m = UTF8.stringToBytes(message),

-

-		    // Generate random IV

-		    iv = util.randomBytes(16),

-

-		    // Generate key

-		    k = password.constructor == String ?

-		        // Derive key from passphrase

-		        C.PBKDF2(password, iv, 32, { asBytes: true }) :

-		        // else, assume byte array representing cryptographic key

-		        password;

-

-		// Encrypt

-		MARC4._marc4(m, k, 1536);

-

-		// Return ciphertext

-		return util.bytesToBase64(iv.concat(m));

-

-	},

-

-	decrypt: function (ciphertext, password) {

-

-		var

-

-		    // Convert to bytes

-		    c = util.base64ToBytes(ciphertext),

-

-		    // Separate IV and message

-		    iv = c.splice(0, 16),

-

-		    // Generate key

-		    k = password.constructor == String ?

-		        // Derive key from passphrase

-		        C.PBKDF2(password, iv, 32, { asBytes: true }) :

-		        // else, assume byte array representing cryptographic key

-		        password;

-

-		// Decrypt

-		MARC4._marc4(c, k, 1536);

-

-		// Return plaintext

-		return UTF8.bytesToString(c);

-

-	},

-

-

-	/**

-	 * Internal methods

-	 */

-

-	// The core

-	_marc4: function (m, k, drop) {

-

-		// State variables

-		var i, j, s, temp;

-

-		// Key setup

-		for (i = 0, s = []; i < 256; i++) s[i] = i;

-		for (i = 0, j = 0;  i < 256; i++) {

-

-			j = (j + s[i] + k[i % k.length]) % 256;

-

-			// Swap

-			temp = s[i];

-			s[i] = s[j];

-			s[j] = temp;

-

-		}

-

-		// Clear counters

-		i = j = 0;

-

-		// Encryption

-		for (var k = -drop; k < m.length; k++) {

-

-			i = (i + 1) % 256;

-			j = (j + s[i]) % 256;

-

-			// Swap

-			temp = s[i];

-			s[i] = s[j];

-			s[j] = temp;

-

-			// Stop here if we're still dropping keystream

-			if (k < 0) continue;

-

-			// Encrypt

-			m[k] ^= s[(s[i] + s[j]) % 256];

-

-		}

-

-	}

-

-};

-

-})();

diff --git a/crypto-js/src/md5.js b/crypto-js/src/md5.js
deleted file mode 100644
index f4d5d19..0000000
--- a/crypto-js/src/md5.js
+++ /dev/null
@@ -1,157 +0,0 @@
-(function(){

-

-// Shortcuts

-var C = Crypto,

-    util = C.util,

-    charenc = C.charenc,

-    UTF8 = charenc.UTF8,

-    Binary = charenc.Binary;

-

-// Public API

-var MD5 = C.MD5 = function (message, options) {

-	var digestbytes = util.wordsToBytes(MD5._md5(message));

-	return options && options.asBytes ? digestbytes :

-	       options && options.asString ? Binary.bytesToString(digestbytes) :

-	       util.bytesToHex(digestbytes);

-};

-

-// The core

-MD5._md5 = function (message) {

-

-	// Convert to byte array

-	if (message.constructor == String) message = UTF8.stringToBytes(message);

-	/* else, assume byte array already */

-

-	var m = util.bytesToWords(message),

-	    l = message.length * 8,

-	    a =  1732584193,

-	    b = -271733879,

-	    c = -1732584194,

-	    d =  271733878;

-

-	// Swap endian

-	for (var i = 0; i < m.length; i++) {

-		m[i] = ((m[i] <<  8) | (m[i] >>> 24)) & 0x00FF00FF |

-		       ((m[i] << 24) | (m[i] >>>  8)) & 0xFF00FF00;

-	}

-

-	// Padding

-	m[l >>> 5] |= 0x80 << (l % 32);

-	m[(((l + 64) >>> 9) << 4) + 14] = l;

-

-	// Method shortcuts

-	var FF = MD5._ff,

-	    GG = MD5._gg,

-	    HH = MD5._hh,

-	    II = MD5._ii;

-

-	for (var i = 0; i < m.length; i += 16) {

-

-		var aa = a,

-		    bb = b,

-		    cc = c,

-		    dd = d;

-

-		a = FF(a, b, c, d, m[i+ 0],  7, -680876936);

-		d = FF(d, a, b, c, m[i+ 1], 12, -389564586);

-		c = FF(c, d, a, b, m[i+ 2], 17,  606105819);

-		b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);

-		a = FF(a, b, c, d, m[i+ 4],  7, -176418897);

-		d = FF(d, a, b, c, m[i+ 5], 12,  1200080426);

-		c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);

-		b = FF(b, c, d, a, m[i+ 7], 22, -45705983);

-		a = FF(a, b, c, d, m[i+ 8],  7,  1770035416);

-		d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);

-		c = FF(c, d, a, b, m[i+10], 17, -42063);

-		b = FF(b, c, d, a, m[i+11], 22, -1990404162);

-		a = FF(a, b, c, d, m[i+12],  7,  1804603682);

-		d = FF(d, a, b, c, m[i+13], 12, -40341101);

-		c = FF(c, d, a, b, m[i+14], 17, -1502002290);

-		b = FF(b, c, d, a, m[i+15], 22,  1236535329);

-

-		a = GG(a, b, c, d, m[i+ 1],  5, -165796510);

-		d = GG(d, a, b, c, m[i+ 6],  9, -1069501632);

-		c = GG(c, d, a, b, m[i+11], 14,  643717713);

-		b = GG(b, c, d, a, m[i+ 0], 20, -373897302);

-		a = GG(a, b, c, d, m[i+ 5],  5, -701558691);

-		d = GG(d, a, b, c, m[i+10],  9,  38016083);

-		c = GG(c, d, a, b, m[i+15], 14, -660478335);

-		b = GG(b, c, d, a, m[i+ 4], 20, -405537848);

-		a = GG(a, b, c, d, m[i+ 9],  5,  568446438);

-		d = GG(d, a, b, c, m[i+14],  9, -1019803690);

-		c = GG(c, d, a, b, m[i+ 3], 14, -187363961);

-		b = GG(b, c, d, a, m[i+ 8], 20,  1163531501);

-		a = GG(a, b, c, d, m[i+13],  5, -1444681467);

-		d = GG(d, a, b, c, m[i+ 2],  9, -51403784);

-		c = GG(c, d, a, b, m[i+ 7], 14,  1735328473);

-		b = GG(b, c, d, a, m[i+12], 20, -1926607734);

-

-		a = HH(a, b, c, d, m[i+ 5],  4, -378558);

-		d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);

-		c = HH(c, d, a, b, m[i+11], 16,  1839030562);

-		b = HH(b, c, d, a, m[i+14], 23, -35309556);

-		a = HH(a, b, c, d, m[i+ 1],  4, -1530992060);

-		d = HH(d, a, b, c, m[i+ 4], 11,  1272893353);

-		c = HH(c, d, a, b, m[i+ 7], 16, -155497632);

-		b = HH(b, c, d, a, m[i+10], 23, -1094730640);

-		a = HH(a, b, c, d, m[i+13],  4,  681279174);

-		d = HH(d, a, b, c, m[i+ 0], 11, -358537222);

-		c = HH(c, d, a, b, m[i+ 3], 16, -722521979);

-		b = HH(b, c, d, a, m[i+ 6], 23,  76029189);

-		a = HH(a, b, c, d, m[i+ 9],  4, -640364487);

-		d = HH(d, a, b, c, m[i+12], 11, -421815835);

-		c = HH(c, d, a, b, m[i+15], 16,  530742520);

-		b = HH(b, c, d, a, m[i+ 2], 23, -995338651);

-

-		a = II(a, b, c, d, m[i+ 0],  6, -198630844);

-		d = II(d, a, b, c, m[i+ 7], 10,  1126891415);

-		c = II(c, d, a, b, m[i+14], 15, -1416354905);

-		b = II(b, c, d, a, m[i+ 5], 21, -57434055);

-		a = II(a, b, c, d, m[i+12],  6,  1700485571);

-		d = II(d, a, b, c, m[i+ 3], 10, -1894986606);

-		c = II(c, d, a, b, m[i+10], 15, -1051523);

-		b = II(b, c, d, a, m[i+ 1], 21, -2054922799);

-		a = II(a, b, c, d, m[i+ 8],  6,  1873313359);

-		d = II(d, a, b, c, m[i+15], 10, -30611744);

-		c = II(c, d, a, b, m[i+ 6], 15, -1560198380);

-		b = II(b, c, d, a, m[i+13], 21,  1309151649);

-		a = II(a, b, c, d, m[i+ 4],  6, -145523070);

-		d = II(d, a, b, c, m[i+11], 10, -1120210379);

-		c = II(c, d, a, b, m[i+ 2], 15,  718787259);

-		b = II(b, c, d, a, m[i+ 9], 21, -343485551);

-

-		a = (a + aa) >>> 0;

-		b = (b + bb) >>> 0;

-		c = (c + cc) >>> 0;

-		d = (d + dd) >>> 0;

-

-	}

-

-	return util.endian([a, b, c, d]);

-

-};

-

-// Auxiliary functions

-MD5._ff  = function (a, b, c, d, x, s, t) {

-	var n = a + (b & c | ~b & d) + (x >>> 0) + t;

-	return ((n << s) | (n >>> (32 - s))) + b;

-};

-MD5._gg  = function (a, b, c, d, x, s, t) {

-	var n = a + (b & d | c & ~d) + (x >>> 0) + t;

-	return ((n << s) | (n >>> (32 - s))) + b;

-};

-MD5._hh  = function (a, b, c, d, x, s, t) {

-	var n = a + (b ^ c ^ d) + (x >>> 0) + t;

-	return ((n << s) | (n >>> (32 - s))) + b;

-};

-MD5._ii  = function (a, b, c, d, x, s, t) {

-	var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;

-	return ((n << s) | (n >>> (32 - s))) + b;

-};

-

-// Package private blocksize

-MD5._blocksize = 16;

-

-MD5._digestsize = 16;

-

-})();

diff --git a/crypto-js/src/pbkdf2.js b/crypto-js/src/pbkdf2.js
deleted file mode 100644
index 7cdd208..0000000
--- a/crypto-js/src/pbkdf2.js
+++ /dev/null
@@ -1,48 +0,0 @@
-(function(){

-

-// Shortcuts

-var C = Crypto,

-    util = C.util,

-    charenc = C.charenc,

-    UTF8 = charenc.UTF8,

-    Binary = charenc.Binary;

-

-C.PBKDF2 = function (password, salt, keylen, options) {

-

-	// Convert to byte arrays

-	if (password.constructor == String) password = UTF8.stringToBytes(password);

-	if (salt.constructor == String) salt = UTF8.stringToBytes(salt);

-	/* else, assume byte arrays already */

-

-	// Defaults

-	var hasher = options && options.hasher || C.SHA1,

-	    iterations = options && options.iterations || 1;

-

-	// Pseudo-random function

-	function PRF(password, salt) {

-		return C.HMAC(hasher, salt, password, { asBytes: true });

-	}

-

-	// Generate key

-	var derivedKeyBytes = [],

-	    blockindex = 1;

-	while (derivedKeyBytes.length < keylen) {

-		var block = PRF(password, salt.concat(util.wordsToBytes([blockindex])));

-		for (var u = block, i = 1; i < iterations; i++) {

-			u = PRF(password, u);

-			for (var j = 0; j < block.length; j++) block[j] ^= u[j];

-		}

-		derivedKeyBytes = derivedKeyBytes.concat(block);

-		blockindex++;

-	}

-

-	// Truncate excess bytes

-	derivedKeyBytes.length = keylen;

-

-	return options && options.asBytes ? derivedKeyBytes :

-	       options && options.asString ? Binary.bytesToString(derivedKeyBytes) :

-	       util.bytesToHex(derivedKeyBytes);

-

-};

-

-})();

diff --git a/crypto-js/src/pbkdf2async.js b/crypto-js/src/pbkdf2async.js
deleted file mode 100644
index 2dd2516..0000000
--- a/crypto-js/src/pbkdf2async.js
+++ /dev/null
@@ -1,87 +0,0 @@
-(function(){

-

-// Shortcuts

-var C = Crypto,

-    util = C.util,

-    charenc = C.charenc,

-    UTF8 = charenc.UTF8,

-    Binary = charenc.Binary;

-

-if (!C.nextTick) {

-    // node.js has setTime out but prefer process.nextTick

-    if (typeof process != 'undefined' && typeof process.nextTick !== 'undefined') {

-        C.nextTick = process.nextTick;

-    } else if (typeof setTimeout !== 'undefined') {

-        C.nextTick = function (callback) {

-            setTimeout(callback, 0);

-        };

-    }

-}

-

-C.PBKDF2Async = function (password, salt, keylen, callback, options) {

-

-    // Convert to byte arrays

-    if (password.constructor == String) password = UTF8.stringToBytes(password);

-    if (salt.constructor == String) salt = UTF8.stringToBytes(salt);

-    /* else, assume byte arrays already */

-

-    // Defaults

-    var hasher = options && options.hasher || C.SHA1,

-        iterations = options && options.iterations || 1;

-

-    // Progress callback option

-    var progressChangeHandler = options && options.onProgressChange;

-    var totalIterations = Math.ceil(keylen / hasher._digestsize) * iterations;

-    function fireProgressChange(currentIteration) {

-        if (progressChangeHandler) {

-            var iterationsSoFar = derivedKeyBytes.length / hasher._digestsize * iterations + currentIteration;

-            setTimeout(function () {

-                progressChangeHandler(Math.round(iterationsSoFar / totalIterations * 100));

-            }, 0);

-        }

-    }

-

-    // Pseudo-random function

-    function PRF(password, salt) {

-        return C.HMAC(hasher, salt, password, { asBytes: true });

-    }

-

-    var nextTick = C.nextTick;

-

-    // Generate key

-    var derivedKeyBytes = [],

-        blockindex = 1;

-

-    var outer, inner;

-    nextTick(outer = function () {

-        if (derivedKeyBytes.length < keylen) {

-            var block = PRF(password, salt.concat(util.wordsToBytes([blockindex])));

-            fireProgressChange(1);

-

-            var u = block, i = 1;

-            nextTick(inner = function () {

-                if (i < iterations) {

-                    u = PRF(password, u);

-                    for (var j = 0; j < block.length; j++) block[j] ^= u[j];

-                    i++;

-                    fireProgressChange(i);

-

-                    nextTick(inner);

-                } else {

-                    derivedKeyBytes = derivedKeyBytes.concat(block);

-                    blockindex++;

-                    nextTick(outer);

-                }

-            });

-        } else {

-            // Truncate excess bytes

-            derivedKeyBytes.length = keylen;

-            callback(

-                    options && options.asBytes ? derivedKeyBytes :

-                    options && options.asString ? Binary.bytesToString(derivedKeyBytes) :

-                    util.bytesToHex(derivedKeyBytes));

-        }

-    });

-};

-

-})();

diff --git a/crypto-js/src/rabbit.js b/crypto-js/src/rabbit.js
deleted file mode 100644
index 7d3d34e..0000000
--- a/crypto-js/src/rabbit.js
+++ /dev/null
@@ -1,220 +0,0 @@
-(function(){

-

-// Shortcuts

-var C = Crypto,

-    util = C.util,

-    charenc = C.charenc,

-    UTF8 = charenc.UTF8,

-    Binary = charenc.Binary;

-

-// Inner state

-var x = [],

-    c = [],

-    b;

-

-var Rabbit = C.Rabbit = {

-

-	/**

-	 * Public API

-	 */

-

-	encrypt: function (message, password) {

-

-		var

-

-		    // Convert to bytes

-		    m = UTF8.stringToBytes(message),

-

-		    // Generate random IV

-		    iv = util.randomBytes(8),

-

-		    // Generate key

-		    k = password.constructor == String ?

-		        // Derive key from passphrase

-		        C.PBKDF2(password, iv, 32, { asBytes: true }) :

-		        // else, assume byte array representing cryptographic key

-		        password;

-

-		// Encrypt

-		Rabbit._rabbit(m, k, util.bytesToWords(iv));

-

-		// Return ciphertext

-		return util.bytesToBase64(iv.concat(m));

-

-	},

-

-	decrypt: function (ciphertext, password) {

-

-		var

-

-		    // Convert to bytes

-		    c = util.base64ToBytes(ciphertext),

-

-		    // Separate IV and message

-		    iv = c.splice(0, 8),

-

-		    // Generate key

-		    k = password.constructor == String ?

-		        // Derive key from passphrase

-		        C.PBKDF2(password, iv, 32, { asBytes: true }) :

-		        // else, assume byte array representing cryptographic key

-		        password;

-

-		// Decrypt

-		Rabbit._rabbit(c, k, util.bytesToWords(iv));

-

-		// Return plaintext

-		return UTF8.bytesToString(c);

-

-	},

-

-

-	/**

-	 * Internal methods

-	 */

-

-	// Encryption/decryption scheme

-	_rabbit: function (m, k, iv) {

-

-		Rabbit._keysetup(k);

-		if (iv) Rabbit._ivsetup(iv);

-

-		for (var s = [], i = 0; i < m.length; i++) {

-

-			if (i % 16 == 0) {

-

-				// Iterate the system

-				Rabbit._nextstate();

-

-				// Generate 16 bytes of pseudo-random data

-				s[0] = x[0] ^ (x[5] >>> 16) ^ (x[3] << 16);

-				s[1] = x[2] ^ (x[7] >>> 16) ^ (x[5] << 16);

-				s[2] = x[4] ^ (x[1] >>> 16) ^ (x[7] << 16);

-				s[3] = x[6] ^ (x[3] >>> 16) ^ (x[1] << 16);

-

-				// Swap endian

-				for (var j = 0; j < 4; j++) {

-					s[j] = ((s[j] <<  8) | (s[j] >>> 24)) & 0x00FF00FF |

-					       ((s[j] << 24) | (s[j] >>>  8)) & 0xFF00FF00;

-				}

-

-				// Convert words to bytes

-				for (var b = 120; b >= 0; b -= 8)

-					s[b / 8] = (s[b >>> 5] >>> (24 - b % 32)) & 0xFF;

-

-			}

-

-			m[i] ^= s[i % 16];

-

-		}

-

-	},

-

-	// Key setup scheme

-	_keysetup: function (k) {

-

-		// Generate initial state values

-		x[0] = k[0];

-		x[2] = k[1];

-		x[4] = k[2];

-		x[6] = k[3];

-		x[1] = (k[3] << 16) | (k[2] >>> 16);

-		x[3] = (k[0] << 16) | (k[3] >>> 16);

-		x[5] = (k[1] << 16) | (k[0] >>> 16);

-		x[7] = (k[2] << 16) | (k[1] >>> 16);

-

-		// Generate initial counter values

-		c[0] = util.rotl(k[2], 16);

-		c[2] = util.rotl(k[3], 16);

-		c[4] = util.rotl(k[0], 16);

-		c[6] = util.rotl(k[1], 16);

-		c[1] = (k[0] & 0xFFFF0000) | (k[1] & 0xFFFF);

-		c[3] = (k[1] & 0xFFFF0000) | (k[2] & 0xFFFF);

-		c[5] = (k[2] & 0xFFFF0000) | (k[3] & 0xFFFF);

-		c[7] = (k[3] & 0xFFFF0000) | (k[0] & 0xFFFF);

-

-		// Clear carry bit

-		b = 0;

-

-		// Iterate the system four times

-		for (var i = 0; i < 4; i++) Rabbit._nextstate();

-

-		// Modify the counters

-		for (var i = 0; i < 8; i++) c[i] ^= x[(i + 4) & 7];

-

-	},

-

-	// IV setup scheme

-	_ivsetup: function (iv) {

-

-		// Generate four subvectors

-		var i0 = util.endian(iv[0]),

-		    i2 = util.endian(iv[1]),

-		    i1 = (i0 >>> 16) | (i2 & 0xFFFF0000),

-		    i3 = (i2 <<  16) | (i0 & 0x0000FFFF);

-

-		// Modify counter values

-		c[0] ^= i0;

-		c[1] ^= i1;

-		c[2] ^= i2;

-		c[3] ^= i3;

-		c[4] ^= i0;

-		c[5] ^= i1;

-		c[6] ^= i2;

-		c[7] ^= i3;

-

-		// Iterate the system four times

-		for (var i = 0; i < 4; i++) Rabbit._nextstate();

-

-	},

-

-	// Next-state function

-	_nextstate: function () {

-

-		// Save old counter values

-		for (var c_old = [], i = 0; i < 8; i++) c_old[i] = c[i];

-

-		// Calculate new counter values

-		c[0] = (c[0] + 0x4D34D34D + b) >>> 0;

-		c[1] = (c[1] + 0xD34D34D3 + ((c[0] >>> 0) < (c_old[0] >>> 0) ? 1 : 0)) >>> 0;

-		c[2] = (c[2] + 0x34D34D34 + ((c[1] >>> 0) < (c_old[1] >>> 0) ? 1 : 0)) >>> 0;

-		c[3] = (c[3] + 0x4D34D34D + ((c[2] >>> 0) < (c_old[2] >>> 0) ? 1 : 0)) >>> 0;

-		c[4] = (c[4] + 0xD34D34D3 + ((c[3] >>> 0) < (c_old[3] >>> 0) ? 1 : 0)) >>> 0;

-		c[5] = (c[5] + 0x34D34D34 + ((c[4] >>> 0) < (c_old[4] >>> 0) ? 1 : 0)) >>> 0;

-		c[6] = (c[6] + 0x4D34D34D + ((c[5] >>> 0) < (c_old[5] >>> 0) ? 1 : 0)) >>> 0;

-		c[7] = (c[7] + 0xD34D34D3 + ((c[6] >>> 0) < (c_old[6] >>> 0) ? 1 : 0)) >>> 0;

-		b = (c[7] >>> 0) < (c_old[7] >>> 0) ? 1 : 0;

-

-		// Calculate the g-values

-		for (var g = [], i = 0; i < 8; i++) {

-

-			var gx = (x[i] + c[i]) >>> 0;

-

-			// Construct high and low argument for squaring

-			var ga = gx & 0xFFFF,

-			    gb = gx >>> 16;

-

-			// Calculate high and low result of squaring

-			var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb,

-			    gl = (((gx & 0xFFFF0000) * gx) >>> 0) + (((gx & 0x0000FFFF) * gx) >>> 0) >>> 0;

-

-			// High XOR low

-			g[i] = gh ^ gl;

-

-		}

-

-		// Calculate new state values

-		x[0] = g[0] + ((g[7] << 16) | (g[7] >>> 16)) + ((g[6] << 16) | (g[6] >>> 16));

-		x[1] = g[1] + ((g[0] <<  8) | (g[0] >>> 24)) + g[7];

-		x[2] = g[2] + ((g[1] << 16) | (g[1] >>> 16)) + ((g[0] << 16) | (g[0] >>> 16));

-		x[3] = g[3] + ((g[2] <<  8) | (g[2] >>> 24)) + g[1];

-		x[4] = g[4] + ((g[3] << 16) | (g[3] >>> 16)) + ((g[2] << 16) | (g[2] >>> 16));

-		x[5] = g[5] + ((g[4] <<  8) | (g[4] >>> 24)) + g[3];

-		x[6] = g[6] + ((g[5] << 16) | (g[5] >>> 16)) + ((g[4] << 16) | (g[4] >>> 16));

-		x[7] = g[7] + ((g[6] <<  8) | (g[6] >>> 24)) + g[5];

-

-	}

-

-};

-

-})();

diff --git a/crypto-js/src/sha1.js b/crypto-js/src/sha1.js
deleted file mode 100644
index 7573d6c..0000000
--- a/crypto-js/src/sha1.js
+++ /dev/null
@@ -1,85 +0,0 @@
-(function(){

-

-// Shortcuts

-var C = Crypto,

-    util = C.util,

-    charenc = C.charenc,

-    UTF8 = charenc.UTF8,

-    Binary = charenc.Binary;

-

-// Public API

-var SHA1 = C.SHA1 = function (message, options) {

-	var digestbytes = util.wordsToBytes(SHA1._sha1(message));

-	return options && options.asBytes ? digestbytes :

-	       options && options.asString ? Binary.bytesToString(digestbytes) :

-	       util.bytesToHex(digestbytes);

-};

-

-// The core

-SHA1._sha1 = function (message) {

-

-	// Convert to byte array

-	if (message.constructor == String) message = UTF8.stringToBytes(message);

-	/* else, assume byte array already */

-

-	var m  = util.bytesToWords(message),

-	    l  = message.length * 8,

-	    w  =  [],

-	    H0 =  1732584193,

-	    H1 = -271733879,

-	    H2 = -1732584194,

-	    H3 =  271733878,

-	    H4 = -1009589776;

-

-	// Padding

-	m[l >> 5] |= 0x80 << (24 - l % 32);

-	m[((l + 64 >>> 9) << 4) + 15] = l;

-

-	for (var i = 0; i < m.length; i += 16) {

-

-		var a = H0,

-		    b = H1,

-		    c = H2,

-		    d = H3,

-		    e = H4;

-

-		for (var j = 0; j < 80; j++) {

-

-			if (j < 16) w[j] = m[i + j];

-			else {

-				var n = w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16];

-				w[j] = (n << 1) | (n >>> 31);

-			}

-

-			var t = ((H0 << 5) | (H0 >>> 27)) + H4 + (w[j] >>> 0) + (

-			         j < 20 ? (H1 & H2 | ~H1 & H3) + 1518500249 :

-			         j < 40 ? (H1 ^ H2 ^ H3) + 1859775393 :

-			         j < 60 ? (H1 & H2 | H1 & H3 | H2 & H3) - 1894007588 :

-			                  (H1 ^ H2 ^ H3) - 899497514);

-

-			H4 =  H3;

-			H3 =  H2;

-			H2 = (H1 << 30) | (H1 >>> 2);

-			H1 =  H0;

-			H0 =  t;

-

-		}

-

-		H0 += a;

-		H1 += b;

-		H2 += c;

-		H3 += d;

-		H4 += e;

-

-	}

-

-	return [H0, H1, H2, H3, H4];

-

-};

-

-// Package private blocksize

-SHA1._blocksize = 16;

-

-SHA1._digestsize = 20;

-

-})();

diff --git a/crypto-js/src/sha256.js b/crypto-js/src/sha256.js
deleted file mode 100644
index afd9523..0000000
--- a/crypto-js/src/sha256.js
+++ /dev/null
@@ -1,129 +0,0 @@
-(function(){

-

-// Shortcuts

-var C = Crypto,

-    util = C.util,

-    charenc = C.charenc,

-    UTF8 = charenc.UTF8,

-    Binary = charenc.Binary;

-

-// Constants

-var K = [ 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,

-          0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,

-          0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,

-          0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,

-          0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,

-          0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,

-          0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,

-          0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,

-          0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,

-          0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,

-          0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,

-          0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,

-          0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,

-          0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,

-          0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,

-          0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2 ];

-

-// Public API

-var SHA256 = C.SHA256 = function (message, options) {

-	var digestbytes = util.wordsToBytes(SHA256._sha256(message));

-	return options && options.asBytes ? digestbytes :

-	       options && options.asString ? Binary.bytesToString(digestbytes) :

-	       util.bytesToHex(digestbytes);

-};

-

-// The core

-SHA256._sha256 = function (message) {

-

-	// Convert to byte array

-	if (message.constructor == String) message = UTF8.stringToBytes(message);

-	/* else, assume byte array already */

-

-	var m = util.bytesToWords(message),

-	    l = message.length * 8,

-	    H = [ 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A,

-	          0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19 ],

-	    w = [],

-	    a, b, c, d, e, f, g, h, i, j,

-	    t1, t2;

-

-	// Padding

-	m[l >> 5] |= 0x80 << (24 - l % 32);

-	m[((l + 64 >> 9) << 4) + 15] = l;

-

-	for (var i = 0; i < m.length; i += 16) {

-

-		a = H[0];

-		b = H[1];

-		c = H[2];

-		d = H[3];

-		e = H[4];

-		f = H[5];

-		g = H[6];

-		h = H[7];

-

-		for (var j = 0; j < 64; j++) {

-

-			if (j < 16) w[j] = m[j + i];

-			else {

-

-				var gamma0x = w[j - 15],

-				    gamma1x = w[j - 2],

-				    gamma0  = ((gamma0x << 25) | (gamma0x >>>  7)) ^

-				              ((gamma0x << 14) | (gamma0x >>> 18)) ^

-				               (gamma0x >>> 3),

-				    gamma1  = ((gamma1x <<  15) | (gamma1x >>> 17)) ^

-				              ((gamma1x <<  13) | (gamma1x >>> 19)) ^

-				               (gamma1x >>> 10);

-

-				w[j] = gamma0 + (w[j - 7] >>> 0) +

-				       gamma1 + (w[j - 16] >>> 0);

-

-			}

-

-			var ch  = e & f ^ ~e & g,

-			    maj = a & b ^ a & c ^ b & c,

-			    sigma0 = ((a << 30) | (a >>>  2)) ^

-			             ((a << 19) | (a >>> 13)) ^

-			             ((a << 10) | (a >>> 22)),

-			    sigma1 = ((e << 26) | (e >>>  6)) ^

-			             ((e << 21) | (e >>> 11)) ^

-			             ((e <<  7) | (e >>> 25));

-

-

-			t1 = (h >>> 0) + sigma1 + ch + (K[j]) + (w[j] >>> 0);

-			t2 = sigma0 + maj;

-

-			h = g;

-			g = f;

-			f = e;

-			e = d + t1;

-			d = c;

-			c = b;

-			b = a;

-			a = t1 + t2;

-

-		}

-

-		H[0] += a;

-		H[1] += b;

-		H[2] += c;

-		H[3] += d;

-		H[4] += e;

-		H[5] += f;

-		H[6] += g;

-		H[7] += h;

-

-	}

-

-	return H;

-

-};

-

-// Package private blocksize

-SHA256._blocksize = 16;

-

-SHA256._digestsize = 32;

-

-})();

diff --git a/crypto-js/test/AES-profile.html b/crypto-js/test/AES-profile.html
deleted file mode 100644
index a412221..0000000
--- a/crypto-js/test/AES-profile.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

-<head>

-

-<!-- Profiler -->

-<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/yuiloader-dom-event/yuiloader-dom-event.js"></script>

-<script type="text/javascript" src="lib/Profiler.js"></script>

-

-<!-- Test subject -->

-<script type="text/javascript" src="../src/Crypto.js"></script>

-<script type="text/javascript" src="../src/HMAC.js"></script>

-<script type="text/javascript" src="../src/SHA1.js"></script>

-<script type="text/javascript" src="../src/PBKDF2.js"></script>

-<script type="text/javascript" src="../src/BlockModes.js"></script>

-<script type="text/javascript" src="../src/AES.js"></script>

-

-<!-- Profiling -->

-<script type="text/javascript">

-

-// 5KB of random, dummy data

-var data = [];

-for (var i = 0; i < 5000; i++) data.push(String.fromCharCode(Math.floor(Math.random() * 256)));

-data = data.join("");

-

-// Random 256-bit key

-var key = [];

-for (var i = 0; i < 32; i++) key.push(String.fromCharCode(Math.floor(Math.random() * 256)));

-key = key.join("");

-

-profile(["Crypto.AES", "Crypto.mode.OFB", "Crypto.pad.NoPadding", "Crypto.util", "Crypto"], function(){

-	Crypto.AES.decrypt(Crypto.AES.encrypt(data, key), key);

-});

-

-</script>

-

-</head>

-<body class="yui-skin-sam">

-</body>

diff --git a/crypto-js/test/AES-test.js b/crypto-js/test/AES-test.js
deleted file mode 100644
index 1e3e6b4..0000000
--- a/crypto-js/test/AES-test.js
+++ /dev/null
@@ -1,60 +0,0 @@
-TestSuite.add(new YAHOO.tool.TestCase({

-

-	test_AES128: function () {

-

-		// Test vectors

-		Crypto.AES._init([0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F]);

-		Crypto.AES._encryptblock(block = [0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF], 0);

-		Assert.areEqual("69c4e0d86a7b0430d8cdb78070b4c55a", Crypto.util.bytesToHex(block));

-

-		// Test D(E(m)) == m

-		Crypto.AES._encryptblock(block = [0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF], 0);

-		Crypto.AES._decryptblock(block, 0);

-		Assert.areEqual([0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF].toString(), block.toString());

-

-		var key = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F";

-		Assert.areEqual(data, Crypto.AES.decrypt(Crypto.AES.encrypt(data.slice(0), key, { mode: new Crypto.mode.CBC }), key, { mode: new Crypto.mode.CBC, asBytes: true }).toString());

-		Assert.areEqual(data, Crypto.AES.decrypt(Crypto.AES.encrypt(data.slice(0), key), key, { asBytes: true }).toString());

-

-	},

-

-	test_AES192: function () {

-

-		// Test vectors

-		Crypto.AES._init([0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17]);

-		Crypto.AES._encryptblock(block = [0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF], 0);

-		Assert.areEqual("dda97ca4864cdfe06eaf70a0ec0d7191", Crypto.util.bytesToHex(block));

-

-		// Test D(E(m)) == m

-		Crypto.AES._encryptblock(block = [0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF], 0);

-		Crypto.AES._decryptblock(block, 0);

-		Assert.areEqual([0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF].toString(), block.toString());

-

-		var key = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17";

-		Assert.areEqual(data, Crypto.AES.decrypt(Crypto.AES.encrypt(data.slice(0), key, { mode: new Crypto.mode.CBC }), key, { mode: new Crypto.mode.CBC, asBytes: true }).toString());

-		Assert.areEqual(data, Crypto.AES.decrypt(Crypto.AES.encrypt(data.slice(0), key), key, { asBytes: true }).toString());

-

-	},

-

-	test_AES256: function () {

-

-

-		// Test vectors

-		Crypto.AES._init([0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F]);

-		Crypto.AES._encryptblock(block = [0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF], 0);

-		Assert.areEqual("8ea2b7ca516745bfeafc49904b496089", Crypto.util.bytesToHex(block));

-

-		// Test D(E(m)) == m

-		Crypto.AES._encryptblock(block = [0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF], 0);

-		Crypto.AES._decryptblock(block, 0);

-		Assert.areEqual([0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF].toString(), block.toString());

-

-		var key = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F";

-		Assert.areEqual(data, Crypto.AES.decrypt(Crypto.AES.encrypt(data.slice(0), key, { mode: new Crypto.mode.CBC }), key, { mode: new Crypto.mode.CBC, asBytes: true }).toString());

-		Assert.areEqual(data, Crypto.AES.decrypt(Crypto.AES.encrypt(data.slice(0), key), key, { asBytes: true }).toString());

-

-		Assert.areEqual('Сообщение', Crypto.AES.decrypt(Crypto.AES.encrypt('Сообщение', 'Пароль'), 'Пароль'));

-

-	}

-

-}));

diff --git a/crypto-js/test/Crypto-profile.html b/crypto-js/test/Crypto-profile.html
deleted file mode 100644
index 70b955c..0000000
--- a/crypto-js/test/Crypto-profile.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

-<head>

-

-<!-- Profiler -->

-<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/yuiloader-dom-event/yuiloader-dom-event.js"></script>

-<script type="text/javascript" src="lib/Profiler.js"></script>

-

-<!-- Test subject -->

-<script type="text/javascript" src="../src/Crypto.js"></script>

-

-<!-- Profiling -->

-<script type="text/javascript">

-

-// 5KB of random, dummy data

-var data = [];

-for (var i = 0; i < 5000; i++) data.push(String.fromCharCode(Math.floor(Math.random() * 256)));

-data = data.join("");

-

-profile(["Crypto.util", "Crypto.charenc.UTF8", "Crypto.charenc.Binary"], function(){

-

-	var bytes = Crypto.charenc.UTF8.stringToBytes(data);

-	Crypto.charenc.UTF8.bytesToString(bytes);

-

-	var words = Crypto.util.bytesToWords(bytes);

-	Crypto.util.wordsToBytes(words);

-

-	var hex = Crypto.util.bytesToHex(bytes);

-	Crypto.util.hexToBytes(hex);

-

-	var base64 = Crypto.util.bytesToBase64(bytes);

-	Crypto.util.base64ToBytes(base64);

-

-});

-

-</script>

-

-</head>

-<body class="yui-skin-sam">

-</body>

diff --git a/crypto-js/test/Crypto-test.js b/crypto-js/test/Crypto-test.js
deleted file mode 100644
index 92d6ae0..0000000
--- a/crypto-js/test/Crypto-test.js
+++ /dev/null
@@ -1,95 +0,0 @@
-TestSuite.add(new YAHOO.tool.TestCase({

-

-	test_u32: function(){

-		Assert.areEqual(2147483647, Crypto.util.u32(2147483647));

-		Assert.areEqual(2147483646, Crypto.util.u32(2147483646));

-		Assert.areEqual(2, Crypto.util.u32(2));

-		Assert.areEqual(1, Crypto.util.u32(1));

-		Assert.areEqual(0, Crypto.util.u32(0));

-		Assert.areEqual(4294967295, Crypto.util.u32(-1));

-		Assert.areEqual(4294967294, Crypto.util.u32(-2));

-		Assert.areEqual(2147483649, Crypto.util.u32(-2147483647));

-		Assert.areEqual(2147483648, Crypto.util.u32(-2147483648));

-	},

-

-	test_add: function(){

-		Assert.areEqual(0, Crypto.util.add(4294967295, 1));

-		Assert.areEqual(2147483648, Crypto.util.add(2147483647, 1));

-		Assert.areEqual(2147483647, Crypto.util.add(4294967295, 2147483647, 1));

-	},

-

-	test_mult: function(){

-		Assert.areEqual(1, Crypto.util.mult(4294967295, 4294967295));

-		Assert.areEqual(0, Crypto.util.mult(2147483648, 2147483648));

-		Assert.areEqual(3817748708, Crypto.util.mult(2863311530, 2863311530));

-	},

-

-	test_gt: function(){

-		Assert.isTrue(Crypto.util.gt(-1, 1));

-	},

-

-	test_lt: function(){

-		Assert.isTrue(Crypto.util.lt(1, -1));

-	},

-

-	test_rotl: function(){

-		Assert.areEqual(16711850, Crypto.util.rotl(2852192000, 8));

-	},

-

-	test_rotr: function(){

-		Assert.areEqual(11141375, Crypto.util.rotr(2852192000, 8));

-	},

-

-	test_endian: function(){

-		Assert.areEqual(4041261184|0, Crypto.util.endian(2160124144));

-		Assert.areEqual(2160124144|0, Crypto.util.endian(Crypto.util.endian(2160124144)));

-	},

-

-	test_randomBytes: function(){

-		Assert.areEqual(32, Crypto.util.randomBytes(32).length);

-		Assert.areNotEqual(Crypto.util.randomBytes(32).toString(), Crypto.util.randomBytes(32).toString());

-	},

-

-	test_stringToBytes: function(){

-		Assert.areEqual([0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x2C, 0x20, 0x57, 0x6F, 0x72, 0x6C, 0x64, 0x21].toString(), Crypto.charenc.Binary.stringToBytes("Hello, World!").toString());

-		Assert.areEqual([0x41, 0xE2, 0x89, 0xA2, 0xCE, 0x91, 0x2E].toString(), Crypto.charenc.UTF8.stringToBytes("\u0041\u2262\u0391\u002E").toString());

-		Assert.areEqual([0xED, 0x95, 0x9C, 0xEA, 0xB5, 0xAD, 0xEC, 0x96, 0xB4].toString(), Crypto.charenc.UTF8.stringToBytes("\uD55C\uAD6D\uC5B4").toString());

-		Assert.areEqual([0xE6, 0x97, 0xA5, 0xE6, 0x9C, 0xAC, 0xE8, 0xAA, 0x9E].toString(), Crypto.charenc.UTF8.stringToBytes("\u65E5\u672C\u8A9E").toString());

-	},

-

-	test_bytesToString: function(){

-		Assert.areEqual("Hello, World!", Crypto.charenc.Binary.bytesToString([0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x2C, 0x20, 0x57, 0x6F, 0x72, 0x6C, 0x64, 0x21]));

-		Assert.areEqual("\u0041\u2262\u0391\u002E", Crypto.charenc.UTF8.bytesToString([0x41, 0xE2, 0x89, 0xA2, 0xCE, 0x91, 0x2E]));

-		Assert.areEqual("\uD55C\uAD6D\uC5B4", Crypto.charenc.UTF8.bytesToString([0xED, 0x95, 0x9C, 0xEA, 0xB5, 0xAD, 0xEC, 0x96, 0xB4]));

-		Assert.areEqual("\u65E5\u672C\u8A9E", Crypto.charenc.UTF8.bytesToString([0xE6, 0x97, 0xA5, 0xE6, 0x9C, 0xAC, 0xE8, 0xAA, 0x9E]));

-	},

-

-	test_bytesToWords: function(){

-		Assert.areEqual([0x48656C6C, 0x6F2C2057, 0x6F726C64, 0x21000000].toString(), Crypto.util.bytesToWords([0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x2C, 0x20, 0x57, 0x6F, 0x72, 0x6C, 0x64, 0x21]).toString());

-	},

-

-	test_wordsToBytes: function(){

-		Assert.areEqual([0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x2C, 0x20, 0x57, 0x6F, 0x72, 0x6C, 0x64, 0x21, 0x00, 0x00, 0x00].toString(), Crypto.util.wordsToBytes([0x48656C6C, 0x6F2C2057, 0x6F726C64, 0x21000000]).toString());

-	},

-

-	test_bytesToHex: function(){

-		Assert.areEqual("48656c6c6f2c20576f726c6421", Crypto.util.bytesToHex([0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x2C, 0x20, 0x57, 0x6F, 0x72, 0x6C, 0x64, 0x21]));

-	},

-

-	test_hexToBytes: function(){

-		Assert.areEqual([0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x2C, 0x20, 0x57, 0x6F, 0x72, 0x6C, 0x64, 0x21].toString(), Crypto.util.hexToBytes("48656c6c6f2c20576f726c6421"));

-	},

-

-	test_bytesToBase64: function(){

-		Assert.areEqual("FPucA9l+", Crypto.util.bytesToBase64([0x14, 0xFB, 0x9C, 0x03, 0xD9, 0x7E]));

-		Assert.areEqual("FPucA9k=", Crypto.util.bytesToBase64([0x14, 0xFB, 0x9C, 0x03, 0xD9]));

-		Assert.areEqual("FPucAw==", Crypto.util.bytesToBase64([0x14, 0xFB, 0x9C, 0x03]));

-	},

-

-	test_base64ToBytes: function(){

-		Assert.areEqual([0x14, 0xFB, 0x9C, 0x03, 0xD9, 0x7E].toString(), Crypto.util.base64ToBytes("FPucA9l+"));

-		Assert.areEqual([0x14, 0xFB, 0x9C, 0x03, 0xD9].toString(), Crypto.util.base64ToBytes("FPucA9k="));

-		Assert.areEqual([0x14, 0xFB, 0x9C, 0x03].toString(), Crypto.util.base64ToBytes("FPucAw=="));

-	}

-

-}));

diff --git a/crypto-js/test/DES-test.js b/crypto-js/test/DES-test.js
deleted file mode 100644
index 7861b68..0000000
--- a/crypto-js/test/DES-test.js
+++ /dev/null
@@ -1,134 +0,0 @@
-TestSuite.add(new YAHOO.tool.TestCase({

-

-    test_DES_initialPermutation : function() {

-        // the initial permutation is

-        var ip = [ 58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12,

-                4, 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16,

-                8, 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3,

-                61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7 ];

-        var st = Crypto.DES._state;

-        for ( var i = 0; i < 64; i++) {

-            // set the IP(i)'th bit

-            var m = [ 0, 0, 0, 0, 0, 0, 0, 0 ];

-            var b = ip[i];

-            var b0 = (b - 1);

-            var i0 = Math.floor(b0 / 8);

-            var b1 = b0 % 8;

-            var b2 = 7 - b1;

-            var b3 = 1 << b2;

-            m[i0] += b3;

-            st.initialPerm(m, 0);

-

-            // check the i'th bit is set

-            if (i < 32) {

-                b3 = 1 << (31 - i);

-                Assert.areEqual(st.lhs, b3, "LHS should be " + b3 + " for bit "

-                        + i + ", not " + st.lhs);

-                Assert.areEqual(st.rhs, 0, "RHS should be 0 for bit " + i

-                        + " not " + st.rhs);

-            } else {

-                b3 = 1 << (63 - i);

-                Assert.areEqual(st.rhs, b3, "RHS should be " + b3 + " for bit "

-                        + i + ", not " + st.rhs);

-                Assert.areEqual(st.lhs, 0, "LHS should be 0 for bit " + i

-                        + " not " + st.lhs);

-            }

-        }

-    },

-

-    test_DES_finalPermutation : function() {

-        var st = Crypto.DES._state;

-        for ( var i = 0; i < 64; i++) {

-            // set the i'th bit

-            var m = [ 0, 0, 0, 0, 0, 0, 0, 0 ];

-            var n = [ 0, 0, 0, 0, 0, 0, 0, 0 ];

-            var b = i;

-            var b0 = (b - 1);

-            var i0 = Math.floor(b0 / 8);

-            var b1 = b0 % 8;

-            var b2 = 7 - b1;

-            var b3 = 1 << b2;

-            m[i0] += b3;

-            st.initialPerm(m, 0);

-            var t = st.lhs;

-            st.lhs = st.rhs;

-            st.rhs = t;

-            st.finalPerm(n, 0);

-

-            // final perm has undone the initial perm

-            for ( var j = 0; j < 8; j++) {

-                Assert.areEqual(m[j], n[j], "Byte " + j + " is set to " + n[j]

-                        + ". Should be " + m[j] + " for bit " + i);

-            }

-        }

-    },

-

-    test_DES_encrypt : function() {

-        var data = [ "AAAAAAAAAAA=", "AAAAAAAAAAA=", "jKZN6cGxI6c=",

-                "HpSCM+JYRqY=", "iqiQm3ZGgVs=", "oCZZDeifj0Y=", "15Lu8Iv9KxU=",

-                "z+Ibdv1Cpl8=", "nn7ZDOyzaaY=", "cevpCdQ6hSI=", "IZxIZK4RgRI=",

-                "e3N98AabZ7E=", "2nuDqakGmuY=", "xqAwR/FDmJU=", "G7KNuqVOgI0=",

-                "8EhcepqRvVQ=", "4Sw9+HTtT4E=", "1FZCOo1nOus=", "a9Og6fJD7Ls=",

-                "9KU7pGI5Gck=", "W2tJ6nY07ks=", "+VZIswj4o70=", "pehFx9We6Vs=",

-                "d3WxvPeGVi0=", "qlfmQNQFVQI=", "xC67lYhojPg=", "ktr+s0xD14U=",

-                "jiE9gsTzn/E=", "jNHSttCDWIc=", "6xNmlFELedY=", "mx6G2NDgfMM=",

-                "KGwiHszK/4Q=", "vnG3uyxF2r0=", "1CZPTcv7pss=", "eSIFj9s9zPM=",

-                "g572tn8UFrA=", "qC4a2vybd+s=", "FhBq707g8uQ=", "8YZwdQJvx7g=",

-                "l/fe4O3OAXU=", "lCNsU14s6/E=", "yrnaHmjVMuY=", "G6dk5YJv+GU=",

-                "Bup1aGBSNRk=", "WsNpfPgZKmA=", "xWdjBkwa9vY=", "xw7YMTa36AE=",

-                "rg4GNEds9sg=", "pXi88R+TX90=", "dpPheQhmBwE=", "1hMLz2taJ1c=",

-                "704ZC+FvjvA=", "QQT1zTRpKqI=", "+Z9GLDBwmrA=", "2q0oDqUce98=",

-                "ZiwGsoI+5mU=", "s683ebMdciI=", "y9i6l/eM+lc=", "9w6gFJzahdI=",

-                "tiPWEQmWAPo=", "skNsEXkuFQ0=", "3SdLGLzvrXo=", "z9TGKQUdE5k=",

-                "tGWgfK7wQeQ=", "HjkobqdrYdg=", "HB/7Hbznrl0=", "CpKEcRV2qcI=",

-                "YigUsNlg+5Q=", "q++752WuwbA=", "KPvsX3nCQtk=", "srDtGgHPQU8=",

-                "/hzYXWY3Q08=", "IURcKIf621k=", "g+zdc6/+9xo=", "ccNsHGYeb7Q=",

-                "SUSojaAIN3U=", "8/sQwktkjrg=", "5B+VaNB+y1M=", "G+G0wfA6i7w=",

-                "UUtcWUk++fo=", "xVBcjnvZPGo=", "XSLog78uOiw=", "4z0kvppilow=",

-                "a09xSM0eaRw=", "guSIbAedl4M=", "4kCrd2XvnYU=", "pIq2fDcUg4s=",

-                "Ts1rN0XciDM=", "yYoQgPbSIEY=", "RDsN+DvyifA=", "wGZoMJQrukQ=",

-                "zgrluPZeUy4=", "m0EiR5pnMmo=", "K4RKd/YadZs=", "sEyhdNxaEQE=",

-                "2PKN0T4VQ2w=", "pVWSNfWkBAQ=", "s1SvmKNJbIk=", "WNcYBRzmkrk=",

-                "pc2XSGrNSFw=", "6LdnNb3W6ws=", "uA/e1OZ6BKA=", "5zzMZJzZ5PY=",

-                "snSRUUaeM9o=", "Zu9SM1bf2g4=", "k0gfjYx1kEc=", "hE/ocX3EQDs=",

-                "DlOcB+iUTks=", "nZ46go5axec=", "77clg28QpaY=", "32OmPfNVOWo=",

-                "bgyayhtLiMQ=", "23lE6vR9TOU=", "UO0ez9vOY40=", "xNu7TOV3pZI=",

-                "FL93y996tRE=", "gnnowxva+xQ=", "1pn/cSyipZs=", "CCXSCHBDUys=",

-                "e5oMZRvAHdY=", "u6yHGVCPQkQ=", "zuohBg0SVTA=", "9jEneIdOehU=",

-                "C1vUmKahdto=", "antTJDEWhJ0=", "tB1j3YF0SGc=", "xikV2o6qrN4=",

-                "T9j746RmlSg=", "qP4PcaQuQJE=", "dLSXsMRJUgY=", "JKjAOOxibFU=",

-                "AFXN6ahfb74=", "jmOJePdtYCc=", "y+1rVgM4na0=", "GPh5aMMcmVs=",

-                "HKWzapfKkmk=", "nqvV8El8Rlo=", "jTbMKji3N7A=", "nosw/fNWQOw=",

-                "+/at2bwWVFY=", "qoT4f2OMAYU=", "MPePoYIqVEQ=", "AkDWLmXlrIE=",

-                "4n2Jj9ZnWzs=", "6KzD/YBKBx4=", "ndGgARXX718=", "n4g7yLYyDN4=",

-                "ggCr0bw88Q4=", "wM0531FsfAY=", "HsbYYaX2OUE=", "P/R8bbBzDng=",

-                "8SntzIrTzag=", "/RyRQI1zr4Q=" ];

-

-        for ( var i = 0; i < data.length; i += 3) {

-            var key = Crypto.util.base64ToBytes(data[i]);

-            var inp = Crypto.util.base64ToBytes(data[i + 1]);

-            var out = Crypto.util.base64ToBytes(data[i + 2]);

-            Crypto.DES._init(key);

-            Crypto.DES._encryptblock(inp, 0);

-            Assert.areEqual(inp.toString(), out.toString());

-        }

-    },

-

-    test_DES_encrypt_decrypt : function() {

-        for(var i=0;i<100;i++) {

-            var key = Crypto.util.randomBytes(8);

-            var inp = Crypto.util.randomBytes(8);

-

-            Crypto.DES._init(key);

-            var out = inp.slice(0);

-            Crypto.DES._encryptblock(out, 0);

-            Crypto.DES._decryptblock(out, 0);

-            Assert.areEqual(inp.toString(), out.toString(),

-                    "DES E(D(x) failed: " + inp.toString() + " became "

-                            + out.toString());

-

-            Assert.areEqual(inp.toString(), Crypto.DES.decrypt(Crypto.DES.encrypt(inp.slice(0), key), key, { asBytes: true }).toString());

-        }

-    }

-

-}));

diff --git a/crypto-js/test/DESCompile.js b/crypto-js/test/DESCompile.js
deleted file mode 100644
index 11ebcb9..0000000
--- a/crypto-js/test/DESCompile.js
+++ /dev/null
@@ -1,125 +0,0 @@
-/** Compile SBOXes */

-

-function toHex(n) {

-    n = n >>> 0;

-    return (n < 0) ? ("-0x" + (-n).toString(16)) : ("0x" + n.toString(16));

-}

-

-/**

- * The bits the SBOXes operate upon

- */

-var SBOX_BITS = new Array(8);

-SBOX_BITS[0] = [ 0x10000000, 0x20000000, 0x40000000, 0x80000000, 0x08000000,

-        0x00000001 ];

-SBOX_BITS[1] = [ 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x00800000,

-        0x10000000 ];

-SBOX_BITS[2] = [ 0x00100000, 0x00200000, 0x00400000, 0x00800000, 0x00080000,

-        0x01000000 ];

-SBOX_BITS[3] = [ 0x00010000, 0x00020000, 0x00040000, 0x00080000, 0x00008000,

-        0x00100000 ];

-SBOX_BITS[4] = [ 0x00001000, 0x00002000, 0x00004000, 0x00008000, 0x00000800,

-        0x00010000 ];

-SBOX_BITS[5] = [ 0x00000100, 0x00000200, 0x00000400, 0x00000800, 0x00000080,

-        0x00001000 ];

-SBOX_BITS[6] = [ 0x00000010, 0x00000020, 0x00000040, 0x00000080, 0x00000008,

-        0x00000100 ];

-SBOX_BITS[7] = [ 0x00000001, 0x00000002, 0x00000004, 0x00000008, 0x80000000,

-        0x00000010 ];

-

-/** The raw SBOXes */

-var SBOX = new Array(8);

-SBOX[0] = [ 14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7, 0, 15, 7, 4,

-        14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8, 4, 1, 14, 8, 13, 6, 2, 11, 15,

-        12, 9, 7, 3, 10, 5, 0, 15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0,

-        6, 13 ];

-

-SBOX[1] = [ 15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10, 3, 13, 4, 7,

-        15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5, 0, 14, 7, 11, 10, 4, 13, 1, 5,

-        8, 12, 6, 9, 3, 2, 15, 13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5,

-        14, 9 ];

-

-SBOX[2] = [ 10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8, 13, 7, 0, 9,

-        3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1, 13, 6, 4, 9, 8, 15, 3, 0, 11,

-        1, 2, 12, 5, 10, 14, 7, 1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5,

-        2, 12 ];

-

-SBOX[3] = [ 7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15, 13, 8, 11, 5,

-        6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9, 10, 6, 9, 0, 12, 11, 7, 13, 15,

-        1, 3, 14, 5, 2, 8, 4, 3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2,

-        14 ];

-

-SBOX[4] = [ 2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9, 14, 11, 2,

-        12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6, 4, 2, 1, 11, 10, 13, 7, 8,

-        15, 9, 12, 5, 6, 3, 0, 14, 11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10,

-        4, 5, 3 ];

-

-SBOX[5] = [ 12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11, 10, 15, 4, 2,

-        7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8, 9, 14, 15, 5, 2, 8, 12, 3, 7,

-        0, 4, 10, 1, 13, 11, 6, 4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0,

-        8, 13 ];

-

-SBOX[6] = [ 4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1, 13, 0, 11, 7,

-        4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6, 1, 4, 11, 13, 12, 3, 7, 14, 10,

-        15, 6, 8, 0, 5, 9, 2, 6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3,

-        12 ];

-

-SBOX[7] = [ 13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7, 1, 15, 13, 8,

-        10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2, 7, 11, 4, 1, 9, 12, 14, 2, 0,

-        6, 10, 13, 15, 3, 5, 8, 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5,

-        6, 11 ];

-

-/**

- * Post SBOX permutation. This calls the MSB bit 1 and the LSB bit 32.

- */

-var PERM1 = [ 16, 7, 20, 21, 29, 12, 28, 17, 1, 15, 23, 26, 5, 18, 31, 10, 2,

-        8, 24, 14, 32, 27, 3, 9, 19, 13, 30, 6, 22, 11, 4, 25 ];

-

-// invert the permutation

-var PERM = new Array(32);

-for ( var i = 0; i < 32; i++) {

-    PERM[PERM1[i] - 1] = i;

-}

-

-// this produces:

-//  8,16,22,30 box 0

-// 12,27, 1,17 box 1

-// 23,15,29, 5 box 2

-// 25,19, 9, 0 box 3

-//  7,13,24, 2 box 4

-//  3,28,10,18 box 5

-// 31,11,21, 6 box 6

-//  4,26,14,20 box 7

-

-for ( var box = 0; box <= 7; box++) {

-    print("\nSBOX[" + box + "] = new Array();");

-    for ( var ind = 0; ind <= 63; ind++) {

-        var n = ind;

-        var match = 0;

-        for ( var i = 0; i < 6; i++) {

-            if (n & 1) {

-                match = match + SBOX_BITS[box][i];

-            }

-            n = n >> 1;

-        }

-

-        var res = 0;

-        var n = SBOX[box][ind];

-        var b = 1;

-        for ( var i = 0; i < 4; i++) {

-            if (n & b) {

-                var bit = box * 4 + (3 - i);

-                bit = PERM[bit];

-                bit = 31 - bit;

-                res += Math.pow(2, bit);

-            }

-            b *= 2;

-        }

-        var mm = match;

-        match = (match ^ 1) ^ 1;

-        print("SBOX[" + box + "][" + match + "]= 0x" + res.toString(16)

-                + ";    // " + mm.toString(16) + " (" + (ind >> 4) + ", "

-                + (ind & 15) + ") = " + n);

-    }

-}

-

-exit;

diff --git a/crypto-js/test/DesTestValues.java b/crypto-js/test/DesTestValues.java
deleted file mode 100644
index 2f3ef34..0000000
--- a/crypto-js/test/DesTestValues.java
+++ /dev/null
@@ -1,182 +0,0 @@
-import org.bouncycastle.jce.provider.BouncyCastleProvider;

-

-import javax.crypto.Cipher;

-import javax.crypto.NoSuchPaddingException;

-import javax.crypto.spec.SecretKeySpec;

-

-import java.security.*;

-import java.util.ArrayList;

-import java.util.List;

-import java.util.Random;

-

-

-public class DesTestValues {

-

-    /** The character to use for each 6-bit block */

-    private final static char[] BASE64CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".toCharArray();

-

-    /** The pad character for 6-bit encoding */

-    private final static char BASE64PAD = '=';

-

-    /** The 6-bit block to use for each character. */

-    private final static byte[] BASE64BLOCKS = new byte[127];

-

-    /** Initialise the BASE64BLOCKS */

-    static {

-        for(int i = 0;i < 127;i++) {

-            BASE64BLOCKS[i] = (byte) -1;

-        }

-        for(int i = 0;i < 64;i++) {

-            BASE64BLOCKS[BASE64CHARS[i]] = (byte) i;

-        }

-    }

-

-

-    /**

-     * Encode the provided binary data in a textual form.

-     * 

-     * @param bytes

-     *            binary data

-     * @return textual representation

-     */

-    protected static String encode(byte[] bytes) {

-        // every three bytes requires 4 characters of output

-        int fullBlocks = bytes.length / 3;

-        int extraBytes = bytes.length - 3 * fullBlocks;

-

-        char[] output = new char[4 * fullBlocks + ((extraBytes == 0) ? 0 : 4)];

-

-        for(int i = 0;i < fullBlocks;i++) {

-            int j = i * 3;

-            getBlock64(output, i * 4, bytes[j], bytes[j + 1], bytes[j + 2]);

-        }

-

-        int i = fullBlocks * 4;

-        int j = fullBlocks * 3;

-        switch (extraBytes) {

-        case 0:

-            break;

-        case 1:

-            getBlock64(output, i, bytes[j], (byte) 0, (byte) 0);

-            output[i + 2] = BASE64PAD;

-            output[i + 3] = BASE64PAD;

-            break;

-        case 2:

-            getBlock64(output, i, bytes[j], bytes[j + 1], (byte) 0);

-            output[i + 3] = BASE64PAD;

-            break;

-        }

-

-        return new String(output);

-    }

-

-

-    private final static void getBlock64(char[] output, int offset, byte b0,

-            byte b1, byte b2) {

-        int v = ((0xff & b0) << 16) | ((0xff & b1) << 8) | (0xff & b2);

-        output[offset] = BASE64CHARS[((0xfc0000) & v) >> 18];

-        output[offset + 1] = BASE64CHARS[((0x03f000) & v) >> 12];

-        output[offset + 2] = BASE64CHARS[((0x000fc0) & v) >> 6];

-        output[offset + 3] = BASE64CHARS[((0x00003f) & v) >> 0];

-    }

-

-    public static final String TEXT = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.";

-

-    public static final byte[] DATA = new byte[256];

-

-    static {

-        // build test data

-        for(int i = 0;i < DATA.length;i++) {

-            DATA[i] = (byte) ((i * 7) % 256);

-        }

-    }

-

-

-    private static void format(String var, byte[] data) {

-        String bytes = encode(data);

-        StringBuilder buf = new StringBuilder();

-        buf.append("        ").append(var).append(

-                " = Crypto.util.base64ToBytes(");

-        if (buf.length() + bytes.length() < 76) {

-            buf.append("\"").append(bytes).append("\");");

-            System.out.println(buf.toString());

-            return;

-        }

-

-        int p = 0;

-        while( p < bytes.length() ) {

-            if (p != 0) buf.append('+');

-            buf.append("\n            \"");

-            int e = Math.min(bytes.length(), p+60);

-            buf.append(bytes.substring(p,e));

-            buf.append("\"");

-            p+=60;

-        }

-        buf.append(");\n");

-

-        System.out.println(buf.toString());

-        return;

-    }

-    

-    private static String format(byte[] data) {

-        String bytes = encode(data);

-        StringBuilder buf = new StringBuilder();

-        buf.append("            Crypto.util.base64ToBytes(");

-        if (buf.length() + bytes.length() < 76) {

-            buf.append("\"").append(bytes).append("\")");

-            return buf.toString();

-        }

-

-        int p = 0;

-        while( p < bytes.length() ) {

-            if (p != 0) buf.append('+');

-            buf.append("\n                \"");

-            int e = Math.min(bytes.length(), p+56);

-            buf.append(bytes.substring(p,e));

-            buf.append("\"");

-            p+=56;

-        }

-        buf.append(")");

-

-        return buf.toString();

-    }

-

-	/**

-	 * @param args

-	 * @throws NoSuchPaddingException 

-	 * @throws NoSuchAlgorithmException 

-	 * @throws GeneralSecurityException 

-	 */

-	public static void main(String[] args) throws GeneralSecurityException {

-	    Provider prov = new BouncyCastleProvider();

-        Security.addProvider(prov);        

-        Cipher cipher = Cipher.getInstance("DES/ECB/NoPadding",prov);

-        

-        Random rand = new Random(1234567890123457890l);

-        List<byte[]> data = new ArrayList<byte[]>(100);

-        

-        byte[] key = new byte[8];

-        byte[] inp = new byte[8];

-        data.add(key.clone());

-        data.add(inp.clone());

-        Key k = new SecretKeySpec(key,"DES");

-        cipher.init(Cipher.ENCRYPT_MODE,k,(SecureRandom) null);

-        data.add(cipher.doFinal(inp));

-       

-        for(int i=0;i<50;i++) {

-            rand.nextBytes(key);

-            rand.nextBytes(inp);

-            data.add(key.clone());

-            data.add(inp.clone());

-            k = new SecretKeySpec(key,"DES");

-            cipher.init(Cipher.ENCRYPT_MODE,k,(SecureRandom) null);

-            data.add(cipher.doFinal(inp));

-        }

-        

-        

-        for(byte[] d : data) {

-            System.out.println("    \""+encode(d)+"\",");

-        }

-	}

-

-}

diff --git a/crypto-js/test/HMAC-profile.html b/crypto-js/test/HMAC-profile.html
deleted file mode 100644
index 5032636..0000000
--- a/crypto-js/test/HMAC-profile.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

-<head>

-

-<!-- Profiler -->

-<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/yuiloader-dom-event/yuiloader-dom-event.js"></script>

-<script type="text/javascript" src="lib/Profiler.js"></script>

-

-<!-- Test subject -->

-<script type="text/javascript" src="../src/Crypto.js"></script>

-<script type="text/javascript" src="../src/SHA256.js"></script>

-<script type="text/javascript" src="../src/SHA1.js"></script>

-<script type="text/javascript" src="../src/MD5.js"></script>

-<script type="text/javascript" src="../src/HMAC.js"></script>

-

-<!-- Profiling -->

-<script type="text/javascript">

-

-profile(["Crypto.HMAC", "Crypto.MD5", "Crypto.SHA1", "Crypto.SHA256", "Crypto.util", "Crypto"], function(){

-	Crypto.HMAC(Crypto.SHA256, "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", "Hi There");

-	Crypto.HMAC(Crypto.SHA1, "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", "Hi There");

-	Crypto.HMAC(Crypto.MD5, "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b", "Hi There");

-});

-

-</script>

-

-</head>

-<body class="yui-skin-sam">

-</body>

diff --git a/crypto-js/test/HMAC-test.js b/crypto-js/test/HMAC-test.js
deleted file mode 100644
index ff898c8..0000000
--- a/crypto-js/test/HMAC-test.js
+++ /dev/null
@@ -1,9 +0,0 @@
-TestSuite.add(new YAHOO.tool.TestCase({

-

-	test_HMAC: function () {

-		Assert.areEqual("9294727a3638bb1c13f48ef8158bfc9d", Crypto.HMAC(Crypto.MD5, "Hi There", "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b"));

-		Assert.areEqual("750c783e6ab0b503eaa86e310a5db738", Crypto.HMAC(Crypto.MD5, "what do ya want for nothing?", "Jefe"));

-		Assert.areEqual("56be34521d144c88dbb8c733f0e8b3f6", Crypto.HMAC(Crypto.MD5, [0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD], [0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA]));

-	}

-

-}));

diff --git a/crypto-js/test/MARC4-profile.html b/crypto-js/test/MARC4-profile.html
deleted file mode 100644
index ec5118d..0000000
--- a/crypto-js/test/MARC4-profile.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

-<head>

-

-<!-- Profiler -->

-<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/yuiloader-dom-event/yuiloader-dom-event.js"></script>

-<script type="text/javascript" src="lib/Profiler.js"></script>

-

-<!-- Test subject -->

-<script type="text/javascript" src="../src/Crypto.js"></script>

-<script type="text/javascript" src="../src/HMAC.js"></script>

-<script type="text/javascript" src="../src/SHA1.js"></script>

-<script type="text/javascript" src="../src/PBKDF2.js"></script>

-<script type="text/javascript" src="../src/MARC4.js"></script>

-

-<!-- Profiling -->

-<script type="text/javascript">

-

-// 5KB of random, dummy data

-var data = [];

-for (var i = 0; i < 5000; i++) data.push(String.fromCharCode(Math.floor(Math.random() * 256)));

-data = data.join("");

-

-// Random 128-bit key

-var key = [];

-for (var i = 0; i < 16; i++) key.push(String.fromCharCode(Math.floor(Math.random() * 256)));

-key = key.join("");

-

-profile(["Crypto.MARC4", "Crypto.util", "Crypto"], function(){

-	Crypto.MARC4.decrypt(Crypto.MARC4.encrypt(data, key), key);

-});

-

-</script>

-

-</head>

-<body class="yui-skin-sam">

-</body>

diff --git a/crypto-js/test/MARC4-test.js b/crypto-js/test/MARC4-test.js
deleted file mode 100644
index 6d436e8..0000000
--- a/crypto-js/test/MARC4-test.js
+++ /dev/null
@@ -1,19 +0,0 @@
-TestSuite.add(new YAHOO.tool.TestCase({

-

-	test_MARC4: function () {

-

-		// Test vectors

-		Crypto.MARC4._marc4(message = [0,0,0,0,0,0,0,0], [0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF], 0);

-		Assert.areEqual([0x74, 0x94, 0xC2, 0xE7, 0x10, 0x4B, 0x08, 0x79].toString(), message.toString());

-

-		Crypto.MARC4._marc4(message = [0xDC, 0xEE, 0x4C, 0xF9, 0x2C], [0x61, 0x8A, 0x63, 0xD2, 0xFB], 0);

-		Assert.areEqual([0xF1, 0x38, 0x29, 0xC9, 0xDE].toString(), message.toString());

-

-		// Test D(E(m)) == m

-		var key = Crypto.util.randomBytes(Math.floor(Math.random() * 256));

-		Assert.areEqual(data, Crypto.MARC4.decrypt(Crypto.MARC4.encrypt(data, key), key));

-		Assert.areEqual('Сообщение', Crypto.MARC4.decrypt(Crypto.MARC4.encrypt('Сообщение', 'Пароль'), 'Пароль'));

-

-	}

-

-}));

diff --git a/crypto-js/test/MD5-profile.html b/crypto-js/test/MD5-profile.html
deleted file mode 100644
index 40f1821..0000000
--- a/crypto-js/test/MD5-profile.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

-<head>

-

-<!-- Profiler -->

-<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/yuiloader-dom-event/yuiloader-dom-event.js"></script>

-<script type="text/javascript" src="lib/Profiler.js"></script>

-

-<!-- Test subject -->

-<script type="text/javascript" src="../src/Crypto.js"></script>

-<script type="text/javascript" src="../src/MD5.js"></script>

-

-<!-- Profiling -->

-<script type="text/javascript">

-

-// 5KB of random, dummy data

-var data = [];

-for (var i = 0; i < 5000; i++) data.push(String.fromCharCode(Math.floor(Math.random() * 256)));

-data = data.join("");

-

-profile(["Crypto.MD5", "Crypto.util", "Crypto"], function(){

-	Crypto.MD5(data);

-});

-

-</script>

-

-</head>

-<body class="yui-skin-sam">

-</body>

diff --git a/crypto-js/test/MD5-test.js b/crypto-js/test/MD5-test.js
deleted file mode 100644
index 424d659..0000000
--- a/crypto-js/test/MD5-test.js
+++ /dev/null
@@ -1,17 +0,0 @@
-TestSuite.add(new YAHOO.tool.TestCase({

-

-	test_MD5: function () {

-		Assert.areEqual("d41d8cd98f00b204e9800998ecf8427e", Crypto.MD5(""));

-		Assert.areEqual("0cc175b9c0f1b6a831c399e269772661", Crypto.MD5("a"));

-		Assert.areEqual("900150983cd24fb0d6963f7d28e17f72", Crypto.MD5("abc"));

-		Assert.areEqual("f96b697d7cb7938d525a2f31aaf161d0", Crypto.MD5("message digest"));

-		Assert.areEqual("c3fcd3d76192e4007dfb496cca67e13b", Crypto.MD5("abcdefghijklmnopqrstuvwxyz"));

-		Assert.areEqual("d174ab98d277d9f5a5611c2c9f419d9f", Crypto.MD5("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"));

-		Assert.areEqual("57edf4a22be3c955ac49da2e2107b67a", Crypto.MD5("12345678901234567890123456789012345678901234567890123456789012345678901234567890"));

-		Assert.areEqual("e7bcfa759805b3e8ffa4e94acba017c3", Crypto.MD5("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque tempor massa sit amet velit consectetur eu pellentesque felis feugiat. Mauris ullamcorper, sapien vel eleifend pulvinar, ligula lacus imperdiet mi, volutpat consequat velit dui a quam. Integer semper orci eget lectus feugiat sed adipiscing urna consectetur. In sem sem, aliquam nec vestibulum ac, aliquet quis elit. Maecenas vehicula tempor enim at dictum. Nam at sem et libero mattis hendrerit non a ante. Aliquam ut pharetra nunc. Quisque massa mi, commodo vitae semper nec, ultricies vitae ligula. Vestibulum in neque sapien. Sed vitae purus sit amet felis interdum porttitor vel sed arcu. Ut quis venenatis eros. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aenean pulvinar tellus a nunc egestas cursus. Phasellus eu velit rutrum diam cursus pulvinar. Duis consequat libero quis lectus aliquet eleifend. Curabitur mi libero, dictum at dapibus at, accumsan a dolor. Aliquam metus."));

-		Assert.areEqual("7d017545e0268a6a12f2b507871d0429", Crypto.MD5("12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"));

-		Assert.areEqual([0xD4, 0x1D, 0x8C, 0xD9, 0x8F, 0x00, 0xB2, 0x04, 0xE9, 0x80, 0x09, 0x98, 0xEC, 0xF8, 0x42, 0x7E].toString(), Crypto.MD5("", { asBytes: true }).toString());

-		Assert.areEqual("\xD4\x1D\x8C\xD9\x8F\x00\xB2\x04\xE9\x80\x09\x98\xEC\xF8\x42\x7E", Crypto.MD5("", { asString: true }));

-	}

-

-}));

diff --git a/crypto-js/test/Mode-test.js b/crypto-js/test/Mode-test.js
deleted file mode 100644
index 692abb9..0000000
--- a/crypto-js/test/Mode-test.js
+++ /dev/null
@@ -1,728 +0,0 @@
-TestSuite.add(new YAHOO.tool.TestCase({

-	

-	_binaryData : Crypto.util.base64ToBytes(

-	        "AAcOFRwjKjE4P0ZNVFtiaXB3foWMk5qhqK+2vcTL0tng5+71/AMKERgfJi00"+

-	        "O0JJUFdeZWxzeoGIj5adpKuyucDHztXc4+rx+P8GDRQbIikwNz5FTFNaYWhv"+

-	        "dn2Ei5KZoKeutbzDytHY3+bt9PsCCRAXHiUsMzpBSE9WXWRrcnmAh46VnKOq"+

-	        "sbi/xs3U2+Lp8Pf+BQwTGiEoLzY9REtSWWBnbnV8g4qRmJ+mrbS7wsnQ197l"+

-	        "7PP6AQgPFh0kKzI5QEdOVVxjanF4f4aNlJuiqbC3vsXM09rh6O/2/QQLEhkg"+

-	        "Jy41PENKUVhfZm10e4KJkJeepayzusHIz9bd5Ovy+Q=="),

-

-    _textData : "Lorem ipsum dolor sit amet, consectetur adipisicing elit, " +

-    		"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. " +

-    		"Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris " +

-    		"nisi ut aliquip ex ea commodo consequat.",

-

-    _iv : Crypto.util.base64ToBytes("AgMFBwsNERMXHR8lKSsvNQ=="),

-

-	_key : Crypto.util.base64ToBytes(

-			"Fy5FXHOKobjP5v0UK0JZcIeetczj+hEoP1ZthJuyyeA="),

-	

-	_compare: function(a, b, m) {

-		// check result has expected length

-		Assert.areEqual(a.length, b.length,"Output has length "+a.length+" but expected "+b.length);

-		

-		// check input has been preserved

-		if( m==null ) m=a.length;

-		for(var i=0;i<m;i++) {

-			Assert.areEqual(a[i],b[i],"Byte "+i+" is "+a[i]+" not "+b[i]);

-		}		

-	},

-	

-	

-	_testBinary: function(m,r) {

-        var opts = {

-            iv : this._iv.slice(0),

-            asBytes : true,

-            mode: m

-        };

-        

-        // iso10126 uses random bytes, so a precise match is impossible

-        var skipPad = 0;

-        if( m._padding == Crypto.pad.iso10126 ) {

-        	// skip last 16 bytes as they are random

-        	skipPad = 16;

-        }

-

-        var output = Crypto.AES.encrypt(this._binaryData.slice(0),this._key,opts);

-        this._compare(output,r,r.length-skipPad);

-        

-        for(var i=0;i<100;i++) {

-        	var data = this._binaryData.slice(i);

-        	var enc = Crypto.AES.encrypt(data,this._key,opts);

-        	var dec = Crypto.AES.decrypt(enc,this._key,opts);

-        	this._compare(data,dec);

-        }		

-	},

-	

-	_testText: function(m,r) {

-        var opts = {

-            iv : this._iv.slice(0),

-            asBytes : true,

-            mode: m

-        };

-        

-        // iso10126 uses random bytes, so a precise match is impossible

-        var skipPad = 0;

-        if( m._padding == Crypto.pad.iso10126 ) {

-        	// skip last 16 bytes as they are random

-        	skipPad = 16;

-        }

-        

-        var output = Crypto.AES.encrypt(this._textData,this._key,opts);

-        this._compare(output,r,r.length-skipPad);

-        

-        opts = {

-                iv : this._iv.slice(0),

-                mode: m

-            };           

-        for(var i=0;i<100;i++) {

-        	var data = this._textData.substring(i);

-        	var enc = Crypto.AES.encrypt(data,this._key,opts);

-        	var dec = Crypto.AES.decrypt(enc,this._key,opts);

-        	this._compare(data,dec);

-        }		

-	},

-	

-	

-	test_ECB_Binary: function() {

-        this._testBinary(

-                new Crypto.mode.ECB,

-                Crypto.util.base64ToBytes(

-                    "yUZlGPJOWQph4RRsOFmHR546qH39QmZeuq43K33BZi8UbFitayceKoRm"+

-                    "97axGfeiQRYc/HlU9MrnEdN8cl4uRUy3MHJ805voCXoeQv9T/ZaxzXAd"+

-                    "nZ03OK77mpyv7Wy9W6a8CHCeBIGnj07qrESaWR44kW2pcFJ28mDiir27"+

-                    "bzVshm3SnIOWJ9RBe5AumeH9eqUHKDXT1bwyxozpXecnMhohbbzjMDU2"+

-                    "dd6x/HuFRlaYoSjrDWtGAZPs7LLY3yF7fxJCUBk6Wl5u0x4aEb214hwi"+

-                    "395zDrgT77vrtoGPa2TW9Zb6MrKaIQg4rqD0BZU3+A/EgEG+DCna2qel"+

-                    "1NaCLy3DyKTB6JxBf7gQGpTm238=") );

-	},

-	

-	

-	

-	test_ECB_Text: function() {

-        this._testText(

-                new Crypto.mode.ECB,

-                Crypto.util.base64ToBytes(

-                    "jvfZY1iDhmgOGK0buOrIusf3VMZo4y87nsDt8/FgQ7jl9M+q2ApiJLmU"+

-                    "GWrni27AeMS8+ybGV4+bly2XDaOHaYv1VajdhqIIEv/BbRSFM51XbUiO"+

-                    "Vo79FUXyT/NPZM/a/fX2ab5BpqMrcF7IPgB0nQKIJ5rmjQZSPBrs0j4/"+

-                    "XSvGoL1U19wNAXG2sAxtO2FG9SPksEaqp2VBIhMi84YCsUfBdHd5A/gt"+

-                    "dJSYWgGJqDoqdTXsHoAMWlptRpIwTybjx5F6FE/XSVrvHqCY4UI26B8h"+

-                    "70kTszxqfM7HAhhTE+byyIBePBENU422NoCVtmU6") );		

-	},

-

-	

-	test_CBC_Binary: function() {

-        this._testBinary(

-                new Crypto.mode.CBC,

-                Crypto.util.base64ToBytes(

-                    "lXl5aPuWvwLPhN7QVoT5/mTUv2qX3uRHYsrxJMGTQKyaZdPpWDnjtVE4"+

-                    "0lR7siBNhosWaI8EfzJPo2VFcUV6J8McVVKuLJJ8WqOcqum/vj11T+BW"+

-                    "b3Vsmp3S71GGPstOMCa0F5tiPqOlgPAhtMaNkJNxuue6xNfuuu/6DmTS"+

-                    "j2t5TPhJK2pEG2L1L7sHmLi1B8OWen2Hc6ksZqIk8D67COQVXDmYQatE"+

-                    "6SPsxvmyp73sZOkpoT5wnU6rw2N6rgYQgynOirMxa3WRet7xfqN9zGbT"+

-                    "As9Q2M7qpcv7o7IuKhfKkkQMpTy8ChtIvNanrQvP4ZwRBlm/yyvTO+L9"+

-                    "t0oNPte2f2NBSMS/OMMdEYhfQfY=") );

-

-	},

-	

-	

-	

-	test_CBC_Text: function() {

-        this._testText(

-                new Crypto.mode.CBC,

-                Crypto.util.base64ToBytes(

-                    "3v1DbHZux/qLXbOE/Nb72B4MJmn4zMQOhZdaG1V8tOZ0HeekF7Bcg0I0"+

-                    "s8bdeodgvD8DagMv2/1KnIVN/dhZbCkumnEqTNWJU8G/cAA1R/qx5Qoy"+

-                    "j5oOccF7O8H8xatoxWzrc6XDxcuJlQ/Rhcqkzun8/2RbFZtGilSGnT9C"+

-                    "IQsEghS7uZ7yibE0L8FH3OXWlD1GDFSWhVjStKv9XX4BqEpSvA0zQDrm"+

-                    "YVpC1jTqJKYer9la5Ob77VapjvQmMCPDucCNEX9BaglceQWmY/YBpFWO"+

-                    "Pz9NQXukur1yJPo1Hls09jsc7O3kf28yWFTIFdBD") );		

-	},

-

-	

-	

-	test_CFB_Binary: function() {

-		this._testBinary(

-				new Crypto.mode.CFB,

-				Crypto.util.base64ToBytes(

-                "XNgcJFiRBwRjMtq9xuo7M2zaTE+sg35rFR6Y3bhXMHcHJ6zZ+eEfWulxuGHE"+

-                "F+TbHNVfZ1ji5z/mAaJ6buO00lEpvSiyTuts0N8gOlX2a+zPSGrdQYr818UN"+

-                "Y91Q4cvrSm6zec/yiD1dnaEdXtHSm7I6CowH4f06cOd+GUx9WTlbKy4h+6/S"+

-                "ocMRqWV52VHxtm+//v2EaWGFLzTopZAzt2Ukzmhu16j2VUyloKvPVk/B4U0/"+

-                "LcpxDSFWMrD9W+0m0jXyijIckKc5COpUSfOGJPY2HrloboznaUZtiEsqK+1x"+

-                "J10M173whcV405Y9mz0aqdpIZuSIC4U7NblcMHlSfw==") );

-	},

-	

-	

-	

-	test_CFB_Text: function() {

-		this._testText(

-				new Crypto.mode.CFB,

-				Crypto.util.base64ToBytes(

-                "ELBgVCmSREUoePHQ9t41NaNH2/hyiMwonsFwnvYc9U2/SnfVfrDrMiirJFUq"+

-                "YFzW6h55BQzkNAgYjbkl8K2PJZXXBNSWAPT+EWtD5ICrLj8DyfPpke8Lw94g"+

-                "EIhI4KjWFFzRobaDjuN522bZiBxi77amx9YP4FtyZcOa0qrSi1QaOGnZBoZ1"+

-                "q82Sjr9J1RzjkJaPI738QFQaMjryIBf6dfCgZy8g5rIKuTvLVLSRh8o238va"+

-                "UKgzDjvDgj+dyKRXlQwQiNEa+Punh18HEpm/lWA+MldJL6eX8zf+ZKzpfEUF"+

-                "en4leIJgTQ==") );

-	},

-

-	

-	

-	test_OFB_Binary: function() {		

-		this._testBinary(

-				new Crypto.mode.OFB,

-				Crypto.util.base64ToBytes(

-                "XNgcJFiRBwRjMtq9xuo7M93fLgEI6C29RMqDedSzsxdbtVl+Tz+1dRfpPEm+"+

-                "usOMd1BRVrr6oSTsxb+8pJd5/HKomxCEYVXAsBsvzcgXc+YKzLomwPXtUa+s"+

-                "LJBgEKLzPSUI+2IVCRgVFQGgQz6oy5xmZwEEKw1ulETtHlcFFu2i3J7C5dM2"+

-                "c4iQI9JKKAwhWbmydff4NEzmchnME8mj6MCvO+ENEQ4dbw7fpU2PHv2CTP9a"+

-                "rm5e+kpCkN+csqMfrvEneTmtvg5GnAYbelwuT7vTN5D7D0/1a14P7y5J0ZUr"+

-                "TTkfgu0gGpC8aZvvDzLRINqsskJd5ecxvB2dssUCpw==") );

-	},

-	

-	

-	

-    test_CTR_Vectors: function () {

-        // www.ietf.org/rfc/rfc3686.txt

-

-        // Test Vector #1

-        var expected = Crypto.util.bytesToBase64([0xE4, 0x09, 0x5D, 0x4F, 0xB7, 0xA7, 0xB3, 0x79, 0x2D, 0x61, 0x75, 0xA3, 0x26, 0x13, 0x11, 0xB8]);

-        var actual = Crypto.AES.encrypt(

-            [0x53, 0x69, 0x6E, 0x67, 0x6C, 0x65, 0x20, 0x62, 0x6C, 0x6F, 0x63, 0x6B, 0x20, 0x6D, 0x73, 0x67],

-            [0xAE, 0x68, 0x52, 0xF8, 0x12, 0x10, 0x67, 0xCC, 0x4B, 0xF7, 0xA5, 0x76, 0x55, 0x77, 0xF3, 0x9E],

-            {

-                iv: [0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01],

-                mode: new Crypto.mode.CTR

-            }

-        );

-        Assert.areEqual(expected, actual);

-

-        // Test Vector #2

-        var expected = Crypto.util.bytesToBase64([0x51, 0x04, 0xA1, 0x06, 0x16, 0x8A, 0x72, 0xD9, 0x79, 0x0D, 0x41, 0xEE, 0x8E, 0xDA, 0xD3, 0x88, 0xEB, 0x2E, 0x1E, 0xFC, 0x46, 0xDA, 0x57, 0xC8, 0xFC, 0xE6, 0x30, 0xDF, 0x91, 0x41, 0xBE, 0x28]);

-        var actual = Crypto.AES.encrypt(

-            [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F],

-            [0x7E, 0x24, 0x06, 0x78, 0x17, 0xFA, 0xE0, 0xD7, 0x43, 0xD6, 0xCE, 0x1F, 0x32, 0x53, 0x91, 0x63],

-            {

-                iv: [0x00, 0x6C, 0xB6, 0xDB, 0xC0, 0x54, 0x3B, 0x59, 0xDA, 0x48, 0xD9, 0x0B, 0x00, 0x00, 0x00, 0x01],

-                mode: new Crypto.mode.CTR

-            }

-        );

-        Assert.areEqual(expected, actual);

-

-        // Test Vector #3

-        var expected = Crypto.util.bytesToBase64([0xC1, 0xCF, 0x48, 0xA8, 0x9F, 0x2F, 0xFD, 0xD9, 0xCF, 0x46, 0x52, 0xE9, 0xEF, 0xDB, 0x72, 0xD7, 0x45, 0x40, 0xA4, 0x2B, 0xDE, 0x6D, 0x78, 0x36, 0xD5, 0x9A, 0x5C, 0xEA, 0xAE, 0xF3, 0x10, 0x53, 0x25, 0xB2, 0x07, 0x2F]);

-        var actual = Crypto.AES.encrypt(

-            [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23],

-            [0x76, 0x91, 0xBE, 0x03, 0x5E, 0x50, 0x20, 0xA8, 0xAC, 0x6E, 0x61, 0x85, 0x29, 0xF9, 0xA0, 0xDC],

-            {

-                iv: [0x00, 0xE0, 0x01, 0x7B, 0x27, 0x77, 0x7F, 0x3F, 0x4A, 0x17, 0x86, 0xF0, 0x00, 0x00, 0x00, 0x01],

-                mode: new Crypto.mode.CTR

-            }

-        );

-        Assert.areEqual(expected, actual);

-

-        // Test Vector #4

-        var expected = Crypto.util.bytesToBase64([0x4B, 0x55, 0x38, 0x4F, 0xE2, 0x59, 0xC9, 0xC8, 0x4E, 0x79, 0x35, 0xA0, 0x03, 0xCB, 0xE9, 0x28]);

-        var actual = Crypto.AES.encrypt(

-            [0x53, 0x69, 0x6E, 0x67, 0x6C, 0x65, 0x20, 0x62, 0x6C, 0x6F, 0x63, 0x6B, 0x20, 0x6D, 0x73, 0x67],

-            [0x16, 0xAF, 0x5B, 0x14, 0x5F, 0xC9, 0xF5, 0x79, 0xC1, 0x75, 0xF9, 0x3E, 0x3B, 0xFB, 0x0E, 0xED, 0x86, 0x3D, 0x06, 0xCC, 0xFD, 0xB7, 0x85, 0x15],

-            {

-                iv: [0x00, 0x00, 0x00, 0x48, 0x36, 0x73, 0x3C, 0x14, 0x7D, 0x6D, 0x93, 0xCB, 0x00, 0x00, 0x00, 0x01],

-                mode: new Crypto.mode.CTR

-            }

-        );

-        Assert.areEqual(expected, actual);

-

-        // Test Vector #5

-        var expected = Crypto.util.bytesToBase64([0x45, 0x32, 0x43, 0xFC, 0x60, 0x9B, 0x23, 0x32, 0x7E, 0xDF, 0xAA, 0xFA, 0x71, 0x31, 0xCD, 0x9F, 0x84, 0x90, 0x70, 0x1C, 0x5A, 0xD4, 0xA7, 0x9C, 0xFC, 0x1F, 0xE0, 0xFF, 0x42, 0xF4, 0xFB, 0x00]);

-        var actual = Crypto.AES.encrypt(

-            [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F],

-            [0x7C, 0x5C, 0xB2, 0x40, 0x1B, 0x3D, 0xC3, 0x3C, 0x19, 0xE7, 0x34, 0x08, 0x19, 0xE0, 0xF6, 0x9C, 0x67, 0x8C, 0x3D, 0xB8, 0xE6, 0xF6, 0xA9, 0x1A],

-            {

-                iv: [0x00, 0x96, 0xB0, 0x3B, 0x02, 0x0C, 0x6E, 0xAD, 0xC2, 0xCB, 0x50, 0x0D, 0x00, 0x00, 0x00, 0x01],

-                mode: new Crypto.mode.CTR

-            }

-        );

-        Assert.areEqual(expected, actual);

-    },

-

-

-

-    test_OFB_Text: function() {

-		this._testText(

-				new Crypto.mode.OFB,

-				Crypto.util.base64ToBytes(

-                "ELBgVCmSREUoePHQ9t41Nd+II+3wW9ZxiREZ5HMXD73eMcPux0nNRG6ScxTj"+

-                "8uimTmloE7PlstFIalpEZByvKpIKPLAr79BVaJBMraxjI+9TlecK6M/TRam3"+

-                "epiQu1wL/+3UK/6zt+mppYsixaCKr+0WF0UIeVtGrX7abRM7ELRHNXk6WRH4"+

-                "4l1Gi3bz05itxyctHdfLXxinLg+fOPGFw9WsdfEJ9/bvnuUYfJBbshQn903e"+

-                "L/7L2y4s5K3K8OIGgN8aRUW7oF9fj+nnm678xm4cqTBW/PZ77tyWdkVioONl"+

-                "GXJby88eZQ==") );

-	},

-	

-	

-    test_ECB_iso7816_binary : function() {

-        this._testBinary(

-            new Crypto.mode.ECB(Crypto.pad.iso7816),

-            Crypto.util.base64ToBytes(

-                "yUZlGPJOWQph4RRsOFmHR546qH39QmZeuq43K33BZi8UbFitayceKoRm"+

-                "97axGfeiQRYc/HlU9MrnEdN8cl4uRUy3MHJ805voCXoeQv9T/ZaxzXAd"+

-                "nZ03OK77mpyv7Wy9W6a8CHCeBIGnj07qrESaWR44kW2pcFJ28mDiir27"+

-                "bzVshm3SnIOWJ9RBe5AumeH9eqUHKDXT1bwyxozpXecnMhohbbzjMDU2"+

-                "dd6x/HuFRlaYoSjrDWtGAZPs7LLY3yF7fxJCUBk6Wl5u0x4aEb214hwi"+

-                "395zDrgT77vrtoGPa2TW9Zb6MrKaIQg4rqD0BZU3+A/EgEG+DCna2qel"+

-                "1NaCLy3DyKTB6JxBf7gQGpTm238=") );

-    },

-

-

-

-    test_ECB_iso7816_text : function() {

-        this._testText(

-            new Crypto.mode.ECB(Crypto.pad.iso7816),

-            Crypto.util.base64ToBytes(

-                "jvfZY1iDhmgOGK0buOrIusf3VMZo4y87nsDt8/FgQ7jl9M+q2ApiJLmU"+

-                "GWrni27AeMS8+ybGV4+bly2XDaOHaYv1VajdhqIIEv/BbRSFM51XbUiO"+

-                "Vo79FUXyT/NPZM/a/fX2ab5BpqMrcF7IPgB0nQKIJ5rmjQZSPBrs0j4/"+

-                "XSvGoL1U19wNAXG2sAxtO2FG9SPksEaqp2VBIhMi84YCsUfBdHd5A/gt"+

-                "dJSYWgGJqDoqdTXsHoAMWlptRpIwTybjx5F6FE/XSVrvHqCY4UI26B8h"+

-                "70kTszxqfM7HAhhTE+byyIBePBENU422NoCVtmU6") );

-    },

-

-

-

-    test_ECB_ansix923_binary : function() {

-        this._testBinary(

-            new Crypto.mode.ECB(Crypto.pad.ansix923),

-            Crypto.util.base64ToBytes(

-                "yUZlGPJOWQph4RRsOFmHR546qH39QmZeuq43K33BZi8UbFitayceKoRm"+

-                "97axGfeiQRYc/HlU9MrnEdN8cl4uRUy3MHJ805voCXoeQv9T/ZaxzXAd"+

-                "nZ03OK77mpyv7Wy9W6a8CHCeBIGnj07qrESaWR44kW2pcFJ28mDiir27"+

-                "bzVshm3SnIOWJ9RBe5AumeH9eqUHKDXT1bwyxozpXecnMhohbbzjMDU2"+

-                "dd6x/HuFRlaYoSjrDWtGAZPs7LLY3yF7fxJCUBk6Wl5u0x4aEb214hwi"+

-                "395zDrgT77vrtoGPa2TW9Zb6MrKaIQg4rqD0BZU3+A/EgEG+DCna2qel"+

-                "1NaCL2AspFJ5G6riC4eVGErtZa8=") );

-    },

-

-

-

-    test_ECB_ansix923_text : function() {

-        this._testText(

-            new Crypto.mode.ECB(Crypto.pad.ansix923),

-            Crypto.util.base64ToBytes(

-                "jvfZY1iDhmgOGK0buOrIusf3VMZo4y87nsDt8/FgQ7jl9M+q2ApiJLmU"+

-                "GWrni27AeMS8+ybGV4+bly2XDaOHaYv1VajdhqIIEv/BbRSFM51XbUiO"+

-                "Vo79FUXyT/NPZM/a/fX2ab5BpqMrcF7IPgB0nQKIJ5rmjQZSPBrs0j4/"+

-                "XSvGoL1U19wNAXG2sAxtO2FG9SPksEaqp2VBIhMi84YCsUfBdHd5A/gt"+

-                "dJSYWgGJqDoqdTXsHoAMWlptRpIwTybjx5F6FE/XSVrvHqCY4UI26B8h"+

-                "70kTszxqfM7HAhhTE+bg0742mH7WeAWw7fsHu3To") );

-    },

-

-

-

-    test_ECB_iso10126_binary : function() {

-        this._testBinary(

-            new Crypto.mode.ECB(Crypto.pad.iso10126),

-            Crypto.util.base64ToBytes(

-                "yUZlGPJOWQph4RRsOFmHR546qH39QmZeuq43K33BZi8UbFitayceKoRm"+

-                "97axGfeiQRYc/HlU9MrnEdN8cl4uRUy3MHJ805voCXoeQv9T/ZaxzXAd"+

-                "nZ03OK77mpyv7Wy9W6a8CHCeBIGnj07qrESaWR44kW2pcFJ28mDiir27"+

-                "bzVshm3SnIOWJ9RBe5AumeH9eqUHKDXT1bwyxozpXecnMhohbbzjMDU2"+

-                "dd6x/HuFRlaYoSjrDWtGAZPs7LLY3yF7fxJCUBk6Wl5u0x4aEb214hwi"+

-                "395zDrgT77vrtoGPa2TW9Zb6MrKaIQg4rqD0BZU3+A/EgEG+DCna2qel"+

-                "1NaCL8bI0qmEAHQ3mAR8Vp6XAmA=") );

-    },

-

-

-

-    test_ECB_iso10126_text : function() {

-        this._testText(

-            new Crypto.mode.ECB(Crypto.pad.iso10126),

-            Crypto.util.base64ToBytes(

-                "jvfZY1iDhmgOGK0buOrIusf3VMZo4y87nsDt8/FgQ7jl9M+q2ApiJLmU"+

-                "GWrni27AeMS8+ybGV4+bly2XDaOHaYv1VajdhqIIEv/BbRSFM51XbUiO"+

-                "Vo79FUXyT/NPZM/a/fX2ab5BpqMrcF7IPgB0nQKIJ5rmjQZSPBrs0j4/"+

-                "XSvGoL1U19wNAXG2sAxtO2FG9SPksEaqp2VBIhMi84YCsUfBdHd5A/gt"+

-                "dJSYWgGJqDoqdTXsHoAMWlptRpIwTybjx5F6FE/XSVrvHqCY4UI26B8h"+

-                "70kTszxqfM7HAhhTE+bnzrAzPGejNp7/fbt/gLrl") );

-    },

-

-

-

-    test_ECB_pkcs7_binary : function() {

-        this._testBinary(

-            new Crypto.mode.ECB(Crypto.pad.pkcs7),

-            Crypto.util.base64ToBytes(

-                "yUZlGPJOWQph4RRsOFmHR546qH39QmZeuq43K33BZi8UbFitayceKoRm"+

-                "97axGfeiQRYc/HlU9MrnEdN8cl4uRUy3MHJ805voCXoeQv9T/ZaxzXAd"+

-                "nZ03OK77mpyv7Wy9W6a8CHCeBIGnj07qrESaWR44kW2pcFJ28mDiir27"+

-                "bzVshm3SnIOWJ9RBe5AumeH9eqUHKDXT1bwyxozpXecnMhohbbzjMDU2"+

-                "dd6x/HuFRlaYoSjrDWtGAZPs7LLY3yF7fxJCUBk6Wl5u0x4aEb214hwi"+

-                "395zDrgT77vrtoGPa2TW9Zb6MrKaIQg4rqD0BZU3+A/EgEG+DCna2qel"+

-                "1NaCLyXrw4AOGYlhBfkzMl8tQUY=") );

-    },

-

-

-

-    test_ECB_pkcs7_text : function() {

-        this._testText(

-            new Crypto.mode.ECB(Crypto.pad.pkcs7),

-            Crypto.util.base64ToBytes(

-                "jvfZY1iDhmgOGK0buOrIusf3VMZo4y87nsDt8/FgQ7jl9M+q2ApiJLmU"+

-                "GWrni27AeMS8+ybGV4+bly2XDaOHaYv1VajdhqIIEv/BbRSFM51XbUiO"+

-                "Vo79FUXyT/NPZM/a/fX2ab5BpqMrcF7IPgB0nQKIJ5rmjQZSPBrs0j4/"+

-                "XSvGoL1U19wNAXG2sAxtO2FG9SPksEaqp2VBIhMi84YCsUfBdHd5A/gt"+

-                "dJSYWgGJqDoqdTXsHoAMWlptRpIwTybjx5F6FE/XSVrvHqCY4UI26B8h"+

-                "70kTszxqfM7HAhhTE+bl00Ia4EScRG95FeQKaYr3") );

-    },

-

-

-

-    test_CBC_iso7816_binary : function() {

-        this._testBinary(

-            new Crypto.mode.CBC(Crypto.pad.iso7816),

-            Crypto.util.base64ToBytes(

-                "lXl5aPuWvwLPhN7QVoT5/mTUv2qX3uRHYsrxJMGTQKyaZdPpWDnjtVE4"+

-                "0lR7siBNhosWaI8EfzJPo2VFcUV6J8McVVKuLJJ8WqOcqum/vj11T+BW"+

-                "b3Vsmp3S71GGPstOMCa0F5tiPqOlgPAhtMaNkJNxuue6xNfuuu/6DmTS"+

-                "j2t5TPhJK2pEG2L1L7sHmLi1B8OWen2Hc6ksZqIk8D67COQVXDmYQatE"+

-                "6SPsxvmyp73sZOkpoT5wnU6rw2N6rgYQgynOirMxa3WRet7xfqN9zGbT"+

-                "As9Q2M7qpcv7o7IuKhfKkkQMpTy8ChtIvNanrQvP4ZwRBlm/yyvTO+L9"+

-                "t0oNPte2f2NBSMS/OMMdEYhfQfY=") );

-    },

-

-

-

-    test_CBC_iso7816_text : function() {

-        this._testText(

-            new Crypto.mode.CBC(Crypto.pad.iso7816),

-            Crypto.util.base64ToBytes(

-                "3v1DbHZux/qLXbOE/Nb72B4MJmn4zMQOhZdaG1V8tOZ0HeekF7Bcg0I0"+

-                "s8bdeodgvD8DagMv2/1KnIVN/dhZbCkumnEqTNWJU8G/cAA1R/qx5Qoy"+

-                "j5oOccF7O8H8xatoxWzrc6XDxcuJlQ/Rhcqkzun8/2RbFZtGilSGnT9C"+

-                "IQsEghS7uZ7yibE0L8FH3OXWlD1GDFSWhVjStKv9XX4BqEpSvA0zQDrm"+

-                "YVpC1jTqJKYer9la5Ob77VapjvQmMCPDucCNEX9BaglceQWmY/YBpFWO"+

-                "Pz9NQXukur1yJPo1Hls09jsc7O3kf28yWFTIFdBD") );

-    },

-

-

-

-    test_CBC_ansix923_binary : function() {

-        this._testBinary(

-            new Crypto.mode.CBC(Crypto.pad.ansix923),

-            Crypto.util.base64ToBytes(

-                "lXl5aPuWvwLPhN7QVoT5/mTUv2qX3uRHYsrxJMGTQKyaZdPpWDnjtVE4"+

-                "0lR7siBNhosWaI8EfzJPo2VFcUV6J8McVVKuLJJ8WqOcqum/vj11T+BW"+

-                "b3Vsmp3S71GGPstOMCa0F5tiPqOlgPAhtMaNkJNxuue6xNfuuu/6DmTS"+

-                "j2t5TPhJK2pEG2L1L7sHmLi1B8OWen2Hc6ksZqIk8D67COQVXDmYQatE"+

-                "6SPsxvmyp73sZOkpoT5wnU6rw2N6rgYQgynOirMxa3WRet7xfqN9zGbT"+

-                "As9Q2M7qpcv7o7IuKhfKkkQMpTy8ChtIvNanrQvP4ZwRBlm/yyvTO+L9"+

-                "t0oNPrsX6uVdhhNtxWrVrIfHkTY=") );

-    },

-

-

-

-    test_CBC_ansix923_text : function() {

-        this._testText(

-            new Crypto.mode.CBC(Crypto.pad.ansix923),

-            Crypto.util.base64ToBytes(

-                "3v1DbHZux/qLXbOE/Nb72B4MJmn4zMQOhZdaG1V8tOZ0HeekF7Bcg0I0"+

-                "s8bdeodgvD8DagMv2/1KnIVN/dhZbCkumnEqTNWJU8G/cAA1R/qx5Qoy"+

-                "j5oOccF7O8H8xatoxWzrc6XDxcuJlQ/Rhcqkzun8/2RbFZtGilSGnT9C"+

-                "IQsEghS7uZ7yibE0L8FH3OXWlD1GDFSWhVjStKv9XX4BqEpSvA0zQDrm"+

-                "YVpC1jTqJKYer9la5Ob77VapjvQmMCPDucCNEX9BaglceQWmY/YBpFWO"+

-                "Pz9NQXukur1yJPo1HlvrITcIpDKL6knedsHHr83A") );

-    },

-

-

-

-    test_CBC_iso10126_binary : function() {

-        this._testBinary(

-            new Crypto.mode.CBC(Crypto.pad.iso10126),

-            Crypto.util.base64ToBytes(

-                "lXl5aPuWvwLPhN7QVoT5/mTUv2qX3uRHYsrxJMGTQKyaZdPpWDnjtVE4"+

-                "0lR7siBNhosWaI8EfzJPo2VFcUV6J8McVVKuLJJ8WqOcqum/vj11T+BW"+

-                "b3Vsmp3S71GGPstOMCa0F5tiPqOlgPAhtMaNkJNxuue6xNfuuu/6DmTS"+

-                "j2t5TPhJK2pEG2L1L7sHmLi1B8OWen2Hc6ksZqIk8D67COQVXDmYQatE"+

-                "6SPsxvmyp73sZOkpoT5wnU6rw2N6rgYQgynOirMxa3WRet7xfqN9zGbT"+

-                "As9Q2M7qpcv7o7IuKhfKkkQMpTy8ChtIvNanrQvP4ZwRBlm/yyvTO+L9"+

-                "t0oNPtHUI5LSnRlyMX26SWGYRHk=") );

-    },

-

-

-

-    test_CBC_iso10126_text : function() {

-        this._testText(

-            new Crypto.mode.CBC(Crypto.pad.iso10126),

-            Crypto.util.base64ToBytes(

-                "3v1DbHZux/qLXbOE/Nb72B4MJmn4zMQOhZdaG1V8tOZ0HeekF7Bcg0I0"+

-                "s8bdeodgvD8DagMv2/1KnIVN/dhZbCkumnEqTNWJU8G/cAA1R/qx5Qoy"+

-                "j5oOccF7O8H8xatoxWzrc6XDxcuJlQ/Rhcqkzun8/2RbFZtGilSGnT9C"+

-                "IQsEghS7uZ7yibE0L8FH3OXWlD1GDFSWhVjStKv9XX4BqEpSvA0zQDrm"+

-                "YVpC1jTqJKYer9la5Ob77VapjvQmMCPDucCNEX9BaglceQWmY/YBpFWO"+

-                "Pz9NQXukur1yJPo1Hlv4wvpqACZyr2T9phBEV7pn") );

-    },

-

-

-

-    test_CBC_pkcs7_binary : function() {

-        this._testBinary(

-            new Crypto.mode.CBC(Crypto.pad.pkcs7),

-            Crypto.util.base64ToBytes(

-                "lXl5aPuWvwLPhN7QVoT5/mTUv2qX3uRHYsrxJMGTQKyaZdPpWDnjtVE4"+

-                "0lR7siBNhosWaI8EfzJPo2VFcUV6J8McVVKuLJJ8WqOcqum/vj11T+BW"+

-                "b3Vsmp3S71GGPstOMCa0F5tiPqOlgPAhtMaNkJNxuue6xNfuuu/6DmTS"+

-                "j2t5TPhJK2pEG2L1L7sHmLi1B8OWen2Hc6ksZqIk8D67COQVXDmYQatE"+

-                "6SPsxvmyp73sZOkpoT5wnU6rw2N6rgYQgynOirMxa3WRet7xfqN9zGbT"+

-                "As9Q2M7qpcv7o7IuKhfKkkQMpTy8ChtIvNanrQvP4ZwRBlm/yyvTO+L9"+

-                "t0oNPiagnPydLr+0HZr/kJ4W2f4=") );

-    },

-

-

-

-    test_CBC_pkcs7_text : function() {

-        this._testText(

-            new Crypto.mode.CBC(Crypto.pad.pkcs7),

-            Crypto.util.base64ToBytes(

-                "3v1DbHZux/qLXbOE/Nb72B4MJmn4zMQOhZdaG1V8tOZ0HeekF7Bcg0I0"+

-                "s8bdeodgvD8DagMv2/1KnIVN/dhZbCkumnEqTNWJU8G/cAA1R/qx5Qoy"+

-                "j5oOccF7O8H8xatoxWzrc6XDxcuJlQ/Rhcqkzun8/2RbFZtGilSGnT9C"+

-                "IQsEghS7uZ7yibE0L8FH3OXWlD1GDFSWhVjStKv9XX4BqEpSvA0zQDrm"+

-                "YVpC1jTqJKYer9la5Ob77VapjvQmMCPDucCNEX9BaglceQWmY/YBpFWO"+

-                "Pz9NQXukur1yJPo1HlvCYzUn8VxivHDm+AVJLX9n") );

-    },

-

-

-

-    test_CFB_iso7816_binary : function() {

-        this._testBinary(

-            new Crypto.mode.CFB(Crypto.pad.iso7816),

-            Crypto.util.base64ToBytes(

-                "XNgcJFiRBwRjMtq9xuo7M2zaTE+sg35rFR6Y3bhXMHcHJ6zZ+eEfWulx"+

-                "uGHEF+TbHNVfZ1ji5z/mAaJ6buO00lEpvSiyTuts0N8gOlX2a+zPSGrd"+

-                "QYr818UNY91Q4cvrSm6zec/yiD1dnaEdXtHSm7I6CowH4f06cOd+GUx9"+

-                "WTlbKy4h+6/SocMRqWV52VHxtm+//v2EaWGFLzTopZAzt2Ukzmhu16j2"+

-                "VUyloKvPVk/B4U0/LcpxDSFWMrD9W+0m0jXyijIckKc5COpUSfOGJPY2"+

-                "HrloboznaUZtiEsqK+1xJ10M173whcV405Y9mz0aqdpIZuSIC4U7Nblc"+

-                "MHlSf/06MLOgYvi0Kii3OF7uiwU=") );

-    },

-

-

-

-    test_CFB_iso7816_text : function() {

-        this._testText(

-            new Crypto.mode.CFB(Crypto.pad.iso7816),

-            Crypto.util.base64ToBytes(

-                "ELBgVCmSREUoePHQ9t41NaNH2/hyiMwonsFwnvYc9U2/SnfVfrDrMiir"+

-                "JFUqYFzW6h55BQzkNAgYjbkl8K2PJZXXBNSWAPT+EWtD5ICrLj8DyfPp"+

-                "ke8Lw94gEIhI4KjWFFzRobaDjuN522bZiBxi77amx9YP4FtyZcOa0qrS"+

-                "i1QaOGnZBoZ1q82Sjr9J1RzjkJaPI738QFQaMjryIBf6dfCgZy8g5rIK"+

-                "uTvLVLSRh8o238vaUKgzDjvDgj+dyKRXlQwQiNEa+Punh18HEpm/lWA+"+

-                "MldJL6eX8zf+ZKzpfEUFen4leIJgTS3RPjhwu0sX") );

-    },

-

-

-

-    test_CFB_ansix923_binary : function() {

-        this._testBinary(

-            new Crypto.mode.CFB(Crypto.pad.ansix923),

-            Crypto.util.base64ToBytes(

-                "XNgcJFiRBwRjMtq9xuo7M2zaTE+sg35rFR6Y3bhXMHcHJ6zZ+eEfWulx"+

-                "uGHEF+TbHNVfZ1ji5z/mAaJ6buO00lEpvSiyTuts0N8gOlX2a+zPSGrd"+

-                "QYr818UNY91Q4cvrSm6zec/yiD1dnaEdXtHSm7I6CowH4f06cOd+GUx9"+

-                "WTlbKy4h+6/SocMRqWV52VHxtm+//v2EaWGFLzTopZAzt2Ukzmhu16j2"+

-                "VUyloKvPVk/B4U0/LcpxDSFWMrD9W+0m0jXyijIckKc5COpUSfOGJPY2"+

-                "HrloboznaUZtiEsqK+1xJ10M173whcV405Y9mz0aqdpIZuSIC4U7Nblc"+

-                "MHlSf306MLOgYvi0Kii3OF7uixU=") );

-    },

-

-

-

-    test_CFB_ansix923_text : function() {

-        this._testText(

-            new Crypto.mode.CFB(Crypto.pad.ansix923),

-            Crypto.util.base64ToBytes(

-                "ELBgVCmSREUoePHQ9t41NaNH2/hyiMwonsFwnvYc9U2/SnfVfrDrMiir"+

-                "JFUqYFzW6h55BQzkNAgYjbkl8K2PJZXXBNSWAPT+EWtD5ICrLj8DyfPp"+

-                "ke8Lw94gEIhI4KjWFFzRobaDjuN522bZiBxi77amx9YP4FtyZcOa0qrS"+

-                "i1QaOGnZBoZ1q82Sjr9J1RzjkJaPI738QFQaMjryIBf6dfCgZy8g5rIK"+

-                "uTvLVLSRh8o238vaUKgzDjvDgj+dyKRXlQwQiNEa+Punh18HEpm/lWA+"+

-                "MldJL6eX8zf+ZKzpfEUFen4leIJgTa3RPjhwu0sf") );

-    },

-

-

-

-    test_CFB_iso10126_binary : function() {

-        this._testBinary(

-            new Crypto.mode.CFB(Crypto.pad.iso10126),

-            Crypto.util.base64ToBytes(

-                "XNgcJFiRBwRjMtq9xuo7M2zaTE+sg35rFR6Y3bhXMHcHJ6zZ+eEfWulx"+

-                "uGHEF+TbHNVfZ1ji5z/mAaJ6buO00lEpvSiyTuts0N8gOlX2a+zPSGrd"+

-                "QYr818UNY91Q4cvrSm6zec/yiD1dnaEdXtHSm7I6CowH4f06cOd+GUx9"+

-                "WTlbKy4h+6/SocMRqWV52VHxtm+//v2EaWGFLzTopZAzt2Ukzmhu16j2"+

-                "VUyloKvPVk/B4U0/LcpxDSFWMrD9W+0m0jXyijIckKc5COpUSfOGJPY2"+

-                "HrloboznaUZtiEsqK+1xJ10M173whcV405Y9mz0aqdpIZuSIC4U7Nblc"+

-                "MHlSfwaqFmH/6DOHdZd6VIBmyBU=") );

-    },

-

-

-

-    test_CFB_iso10126_text : function() {

-        this._testText(

-            new Crypto.mode.CFB(Crypto.pad.iso10126),

-            Crypto.util.base64ToBytes(

-                "ELBgVCmSREUoePHQ9t41NaNH2/hyiMwonsFwnvYc9U2/SnfVfrDrMiir"+

-                "JFUqYFzW6h55BQzkNAgYjbkl8K2PJZXXBNSWAPT+EWtD5ICrLj8DyfPp"+

-                "ke8Lw94gEIhI4KjWFFzRobaDjuN522bZiBxi77amx9YP4FtyZcOa0qrS"+

-                "i1QaOGnZBoZ1q82Sjr9J1RzjkJaPI738QFQaMjryIBf6dfCgZy8g5rIK"+

-                "uTvLVLSRh8o238vaUKgzDjvDgj+dyKRXlQwQiNEa+Punh18HEpm/lWA+"+

-                "MldJL6eX8zf+ZKzpfEUFen4leIJgTX5rHZBXGQQf") );

-    },

-

-

-

-    test_CFB_pkcs7_binary : function() {

-        this._testBinary(

-            new Crypto.mode.CFB(Crypto.pad.pkcs7),

-            Crypto.util.base64ToBytes(

-                "XNgcJFiRBwRjMtq9xuo7M2zaTE+sg35rFR6Y3bhXMHcHJ6zZ+eEfWulx"+

-                "uGHEF+TbHNVfZ1ji5z/mAaJ6buO00lEpvSiyTuts0N8gOlX2a+zPSGrd"+

-                "QYr818UNY91Q4cvrSm6zec/yiD1dnaEdXtHSm7I6CowH4f06cOd+GUx9"+

-                "WTlbKy4h+6/SocMRqWV52VHxtm+//v2EaWGFLzTopZAzt2Ukzmhu16j2"+

-                "VUyloKvPVk/B4U0/LcpxDSFWMrD9W+0m0jXyijIckKc5COpUSfOGJPY2"+

-                "HrloboznaUZtiEsqK+1xJ10M173whcV405Y9mz0aqdpIZuSIC4U7Nblc"+

-                "MHlSf20qIKOwcuikOjinKE7+mxU=") );

-    },

-

-

-

-    test_CFB_pkcs7_text : function() {

-        this._testText(

-            new Crypto.mode.CFB(Crypto.pad.pkcs7),

-            Crypto.util.base64ToBytes(

-                "ELBgVCmSREUoePHQ9t41NaNH2/hyiMwonsFwnvYc9U2/SnfVfrDrMiir"+

-                "JFUqYFzW6h55BQzkNAgYjbkl8K2PJZXXBNSWAPT+EWtD5ICrLj8DyfPp"+

-                "ke8Lw94gEIhI4KjWFFzRobaDjuN522bZiBxi77amx9YP4FtyZcOa0qrS"+

-                "i1QaOGnZBoZ1q82Sjr9J1RzjkJaPI738QFQaMjryIBf6dfCgZy8g5rIK"+

-                "uTvLVLSRh8o238vaUKgzDjvDgj+dyKRXlQwQiNEa+Punh18HEpm/lWA+"+

-                "MldJL6eX8zf+ZKzpfEUFen4leIJgTaXZNjB4s0Mf") );

-    },

-

-

-

-    test_OFB_iso7816_binary : function() {

-        this._testBinary(

-            new Crypto.mode.OFB(Crypto.pad.iso7816),

-            Crypto.util.base64ToBytes(

-                "XNgcJFiRBwRjMtq9xuo7M93fLgEI6C29RMqDedSzsxdbtVl+Tz+1dRfp"+

-                "PEm+usOMd1BRVrr6oSTsxb+8pJd5/HKomxCEYVXAsBsvzcgXc+YKzLom"+

-                "wPXtUa+sLJBgEKLzPSUI+2IVCRgVFQGgQz6oy5xmZwEEKw1ulETtHlcF"+

-                "Fu2i3J7C5dM2c4iQI9JKKAwhWbmydff4NEzmchnME8mj6MCvO+ENEQ4d"+

-                "bw7fpU2PHv2CTP9arm5e+kpCkN+csqMfrvEneTmtvg5GnAYbelwuT7vT"+

-                "N5D7D0/1a14P7y5J0ZUrTTkfgu0gGpC8aZvvDzLRINqsskJd5ecxvB2d"+

-                "ssUCp6jbjN3K8KBBn2MMfrnOhaU=") );

-    },

-

-

-

-    test_OFB_iso7816_text : function() {

-        this._testText(

-            new Crypto.mode.OFB(Crypto.pad.iso7816),

-            Crypto.util.base64ToBytes(

-                "ELBgVCmSREUoePHQ9t41Nd+II+3wW9ZxiREZ5HMXD73eMcPux0nNRG6S"+

-                "cxTj8uimTmloE7PlstFIalpEZByvKpIKPLAr79BVaJBMraxjI+9TlecK"+

-                "6M/TRam3epiQu1wL/+3UK/6zt+mppYsixaCKr+0WF0UIeVtGrX7abRM7"+

-                "ELRHNXk6WRH44l1Gi3bz05itxyctHdfLXxinLg+fOPGFw9WsdfEJ9/bv"+

-                "nuUYfJBbshQn903eL/7L2y4s5K3K8OIGgN8aRUW7oF9fj+nnm678xm4c"+

-                "qTBW/PZ77tyWdkVioONlGXJby88eZUjjD/abdLBY") );

-    },

-

-

-

-    test_OFB_ansix923_binary : function() {

-        this._testBinary(

-            new Crypto.mode.OFB(Crypto.pad.ansix923),

-            Crypto.util.base64ToBytes(

-                "XNgcJFiRBwRjMtq9xuo7M93fLgEI6C29RMqDedSzsxdbtVl+Tz+1dRfp"+

-                "PEm+usOMd1BRVrr6oSTsxb+8pJd5/HKomxCEYVXAsBsvzcgXc+YKzLom"+

-                "wPXtUa+sLJBgEKLzPSUI+2IVCRgVFQGgQz6oy5xmZwEEKw1ulETtHlcF"+

-                "Fu2i3J7C5dM2c4iQI9JKKAwhWbmydff4NEzmchnME8mj6MCvO+ENEQ4d"+

-                "bw7fpU2PHv2CTP9arm5e+kpCkN+csqMfrvEneTmtvg5GnAYbelwuT7vT"+

-                "N5D7D0/1a14P7y5J0ZUrTTkfgu0gGpC8aZvvDzLRINqsskJd5ecxvB2d"+

-                "ssUCpyjbjN3K8KBBn2MMfrnOhbU=") );

-    },

-

-

-

-    test_OFB_ansix923_text : function() {

-        this._testText(

-            new Crypto.mode.OFB(Crypto.pad.ansix923),

-            Crypto.util.base64ToBytes(

-                "ELBgVCmSREUoePHQ9t41Nd+II+3wW9ZxiREZ5HMXD73eMcPux0nNRG6S"+

-                "cxTj8uimTmloE7PlstFIalpEZByvKpIKPLAr79BVaJBMraxjI+9TlecK"+

-                "6M/TRam3epiQu1wL/+3UK/6zt+mppYsixaCKr+0WF0UIeVtGrX7abRM7"+

-                "ELRHNXk6WRH44l1Gi3bz05itxyctHdfLXxinLg+fOPGFw9WsdfEJ9/bv"+

-                "nuUYfJBbshQn903eL/7L2y4s5K3K8OIGgN8aRUW7oF9fj+nnm678xm4c"+

-                "qTBW/PZ77tyWdkVioONlGXJby88eZcjjD/abdLBQ") );

-    },

-

-

-

-    test_OFB_iso10126_binary : function() {

-        this._testBinary(

-            new Crypto.mode.OFB(Crypto.pad.iso10126),

-            Crypto.util.base64ToBytes(

-                "XNgcJFiRBwRjMtq9xuo7M93fLgEI6C29RMqDedSzsxdbtVl+Tz+1dRfp"+

-                "PEm+usOMd1BRVrr6oSTsxb+8pJd5/HKomxCEYVXAsBsvzcgXc+YKzLom"+

-                "wPXtUa+sLJBgEKLzPSUI+2IVCRgVFQGgQz6oy5xmZwEEKw1ulETtHlcF"+

-                "Fu2i3J7C5dM2c4iQI9JKKAwhWbmydff4NEzmchnME8mj6MCvO+ENEQ4d"+

-                "bw7fpU2PHv2CTP9arm5e+kpCkN+csqMfrvEneTmtvg5GnAYbelwuT7vT"+

-                "N5D7D0/1a14P7y5J0ZUrTTkfgu0gGpC8aZvvDzLRINqsskJd5ecxvB2d"+

-                "ssUCpy8MLiU0YuSyUQZR7SM0abU=") );

-    },

-

-

-

-    test_OFB_iso10126_text : function() {

-        this._testText(

-            new Crypto.mode.OFB(Crypto.pad.iso10126),

-            Crypto.util.base64ToBytes(

-                "ELBgVCmSREUoePHQ9t41Nd+II+3wW9ZxiREZ5HMXD73eMcPux0nNRG6S"+

-                "cxTj8uimTmloE7PlstFIalpEZByvKpIKPLAr79BVaJBMraxjI+9TlecK"+

-                "6M/TRam3epiQu1wL/+3UK/6zt+mppYsixaCKr+0WF0UIeVtGrX7abRM7"+

-                "ELRHNXk6WRH44l1Gi3bz05itxyctHdfLXxinLg+fOPGFw9WsdfEJ9/bv"+

-                "nuUYfJBbshQn903eL/7L2y4s5K3K8OIGgN8aRUW7oF9fj+nnm678xm4c"+

-                "qTBW/PZ77tyWdkVioONlGXJby88eZQVh+O4Z3udQ") );

-    },

-

-

-

-    test_OFB_pkcs7_binary : function() {

-        this._testBinary(

-            new Crypto.mode.OFB(Crypto.pad.pkcs7),

-            Crypto.util.base64ToBytes(

-                "XNgcJFiRBwRjMtq9xuo7M93fLgEI6C29RMqDedSzsxdbtVl+Tz+1dRfp"+

-                "PEm+usOMd1BRVrr6oSTsxb+8pJd5/HKomxCEYVXAsBsvzcgXc+YKzLom"+

-                "wPXtUa+sLJBgEKLzPSUI+2IVCRgVFQGgQz6oy5xmZwEEKw1ulETtHlcF"+

-                "Fu2i3J7C5dM2c4iQI9JKKAwhWbmydff4NEzmchnME8mj6MCvO+ENEQ4d"+

-                "bw7fpU2PHv2CTP9arm5e+kpCkN+csqMfrvEneTmtvg5GnAYbelwuT7vT"+

-                "N5D7D0/1a14P7y5J0ZUrTTkfgu0gGpC8aZvvDzLRINqsskJd5ecxvB2d"+

-                "ssUCpzjLnM3a4LBRj3McbqnelbU=") );

-    },

-

-

-

-    test_OFB_pkcs7_text : function() {

-        this._testText(

-            new Crypto.mode.OFB(Crypto.pad.pkcs7),

-            Crypto.util.base64ToBytes(

-                "ELBgVCmSREUoePHQ9t41Nd+II+3wW9ZxiREZ5HMXD73eMcPux0nNRG6S"+

-                "cxTj8uimTmloE7PlstFIalpEZByvKpIKPLAr79BVaJBMraxjI+9TlecK"+

-                "6M/TRam3epiQu1wL/+3UK/6zt+mppYsixaCKr+0WF0UIeVtGrX7abRM7"+

-                "ELRHNXk6WRH44l1Gi3bz05itxyctHdfLXxinLg+fOPGFw9WsdfEJ9/bv"+

-                "nuUYfJBbshQn903eL/7L2y4s5K3K8OIGgN8aRUW7oF9fj+nnm678xm4c"+

-                "qTBW/PZ77tyWdkVioONlGXJby88eZcDrB/6TfLhQ") );

-    }

-}));
\ No newline at end of file
diff --git a/crypto-js/test/PBKDF2-profile.html b/crypto-js/test/PBKDF2-profile.html
deleted file mode 100644
index 99f79e3..0000000
--- a/crypto-js/test/PBKDF2-profile.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

-<head>

-

-<!-- Profiler -->

-<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/yuiloader-dom-event/yuiloader-dom-event.js"></script>

-<script type="text/javascript" src="lib/Profiler.js"></script>

-

-<!-- Test subject -->

-<script type="text/javascript" src="../src/Crypto.js"></script>

-<script type="text/javascript" src="../src/SHA1.js"></script>

-<script type="text/javascript" src="../src/HMAC.js"></script>

-<script type="text/javascript" src="../src/PBKDF2.js"></script>

-

-<!-- Profiling -->

-<script type="text/javascript">

-

-profile(["Crypto.PBKDF2", "Crypto.HMAC", "Crypto.SHA1", "Crypto.util", "Crypto"], function(){

-	Crypto.PBKDF2("password", "\x01\x23\x45\x67", 512/8);

-});

-

-</script>

-

-</head>

-<body class="yui-skin-sam">

-</body>

diff --git a/crypto-js/test/PBKDF2-progress-demo.html b/crypto-js/test/PBKDF2-progress-demo.html
deleted file mode 100644
index 5ae7190..0000000
--- a/crypto-js/test/PBKDF2-progress-demo.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE html>

-<html>

-    <head>

-        <!-- YUI CSS -->

-        <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.8.2r1/build/progressbar/assets/skins/sam/progressbar.css">

-

-        <!-- YUI JS -->

-        <script type="text/javascript" src="http://yui.yahooapis.com/combo?2.8.2r1/build/yahoo-dom-event/yahoo-dom-event.js&2.8.2r1/build/element/element-min.js&2.8.2r1/build/progressbar/progressbar-min.js"></script>

-

-        <!-- CryptoJS -->

-        <script type="text/javascript" src="../src/Crypto.js"></script>

-        <script type="text/javascript" src="../src/SHA1.js"></script>

-        <script type="text/javascript" src="../src/HMAC.js"></script>

-        <script type="text/javascript" src="../src/PBKDF2.js"></script>

-        <script type="text/javascript" src="../src/PBKDF2Async.js"></script>

-

-        <!-- Demo -->

-        <script type="text/javascript">

-            (function (Y) {

-                Y.util.Event.onDOMReady(function () {

-                    var progressBar = new Y.widget.ProgressBar();

-                    progressBar.render('pbkdf2async-progress');

-                    Crypto.PBKDF2Async(

-                        "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",

-                        "pass phrase exceeds block size",

-                        256/8,

-                        function (key) {

-                            Y.util.Dom.get('pbkdf2async-key').innerHTML = key;

-                        },

-                        {

-                            iterations: 1200,

-                            onProgressChange: function (percent) {

-                                progressBar.set('value', percent);

-                            }

-                        }

-                    );

-                });

-            }(YAHOO));

-        </script>

-    </head>

-    <body class="yui-skin-sam">

-        <p>Password: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br>

-           Salt: pass phrase exceeds block size<br>

-           Key length: 256 bits<br>

-           Iterations: 1200</p>

-        <p id="pbkdf2async-progress"></p>

-        <p id="pbkdf2async-key"></p>

-    </body>

-</html>

diff --git a/crypto-js/test/PBKDF2-test.js b/crypto-js/test/PBKDF2-test.js
deleted file mode 100644
index 2558449..0000000
--- a/crypto-js/test/PBKDF2-test.js
+++ /dev/null
@@ -1,32 +0,0 @@
-TestSuite.add(new YAHOO.tool.TestCase({

-

-	test_PBKDF2: function () {

-		Assert.areEqual("cdedb5281bb2f801565a1122b2563515", Crypto.PBKDF2("password", "ATHENA.MIT.EDUraeburn", 128/8));

-		Assert.areEqual("cdedb5281bb2f801565a1122b25635150ad1f7a04bb9f3a333ecc0e2e1f70837", Crypto.PBKDF2("password", "ATHENA.MIT.EDUraeburn", 256/8));

-		Assert.areEqual("01dbee7f4a9e243e988b62c73cda935d", Crypto.PBKDF2("password", "ATHENA.MIT.EDUraeburn", 128/8, { iterations: 2 }));

-		Assert.areEqual("01dbee7f4a9e243e988b62c73cda935da05378b93244ec8f48a99e61ad799d86", Crypto.PBKDF2("password", "ATHENA.MIT.EDUraeburn", 256/8, { iterations: 2 }));

-		Assert.areEqual("5c08eb61fdf71e4e4ec3cf6ba1f5512b", Crypto.PBKDF2("password", "ATHENA.MIT.EDUraeburn", 128/8, { iterations: 1200 }));

-		Assert.areEqual("5c08eb61fdf71e4e4ec3cf6ba1f5512ba7e52ddbc5e5142f708a31e2e62b1e13", Crypto.PBKDF2("password", "ATHENA.MIT.EDUraeburn", 256/8, { iterations: 1200 }));

-		Assert.areEqual("d1daa78615f287e6a1c8b120d7062a49", Crypto.PBKDF2("password", "\x12\x34\x56\x78\x78\x56\x34\x12", 128/8, { iterations: 5 }));

-		Assert.areEqual("d1daa78615f287e6a1c8b120d7062a493f98d203e6be49a6adf4fa574b6e64ee", Crypto.PBKDF2("password", "\x12\x34\x56\x78\x78\x56\x34\x12", 256/8, { iterations: 5 }));

-		Assert.areEqual("139c30c0966bc32ba55fdbf212530ac9", Crypto.PBKDF2("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "pass phrase equals block size", 128/8, { iterations: 1200 }));

-		Assert.areEqual("139c30c0966bc32ba55fdbf212530ac9c5ec59f1a452f5cc9ad940fea0598ed1", Crypto.PBKDF2("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "pass phrase equals block size", 256/8, { iterations: 1200 }));

-		Assert.areEqual("9ccad6d468770cd51b10e6a68721be61", Crypto.PBKDF2("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "pass phrase exceeds block size", 128/8, { iterations: 1200 }));

-		Assert.areEqual("9ccad6d468770cd51b10e6a68721be611a8b4d282601db3b36be9246915ec82a", Crypto.PBKDF2("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "pass phrase exceeds block size", 256/8, { iterations: 1200 }));

-		Assert.areEqual("6b9cf26d45455a43a5b8bb276a403b39", Crypto.PBKDF2([0xf0, 0x9d, 0x84, 0x9e], "EXAMPLE.COMpianist", 128/8, { iterations: 50 }));

-		Assert.areEqual("6b9cf26d45455a43a5b8bb276a403b39e7fe37a0c41e02c281ff3069e1e94f52", Crypto.PBKDF2([0xf0, 0x9d, 0x84, 0x9e], "EXAMPLE.COMpianist", 256/8, { iterations: 50 }));

-	},

-

-	test_PBKDF2Async: function () {

-		var thisTestCase = this;

-

-		Crypto.PBKDF2Async("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "pass phrase exceeds block size", 256/8, function (result) {

-			thisTestCase.resume(function () {

-				Assert.areEqual("9ccad6d468770cd51b10e6a68721be611a8b4d282601db3b36be9246915ec82a", result);

-			});

-		}, { iterations: 1200 });

-

-		thisTestCase.wait(300000);

-	}

-

-}));

diff --git a/crypto-js/test/Padding-test.js b/crypto-js/test/Padding-test.js
deleted file mode 100644
index 58e65c3..0000000
--- a/crypto-js/test/Padding-test.js
+++ /dev/null
@@ -1,154 +0,0 @@
-TestSuite.add(new YAHOO.tool.TestCase({

-	

-	_compare: function(pad, cipher, a, b) {

-		// verify required API is implemented

-		Assert.isFunction(pad.pad);

-		Assert.isFunction(pad.unpad);

-		

-		// perform padding

-		var input = a.split(",");

-		if( a=="" ) input = new Array(0);

-		var output = input.slice(0);

-		pad.pad(cipher, output);

-		var check = b.split(",");

-		if( b=="" ) check = new Array(0);

-		

-		// check result has expected length

-		Assert.areEqual(output.length, check.length,

-				"Expected padding length to be "+check.length+" but got "+output.length+" with input \""+a+"\"");

-		

-		// check input has been preserved

-		for(var i=0;i<input.length;i++) {

-			Assert.areEqual(output[i],input[i],

-					"Input corrupted: value "+i+" was "+output[i]+" not "+input[i]+" with input \""+a+"\"");

-		}

-		

-		// check padding matches expectations

-		for(var i=input.length;i<output.length;i++) {

-			if( check[i]!="*" ) {

-				Assert.areEqual(output[i],check[i],

-						"Padding byte "+i+" was "+output[i]+" not "+check[i]+" with input \""+a+"\"");

-			}

-		}

-		

-		if( pad!=Crypto.pad.ZeroPadding ) {

-			var unpad = output.slice(0);

-			pad.unpad(unpad);

-

-			// check result has expected length

-			Assert.areEqual(unpad.length, input.length);

-			

-			// check input has been preserved

-			for(var i=0;i<input.length;i++) {

-				Assert.areEqual(unpad[i],input[i]);

-			}

-		}		

-	},

-

-	test_zeropad: function() {

-		// dummy cipher that simply specifies a block size

-		var cipher = { _blocksize : 2 };

-		var p = Crypto.pad.ZeroPadding;

-		

-		this._compare(p, cipher, "", "");

-		this._compare(p, cipher, "0,0", "0,0,0,0,0,0,0,0");

-		this._compare(p, cipher, "1,2,3", "1,2,3,0,0,0,0,0");

-		this._compare(p, cipher, "4,3,2,1,8,7,6,5", "4,3,2,1,8,7,6,5");

-		this._compare(p, cipher, "5,4,3,2,1,5,4,3,2,1", "5,4,3,2,1,5,4,3,2,1,0,0,0,0,0,0");

-		this._compare(p, cipher, "0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f", "0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f");

-

-		// try different block size

-		cipher = { _blocksize : 3 };

-		this._compare(p, cipher, "1,2,3,4,5,6,1,2,3,4,5,6,1,2,3", "1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,0,0,0,0,0,0,0,0,0");

-

-		// try different block size

-		cipher = { _blocksize : 4 };

-		this._compare(p, cipher, "1,2,3,4,5,6,1,2,3,4,5,6,1,2,3", "1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,0");

-	},

-

-	test_iso7816: function() {

-		// dummy cipher that simply specifies a block size

-		var cipher = { _blocksize : 2 };

-		var p = Crypto.pad.iso7816;

-		

-		this._compare(p, cipher, "", "0x80,0,0,0,0,0,0,0");

-		this._compare(p, cipher, "0,0", "0,0,0x80,0,0,0,0,0");

-		this._compare(p, cipher, "1,2,3", "1,2,3,0x80,0,0,0,0");

-		this._compare(p, cipher, "4,3,2,1,8,7,6,5", "4,3,2,1,8,7,6,5,0x80,0,0,0,0,0,0,0");

-		this._compare(p, cipher, "5,4,3,2,1,5,4,3,2,1", "5,4,3,2,1,5,4,3,2,1,0x80,0,0,0,0,0");

-		this._compare(p, cipher, "0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f", "0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,0x80,0,0,0,0,0,0,0");

-

-		// try different block size

-		cipher = { _blocksize : 3 };

-		this._compare(p, cipher, "1,2,3,4,5,6,1,2,3,4,5,6,1,2,3", "1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,0x80,0,0,0,0,0,0,0,0");

-

-		// try different block size

-		cipher = { _blocksize : 4 };

-		this._compare(p, cipher, "1,2,3,4,5,6,1,2,3,4,5,6,1,2,3", "1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,0x80");

-	},

-	

-	test_ansix923: function() {

-		// dummy cipher that simply specifies a block size

-		var cipher = { _blocksize : 2 };

-		var p = Crypto.pad.ansix923;

-		

-		this._compare(p, cipher, "", "0,0,0,0,0,0,0,8");

-		this._compare(p, cipher, "0,0", "0,0,0,0,0,0,0,6");

-		this._compare(p, cipher, "1,2,3", "1,2,3,0,0,0,0,5");

-		this._compare(p, cipher, "4,3,2,1,8,7,6,5", "4,3,2,1,8,7,6,5,0,0,0,0,0,0,0,8");

-		this._compare(p, cipher, "5,4,3,2,1,5,4,3,2,1", "5,4,3,2,1,5,4,3,2,1,0,0,0,0,0,6");

-		this._compare(p, cipher, "0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f", "0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,0,0,0,0,0,0,0,8");

-

-		// try different block size

-		cipher = { _blocksize : 3 };

-		this._compare(p, cipher, "1,2,3,4,5,6,1,2,3,4,5,6,1,2,3", "1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,0,0,0,0,0,0,0,0,9");

-

-		// try different block size

-		cipher = { _blocksize : 4 };

-		this._compare(p, cipher, "1,2,3,4,5,6,1,2,3,4,5,6,1,2,3", "1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,1");

-	},

-	

-	test_iso10126: function() {

-		// dummy cipher that simply specifies a block size

-		var cipher = { _blocksize : 2 };

-		var p = Crypto.pad.iso10126;

-		

-		this._compare(p, cipher, "", "*,*,*,*,*,*,*,8");

-		this._compare(p, cipher, "0,0", "0,0,*,*,*,*,*,6");

-		this._compare(p, cipher, "1,2,3", "1,2,3,*,*,*,*,5");

-		this._compare(p, cipher, "4,3,2,1,8,7,6,5", "4,3,2,1,8,7,6,5,*,*,*,*,*,*,*,8");

-		this._compare(p, cipher, "5,4,3,2,1,5,4,3,2,1", "5,4,3,2,1,5,4,3,2,1,*,*,*,*,*,6");

-		this._compare(p, cipher, "0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f", "0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,*,*,*,*,*,*,*,8");

-

-		// try different block size

-		cipher = { _blocksize : 3 };

-		this._compare(p, cipher, "1,2,3,4,5,6,1,2,3,4,5,6,1,2,3", "1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,*,*,*,*,*,*,*,*,9");

-

-		// try different block size

-		cipher = { _blocksize : 4 };

-		this._compare(p, cipher, "1,2,3,4,5,6,1,2,3,4,5,6,1,2,3", "1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,1");

-	},

-	

-	test_pkcs7: function() {

-		// dummy cipher that simply specifies a block size

-		var cipher = { _blocksize : 2 };

-		var p = Crypto.pad.pkcs7;

-		

-		this._compare(p, cipher, "", "8,8,8,8,8,8,8,8");

-		this._compare(p, cipher, "0,0", "0,0,6,6,6,6,6,6");

-		this._compare(p, cipher, "1,2,3", "1,2,3,5,5,5,5,5");

-		this._compare(p, cipher, "4,3,2,1,8,7,6,5", "4,3,2,1,8,7,6,5,8,8,8,8,8,8,8,8");

-		this._compare(p, cipher, "5,4,3,2,1,5,4,3,2,1", "5,4,3,2,1,5,4,3,2,1,6,6,6,6,6,6");

-		this._compare(p, cipher, "0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f", "0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,8,8,8,8,8,8,8,8");

-

-		// try different block size

-		cipher = { _blocksize : 3 };

-		this._compare(p, cipher, "1,2,3,4,5,6,1,2,3,4,5,6,1,2,3", "1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,9,9,9,9,9,9,9,9,9");

-

-		// try different block size

-		cipher = { _blocksize : 4 };

-		this._compare(p, cipher, "1,2,3,4,5,6,1,2,3,4,5,6,1,2,3", "1,2,3,4,5,6,1,2,3,4,5,6,1,2,3,1");

-	}

-

-

-}));
\ No newline at end of file
diff --git a/crypto-js/test/Rabbit-profile.html b/crypto-js/test/Rabbit-profile.html
deleted file mode 100644
index b1a0964..0000000
--- a/crypto-js/test/Rabbit-profile.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

-<head>

-

-<!-- Profiler -->

-<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/yuiloader-dom-event/yuiloader-dom-event.js"></script>

-<script type="text/javascript" src="lib/Profiler.js"></script>

-

-<!-- Test subject -->

-<script type="text/javascript" src="../src/Crypto.js"></script>

-<script type="text/javascript" src="../src/HMAC.js"></script>

-<script type="text/javascript" src="../src/SHA1.js"></script>

-<script type="text/javascript" src="../src/PBKDF2.js"></script>

-<script type="text/javascript" src="../src/Rabbit.js"></script>

-

-<!-- Profiling -->

-<script type="text/javascript">

-

-// 5KB of random, dummy data

-var data = [];

-for (var i = 0; i < 5000; i++) data.push(String.fromCharCode(Math.floor(Math.random() * 256)));

-data = data.join("");

-

-// Random 128-bit key

-var key = [];

-for (var i = 0; i < 16; i++) key.push(String.fromCharCode(Math.floor(Math.random() * 256)));

-key = key.join("");

-

-profile(["Crypto.Rabbit", "Crypto.util", "Crypto"], function(){

-	Crypto.Rabbit.decrypt(Crypto.Rabbit.encrypt(data, key), key);

-});

-

-</script>

-

-</head>

-<body class="yui-skin-sam">

-</body>

diff --git a/crypto-js/test/Rabbit-test.js b/crypto-js/test/Rabbit-test.js
deleted file mode 100644
index d7518f4..0000000
--- a/crypto-js/test/Rabbit-test.js
+++ /dev/null
@@ -1,31 +0,0 @@
-TestSuite.add(new YAHOO.tool.TestCase({

-

-	test_Rabbit: function () {

-

-		// Test vectors

-		Crypto.Rabbit._rabbit(message = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0]);

-		Assert.areEqual([0x02, 0xF7, 0x4A, 0x1C, 0x26, 0x45, 0x6B, 0xF5, 0xEC, 0xD6, 0xA5, 0x36, 0xF0, 0x54, 0x57, 0xB1].toString(), message.toString());

-

-		Crypto.Rabbit._rabbit(message = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0xDC51C3AC, 0x3BFC62F1, 0x2E3D36FE, 0x91281329]);

-		Assert.areEqual([0x9C, 0x51, 0xE2, 0x87, 0x84, 0xC3, 0x7F, 0xE9, 0xA1, 0x27, 0xF6, 0x3E, 0xC8, 0xF3, 0x2D, 0x3D].toString(), message.toString());

-

-		Crypto.Rabbit._rabbit(message = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0xC09B0043, 0xE9E9AB01, 0x87E0C733, 0x83957415]);

-		Assert.areEqual([0x9B, 0x60, 0xD0, 0x02, 0xFD, 0x5C, 0xEB, 0x32, 0xAC, 0xCD, 0x41, 0xA0, 0xCD, 0x0D, 0xB1, 0x0C].toString(), message.toString());

-

-		Crypto.Rabbit._rabbit(message = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0], [0, 0]);

-		Assert.areEqual([0xED, 0xB7, 0x05, 0x67, 0x37, 0x5D, 0xCD, 0x7C, 0xD8, 0x95, 0x54, 0xF8, 0x5E, 0x27, 0xA7, 0xC6].toString(), message.toString());

-

-		Crypto.Rabbit._rabbit(message = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0], [0x597E26C1, 0x75F573C3]);

-		Assert.areEqual([0x6D, 0x7D, 0x01, 0x22, 0x92, 0xCC, 0xDC, 0xE0, 0xE2, 0x12, 0x00, 0x58, 0xB9, 0x4E, 0xCD, 0x1F].toString(), message.toString());

-

-		Crypto.Rabbit._rabbit(message = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0], [0x2717F4D2, 0x1A56EBA6]);

-		Assert.areEqual([0x4D, 0x10, 0x51, 0xA1, 0x23, 0xAF, 0xB6, 0x70, 0xBF, 0x8D, 0x85, 0x05, 0xC8, 0xD8, 0x5A, 0x44].toString(), message.toString());

-

-		// Test D(E(m)) == m

-		var key = Crypto.util.randomBytes(16);

-		Assert.areEqual(data, Crypto.Rabbit.decrypt(Crypto.Rabbit.encrypt(data, key), key));

-		Assert.areEqual('Сообщение', Crypto.Rabbit.decrypt(Crypto.Rabbit.encrypt('Сообщение', 'Пароль'), 'Пароль'));

-

-	}

-

-}));

diff --git a/crypto-js/test/SHA1-profile.html b/crypto-js/test/SHA1-profile.html
deleted file mode 100644
index c9838a8..0000000
--- a/crypto-js/test/SHA1-profile.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

-<head>

-

-<!-- Profiler -->

-<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/yuiloader-dom-event/yuiloader-dom-event.js"></script>

-<script type="text/javascript" src="lib/Profiler.js"></script>

-

-<!-- Test subject -->

-<script type="text/javascript" src="../src/Crypto.js"></script>

-<script type="text/javascript" src="../src/SHA1.js"></script>

-

-<!-- Profiling -->

-<script type="text/javascript">

-

-// 5KB of random, dummy data

-var data = [];

-for (var i = 0; i < 5000; i++) data.push(String.fromCharCode(Math.floor(Math.random() * 256)));

-data = data.join("");

-

-profile(["Crypto.SHA1", "Crypto.util", "Crypto"], function(){

-	Crypto.SHA1(data);

-});

-

-</script>

-

-</head>

-<body class="yui-skin-sam">

-</body>

diff --git a/crypto-js/test/SHA1-test.js b/crypto-js/test/SHA1-test.js
deleted file mode 100644
index 4bdbbe9..0000000
--- a/crypto-js/test/SHA1-test.js
+++ /dev/null
@@ -1,17 +0,0 @@
-TestSuite.add(new YAHOO.tool.TestCase({

-

-	test_SHA1: function () {

-		Assert.areEqual("da39a3ee5e6b4b0d3255bfef95601890afd80709", Crypto.SHA1(""));

-		Assert.areEqual("86f7e437faa5a7fce15d1ddcb9eaeaea377667b8", Crypto.SHA1("a"));

-		Assert.areEqual("a9993e364706816aba3e25717850c26c9cd0d89d", Crypto.SHA1("abc"));

-		Assert.areEqual("c12252ceda8be8994d5fa0290a47231c1d16aae3", Crypto.SHA1("message digest"));

-		Assert.areEqual("32d10c7b8cf96570ca04ce37f2a19d84240d3a89", Crypto.SHA1("abcdefghijklmnopqrstuvwxyz"));

-		Assert.areEqual("761c457bf73b14d27e9e9265c46f4b4dda11f940", Crypto.SHA1("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"));

-		Assert.areEqual("50abf5706a150990a08b2c5ea40fa0e585554732", Crypto.SHA1("12345678901234567890123456789012345678901234567890123456789012345678901234567890"));

-		Assert.areEqual("0fbe1a75a6fbf4f18585e21734ea341d09457564", Crypto.SHA1("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque tempor massa sit amet velit consectetur eu pellentesque felis feugiat. Mauris ullamcorper, sapien vel eleifend pulvinar, ligula lacus imperdiet mi, volutpat consequat velit dui a quam. Integer semper orci eget lectus feugiat sed adipiscing urna consectetur. In sem sem, aliquam nec vestibulum ac, aliquet quis elit. Maecenas vehicula tempor enim at dictum. Nam at sem et libero mattis hendrerit non a ante. Aliquam ut pharetra nunc. Quisque massa mi, commodo vitae semper nec, ultricies vitae ligula. Vestibulum in neque sapien. Sed vitae purus sit amet felis interdum porttitor vel sed arcu. Ut quis venenatis eros. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aenean pulvinar tellus a nunc egestas cursus. Phasellus eu velit rutrum diam cursus pulvinar. Duis consequat libero quis lectus aliquet eleifend. Curabitur mi libero, dictum at dapibus at, accumsan a dolor. Aliquam metus."));

-		Assert.areEqual("85e4c4b3933d5553ebf82090409a9d90226d845c", Crypto.SHA1("12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"));

-		Assert.areEqual([0xDA, 0x39, 0xA3, 0xEE, 0x5E, 0x6B, 0x4B, 0x0D, 0x32, 0x55, 0xBF, 0xEF, 0x95, 0x60, 0x18, 0x90, 0xAF, 0xD8, 0x07, 0x09].toString(), Crypto.SHA1("", { asBytes: true }).toString());

-		Assert.areEqual("\xDA\x39\xA3\xEE\x5E\x6B\x4B\x0D\x32\x55\xBF\xEF\x95\x60\x18\x90\xAF\xD8\x07\x09", Crypto.SHA1("", { asString: true }));

-	}

-

-}));

diff --git a/crypto-js/test/SHA256-profile.html b/crypto-js/test/SHA256-profile.html
deleted file mode 100644
index 7915518..0000000
--- a/crypto-js/test/SHA256-profile.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

-<head>

-

-<!-- Profiler -->

-<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/yuiloader-dom-event/yuiloader-dom-event.js"></script>

-<script type="text/javascript" src="lib/Profiler.js"></script>

-

-<!-- Test subject -->

-<script type="text/javascript" src="../src/Crypto.js"></script>

-<script type="text/javascript" src="../src/SHA256.js"></script>

-

-<!-- Profiling -->

-<script type="text/javascript">

-

-// 5KB of random, dummy data

-var data = [];

-for (var i = 0; i < 5000; i++) data.push(String.fromCharCode(Math.floor(Math.random() * 256)));

-data = data.join("");

-

-profile(["Crypto.SHA256", "Crypto.util", "Crypto"], function(){

-	Crypto.SHA256(data);

-});

-

-</script>

-

-</head>

-<body class="yui-skin-sam">

-</body>

diff --git a/crypto-js/test/SHA256-test.js b/crypto-js/test/SHA256-test.js
deleted file mode 100644
index 43a2a37..0000000
--- a/crypto-js/test/SHA256-test.js
+++ /dev/null
@@ -1,17 +0,0 @@
-TestSuite.add(new YAHOO.tool.TestCase({

-

-	test_SHA256: function () {

-		Assert.areEqual("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", Crypto.SHA256(""));

-		Assert.areEqual("ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb", Crypto.SHA256("a"));

-		Assert.areEqual("ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad", Crypto.SHA256("abc"));

-		Assert.areEqual("f7846f55cf23e14eebeab5b4e1550cad5b509e3348fbc4efa3a1413d393cb650", Crypto.SHA256("message digest"));

-		Assert.areEqual("71c480df93d6ae2f1efad1447c66c9525e316218cf51fc8d9ed832f2daf18b73", Crypto.SHA256("abcdefghijklmnopqrstuvwxyz"));

-		Assert.areEqual("db4bfcbd4da0cd85a60c3c37d3fbd8805c77f15fc6b1fdfe614ee0a7c8fdb4c0", Crypto.SHA256("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"));

-		Assert.areEqual("f371bc4a311f2b009eef952dd83ca80e2b60026c8e935592d0f9c308453c813e", Crypto.SHA256("12345678901234567890123456789012345678901234567890123456789012345678901234567890"));

-		Assert.areEqual("40e44c26e53e584db2253ea2994025dd8f0cc07071c0e37217293031bddb8794", Crypto.SHA256("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque tempor massa sit amet velit consectetur eu pellentesque felis feugiat. Mauris ullamcorper, sapien vel eleifend pulvinar, ligula lacus imperdiet mi, volutpat consequat velit dui a quam. Integer semper orci eget lectus feugiat sed adipiscing urna consectetur. In sem sem, aliquam nec vestibulum ac, aliquet quis elit. Maecenas vehicula tempor enim at dictum. Nam at sem et libero mattis hendrerit non a ante. Aliquam ut pharetra nunc. Quisque massa mi, commodo vitae semper nec, ultricies vitae ligula. Vestibulum in neque sapien. Sed vitae purus sit amet felis interdum porttitor vel sed arcu. Ut quis venenatis eros. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aenean pulvinar tellus a nunc egestas cursus. Phasellus eu velit rutrum diam cursus pulvinar. Duis consequat libero quis lectus aliquet eleifend. Curabitur mi libero, dictum at dapibus at, accumsan a dolor. Aliquam metus."));

-		Assert.areEqual("f8146961d9b73d8da49ccd526fca65439cdd5b402f76971556d5f52fd129843e", Crypto.SHA256("12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"));

-		Assert.areEqual([0xE3, 0xB0, 0xC4, 0x42, 0x98, 0xFC, 0x1C, 0x14, 0x9A, 0xFB, 0xF4, 0xC8, 0x99, 0x6F, 0xB9, 0x24, 0x27, 0xAE, 0x41, 0xE4, 0x64, 0x9B, 0x93, 0x4C, 0xA4, 0x95, 0x99, 0x1B, 0x78, 0x52, 0xB8, 0x55].toString(), Crypto.SHA256("", { asBytes: true }).toString());

-		Assert.areEqual("\xE3\xB0\xC4\x42\x98\xFC\x1C\x14\x9A\xFB\xF4\xC8\x99\x6F\xB9\x24\x27\xAE\x41\xE4\x64\x9B\x93\x4C\xA4\x95\x99\x1B\x78\x52\xB8\x55", Crypto.SHA256("", { asString: true }));

-	}

-

-}));

diff --git a/crypto-js/test/TestSuite.html b/crypto-js/test/TestSuite.html
deleted file mode 100644
index 1e15490..0000000
--- a/crypto-js/test/TestSuite.html
+++ /dev/null
@@ -1,110 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

-<head>

-

-<!-- YUI CSS -->

-<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.2r1/build/logger/assets/logger.css">

-<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.2r1/build/yuitest/assets/testlogger.css">

-<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.8.2r1/build/assets/skins/sam/skin.css">

-

-<!-- CSS customizations -->

-<style type="text/css">

-.yui-log { font-size: 13px }

-.yui-log-container { right: auto; left: 1em }

-.yui-log .yui-log-bd { height: 40em }

-</style>

-

-<!-- YUI JS -->

-<script type="text/javascript" src="http://yui.yahooapis.com/2.8.2r1/build/yahoo-dom-event/yahoo-dom-event.js"></script>

-<script type="text/javascript" src="http://yui.yahooapis.com/2.8.2r1/build/container/container-min.js"></script>

-<script type="text/javascript" src="http://yui.yahooapis.com/2.8.2r1/build/logger/logger-min.js"></script>

-<script type="text/javascript" src="http://yui.yahooapis.com/2.8.2r1/build/yuitest/yuitest-min.js"></script>

-

-<!-- Test subjects -->

-<script type="text/javascript" src="../src/Crypto.js"></script>

-<script type="text/javascript" src="../src/CryptoMath.js"></script>

-<script type="text/javascript" src="../src/MD5.js"></script>

-<script type="text/javascript" src="../src/SHA1.js"></script>

-<script type="text/javascript" src="../src/SHA256.js"></script>

-<script type="text/javascript" src="../src/HMAC.js"></script>

-<script type="text/javascript" src="../src/PBKDF2.js"></script>

-<script type="text/javascript" src="../src/PBKDF2Async.js"></script>

-<script type="text/javascript" src="../src/MARC4.js"></script>

-<script type="text/javascript" src="../src/Rabbit.js"></script>

-<script type="text/javascript" src="../src/AES.js"></script>

-<script type="text/javascript" src="../src/DES.js"></script>

-<script type="text/javascript" src="../src/BlockModes.js"></script>

-

-<!-- Load Crypto again to test overwriting Crypto object -->

-<script type="text/javascript" src="../src/Crypto.js"></script>

-

-<!-- Test suite -->

-<script type="text/javascript">

-

-// 1KB of random, dummy data

-var data = Crypto.util.randomBytes(1000);

-

-// Create test suite

-var TestSuite = new YAHOO.tool.TestSuite();

-YAHOO.tool.TestRunner.add(TestSuite);

-

-// Shortcut

-var Assert = YAHOO.util.Assert;

-

-</script>

-

-<!-- Test cases -->

-<script type="text/javascript" src="Crypto-test.js"></script>

-<script type="text/javascript" src="MD5-test.js"></script>

-<script type="text/javascript" src="SHA1-test.js"></script>

-<script type="text/javascript" src="SHA256-test.js"></script>

-<script type="text/javascript" src="HMAC-test.js"></script>

-<script type="text/javascript" src="MARC4-test.js"></script>

-<script type="text/javascript" src="Rabbit-test.js"></script>

-<script type="text/javascript" src="AES-test.js"></script>

-<script type="text/javascript" src="DES-test.js"></script>

-<script type="text/javascript" src="Padding-test.js"></script>

-<script type="text/javascript" src="Mode-test.js"></script>

-<script type="text/javascript" src="PBKDF2-test.js"></script>

-

-<script type="text/javascript">

-YAHOO.util.Event.onDOMReady(function(){

-

-	// Display results from the TestRunner

-	var logger = new YAHOO.tool.TestLogger();

-

-	// Hide info category

-	logger.hideCategory("info");

-

-	// Initialize the "Loading" panel

-	var loadingPanel = new YAHOO.widget.Panel("loading", {

-		width: "240px",

-		fixedcenter: true,

-		close: false,

-		draggable: false,

-		zindex: 9000,

-		modal: true,

-		visible: false

-	});

-	loadingPanel.setHeader("Testing. Please wait.");

-	loadingPanel.setBody('<img src="http://l.yimg.com/a/i/us/per/gr/gp/rel_interstitial_loading.gif" />');

-	loadingPanel.render("loading-panel");

-

-	// Show "Loading" panel while tests are running

-	YAHOO.tool.TestRunner.subscribe('begin', function () {

-		loadingPanel.show();

-	});

-	YAHOO.tool.TestRunner.subscribe('complete', function () {

-		loadingPanel.hide();

-	});

-

-	// Run all tests

-	YAHOO.tool.TestRunner.run();

-

-});

-

-</script>

-

-</head>

-<body>

-	<div id="loading-panel" class="yui-skin-sam"></div>

-</body>

diff --git a/crypto-js/test/lib/Profiler.js b/crypto-js/test/lib/Profiler.js
deleted file mode 100644
index 3fd2ff6..0000000
--- a/crypto-js/test/lib/Profiler.js
+++ /dev/null
@@ -1,83 +0,0 @@
-function profile(objectNames, run) {

-

-	var loader = new YAHOO.util.YUILoader({

-		require: ["logger", "profiler"],

-		onSuccess: function(){

-			YAHOO.util.Event.onDOMReady(function(){

-

-				// Define logger source

-				var logger = new YAHOO.widget.LogWriter(objectNames[0]);

-

-				// Create log console

-				var reader = new YAHOO.widget.LogReader();

-

-				// Customize console

-				reader.verboseOutput = false;

-				reader.newestOnTop = false;

-				reader.formatMsg = function (oLogMsg) {

-					return '<pre class="yui-log-entry"><p>' + oLogMsg.msg + '</p></pre>';

-				};

-				reader.hideSource("global");

-				reader.hideSource("LogReader");

-

-				// Register objects to profile

-				for (var i = 0; i < objectNames.length; i++)

-					if (YAHOO.lang.isFunction(objectNames[i])) {

-						YAHOO.tool.Profiler.registerConstructor(objectNames[i]);

-					} else {

-						YAHOO.tool.Profiler.registerObject(objectNames[i]);

-					}

-

-				// Run the application

-				run();

-

-				// Get report

-				var report = YAHOO.tool.Profiler.getFullReport(function(report){

-					return report.calls > 0;

-				});

-

-				// Create total time spent property

-				for (var func in report) {

-					report[func].total = report[func].points[0];

-					for (var i = 1; i < report[func].points.length; i++)

-						report[func].total += report[func].points[i];

-				}

-

-				// Change report to an array of reports

-				var reports = [];

-				for (var func in report) {

-					report[func].name = func;

-					reports.push(report[func]);

-				}

-

-				// Sort by total time

-				reports.sort(function(a, b){ return b.total - a.total; });

-

-				// Display profiler results

-				for (var i = 0; i < reports.length; i++) {

-					logger.log(

-						"<span class='info'>" + reports[i].total + "ms</span> " +

-						reports[i].name + "(): " +

-						"Called " + reports[i].calls + " times. " +

-						"Avg: "   + reports[i].avg   + "ms, " +

-						"Min: "   + reports[i].min   + "ms, " +

-						"Max: "   + reports[i].max   + "ms"

-					);

-				}

-

-			});

-		}

-	});

-

-	// CSS customizations

-	loader.addModule({

-		name: "cssmod",

-		type: "css",

-		fullpath: "lib/profiler.css"

-	});

-	loader.require("cssmod");

-

-	// Load everything in

-	loader.insert();

-

-}

diff --git a/crypto-js/test/lib/profiler.css b/crypto-js/test/lib/profiler.css
deleted file mode 100644
index 726400e..0000000
--- a/crypto-js/test/lib/profiler.css
+++ /dev/null
@@ -1,6 +0,0 @@
-.yui-skin-sam .yui-log { font-size: 13px }

-.yui-skin-sam .yui-log-container { right: auto; left: 1em; width: 50em }

-.yui-skin-sam .yui-log .yui-log-bd { height: 40em }

-.yui-skin-sam .yui-log .info,

-.yui-skin-sam .yui-log .time { display: inline-block; width: 4em; text-align: center }

-.yui-skin-sam .yui-log pre:hover { background-color: rgb(235,245,255); cursor: default }

diff --git a/download-dialog.js b/download-dialog.js
deleted file mode 100644
index 9d6631e..0000000
--- a/download-dialog.js
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview This file contains implementation for the download dialog.
- */
-
-/**
- * Namespace for download dialog.
- */
-var downloadDialog = {};
-
-/**
- * Update the download link to contain the current configuration.
- */
-downloadDialog.updateDownloadLink = function() {
-  var config = main.oncCurrent;
-  if ($('#use-encryption', '#save-request-dialog').is(':checked')) {
-    var passphrase = $('#save-passphrase', '#save-request-dialog').val();
-    config = onc.encryptConfig(passphrase, config);
-  }
-
-  var base64Data = btoa(JSON.stringify(config, null, "  "));
-  $('#download-link').attr(
-      'href',
-      'data:application/octet-stream;base64,' + base64Data);
-};
-
-/**
- * Called to initialize the download dialog.
- */
-downloadDialog.init = function() {
-  downloadDialog.updateDownloadLink();
-  $('#cancel-button', '#download-dialog').focus();
-};
-
-/**
- * Called to hide/unhide UI fields.
- */
-downloadDialog.setUiVisibility = function() {
-};
diff --git a/inherit-review-settings-ok b/inherit-review-settings-ok
deleted file mode 100644
index e69de29..0000000
--- a/inherit-review-settings-ok
+++ /dev/null
diff --git a/jquery-1.5.2.min.js b/jquery-1.5.2.min.js
deleted file mode 100644
index f78f96a..0000000
--- a/jquery-1.5.2.min.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.5.2
- * http://jquery.com/
- *
- * Copyright 2011, John Resig
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- * Copyright 2011, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- *
- * Date: Thu Mar 31 15:28:23 2011 -0400
- */
-(function(a,b){function ci(a){return d.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cf(a){if(!b_[a]){var b=d("<"+a+">").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c==="")c="block";b_[a]=c}return b_[a]}function ce(a,b){var c={};d.each(cd.concat.apply([],cd.slice(0,b)),function(){c[this]=a});return c}function b$(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function bZ(){try{return new a.XMLHttpRequest}catch(b){}}function bY(){d(a).unload(function(){for(var a in bW)bW[a](0,1)})}function bS(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var e=a.dataTypes,f={},g,h,i=e.length,j,k=e[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h==="string"&&(f[h.toLowerCase()]=a.converters[h]);l=k,k=e[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=f[m]||f["* "+k];if(!n){p=b;for(o in f){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=f[j[1]+" "+k];if(p){o=f[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&d.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bR(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bQ(a,b,c,e){if(d.isArray(b)&&b.length)d.each(b,function(b,f){c||bs.test(a)?e(a,f):bQ(a+"["+(typeof f==="object"||d.isArray(f)?b:"")+"]",f,c,e)});else if(c||b==null||typeof b!=="object")e(a,b);else if(d.isArray(b)||d.isEmptyObject(b))e(a,"");else for(var f in b)bQ(a+"["+f+"]",b[f],c,e)}function bP(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bJ,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l==="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bP(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bP(a,c,d,e,"*",g));return l}function bO(a){return function(b,c){typeof b!=="string"&&(c=b,b="*");if(d.isFunction(c)){var e=b.toLowerCase().split(bD),f=0,g=e.length,h,i,j;for(;f<g;f++)h=e[f],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bq(a,b,c){var e=b==="width"?bk:bl,f=b==="width"?a.offsetWidth:a.offsetHeight;if(c==="border")return f;d.each(e,function(){c||(f-=parseFloat(d.css(a,"padding"+this))||0),c==="margin"?f+=parseFloat(d.css(a,"margin"+this))||0:f-=parseFloat(d.css(a,"border"+this+"Width"))||0});return f}function bc(a,b){b.src?d.ajax({url:b.src,async:!1,dataType:"script"}):d.globalEval(b.text||b.textContent||b.innerHTML||""),b.parentNode&&b.parentNode.removeChild(b)}function bb(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function ba(a,b){if(b.nodeType===1){var c=b.nodeName.toLowerCase();b.clearAttributes(),b.mergeAttributes(a);if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(d.expando)}}function _(a,b){if(b.nodeType===1&&d.hasData(a)){var c=d.expando,e=d.data(a),f=d.data(b,e);if(e=e[c]){var g=e.events;f=f[c]=d.extend({},e);if(g){delete f.handle,f.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)d.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function $(a,b){return d.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Q(a,b,c){if(d.isFunction(b))return d.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return d.grep(a,function(a,d){return a===b===c});if(typeof b==="string"){var e=d.grep(a,function(a){return a.nodeType===1});if(L.test(b))return d.filter(b,e,!c);b=d.filter(b,e)}return d.grep(a,function(a,e){return d.inArray(a,b)>=0===c})}function P(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function H(a,b){return(a&&a!=="*"?a+".":"")+b.replace(t,"`").replace(u,"&")}function G(a){var b,c,e,f,g,h,i,j,k,l,m,n,o,p=[],q=[],s=d._data(this,"events");if(a.liveFired!==this&&s&&s.live&&!a.target.disabled&&(!a.button||a.type!=="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var t=s.live.slice(0);for(i=0;i<t.length;i++)g=t[i],g.origType.replace(r,"")===a.type?q.push(g.selector):t.splice(i--,1);f=d(a.target).closest(q,a.currentTarget);for(j=0,k=f.length;j<k;j++){m=f[j];for(i=0;i<t.length;i++){g=t[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,e=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,e=d(a.relatedTarget).closest(g.selector)[0];(!e||e!==h)&&p.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=p.length;j<k;j++){f=p[j];if(c&&f.level>c)break;a.currentTarget=f.elem,a.data=f.handleObj.data,a.handleObj=f.handleObj,o=f.handleObj.origHandler.apply(f.elem,arguments);if(o===!1||a.isPropagationStopped()){c=f.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function E(a,c,e){var f=d.extend({},e[0]);f.type=a,f.originalEvent={},f.liveFired=b,d.event.handle.call(c,f),f.isDefaultPrevented()&&e[0].preventDefault()}function y(){return!0}function x(){return!1}function i(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function h(a,c,e){if(e===b&&a.nodeType===1){e=a.getAttribute("data-"+c);if(typeof e==="string"){try{e=e==="true"?!0:e==="false"?!1:e==="null"?null:d.isNaN(e)?g.test(e)?d.parseJSON(e):e:parseFloat(e)}catch(f){}d.data(a,c,e)}else e=b}return e}var c=a.document,d=function(){function G(){if(!d.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(G,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\d/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=navigator.userAgent,w,x,y,z=Object.prototype.toString,A=Object.prototype.hasOwnProperty,B=Array.prototype.push,C=Array.prototype.slice,D=String.prototype.trim,E=Array.prototype.indexOf,F={};d.fn=d.prototype={constructor:d,init:function(a,e,f){var g,i,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!e&&c.body){this.context=c,this[0]=c.body,this.selector="body",this.length=1;return this}if(typeof a==="string"){g=h.exec(a);if(!g||!g[1]&&e)return!e||e.jquery?(e||f).find(a):this.constructor(e).find(a);if(g[1]){e=e instanceof d?e[0]:e,k=e?e.ownerDocument||e:c,j=m.exec(a),j?d.isPlainObject(e)?(a=[c.createElement(j[1])],d.fn.attr.call(a,e,!0)):a=[k.createElement(j[1])]:(j=d.buildFragment([g[1]],[k]),a=(j.cacheable?d.clone(j.fragment):j.fragment).childNodes);return d.merge(this,a)}i=c.getElementById(g[2]);if(i&&i.parentNode){if(i.id!==g[2])return f.find(a);this.length=1,this[0]=i}this.context=c,this.selector=a;return this}if(d.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.5.2",length:0,size:function(){return this.length},toArray:function(){return C.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?B.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady(),x.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(C.apply(this,arguments),"slice",C.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:B,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i==="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!=="object"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){e=i[c],f=a[c];if(i===f)continue;l&&f&&(d.isPlainObject(f)||(g=d.isArray(f)))?(g?(g=!1,h=e&&d.isArray(e)?e:[]):h=e&&d.isPlainObject(e)?e:{},i[c]=d.extend(l,h,f)):f!==b&&(i[c]=f)}return i},d.extend({noConflict:function(b){a.$=f,b&&(a.jQuery=e);return d},isReady:!1,readyWait:1,ready:function(a){a===!0&&d.readyWait--;if(!d.readyWait||a!==!0&&!d.isReady){if(!c.body)return setTimeout(d.ready,1);d.isReady=!0;if(a!==!0&&--d.readyWait>0)return;x.resolveWith(c,[d]),d.fn.trigger&&d(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!x){x=d._Deferred();if(c.readyState==="complete")return setTimeout(d.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",y,!1),a.addEventListener("load",d.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",y),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}c.documentElement.doScroll&&b&&G()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a==="object"&&"setInterval"in a},isNaN:function(a){return a==null||!l.test(a)||isNaN(a)},type:function(a){return a==null?String(a):F[z.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!A.call(a,"constructor")&&!A.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a){}return c===b||A.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!=="string"||!b)return null;b=d.trim(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(b):(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(b,c,e){a.DOMParser?(e=new DOMParser,c=e.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),e=c.documentElement,(!e||!e.nodeName||e.nodeName==="parsererror")&&d.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(a){if(a&&i.test(a)){var b=c.head||c.getElementsByTagName("head")[0]||c.documentElement,e=c.createElement("script");d.support.scriptEval()?e.appendChild(c.createTextNode(a)):e.text=a,b.insertBefore(e,b.firstChild),b.removeChild(e)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g<h;)if(c.apply(a[g++],e)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(var j=a[0];g<h&&c.call(j,g,j)!==!1;j=a[++g]){}return a},trim:D?function(a){return a==null?"":D.call(a)}:function(a){return a==null?"":(a+"").replace(j,"").replace(k,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var e=d.type(a);a.length==null||e==="string"||e==="function"||e==="regexp"||d.isWindow(a)?B.call(c,a):d.merge(c,a)}return c},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length==="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,b,c){var d=[],e;for(var f=0,g=a.length;f<g;f++)e=b(a[f],f,c),e!=null&&(d[d.length]=e);return d.concat.apply([],d)},guid:1,proxy:function(a,c,e){arguments.length===2&&(typeof c==="string"?(e=a,a=e[c],c=b):c&&!d.isFunction(c)&&(e=c,c=b)),!c&&a&&(c=function(){return a.apply(e||this,arguments)}),a&&(c.guid=a.guid=a.guid||c.guid||d.guid++);return c},access:function(a,c,e,f,g,h){var i=a.length;if(typeof c==="object"){for(var j in c)d.access(a,j,c[j],f,g,e);return a}if(e!==b){f=!h&&f&&d.isFunction(e);for(var k=0;k<i;k++)g(a[k],c,f?e.call(a[k],k,g(a[k],c)):e,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.subclass=this.subclass,a.fn.init=function b(b,c){c&&c instanceof d&&!(c instanceof a)&&(c=a(c));return d.fn.init.call(this,b,c,e)},a.fn.init.prototype=a.fn;var e=a(c);return a},browser:{}}),d.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){F["[object "+b+"]"]=b.toLowerCase()}),w=d.uaMatch(v),w.browser&&(d.browser[w.browser]=!0,d.browser.version=w.version),d.browser.webkit&&(d.browser.safari=!0),E&&(d.inArray=function(a,b){return E.call(b,a)}),i.test(" ")&&(j=/^[\s\xA0]+/,k=/[\s\xA0]+$/),g=d(c),c.addEventListener?y=function(){c.removeEventListener("DOMContentLoaded",y,!1),d.ready()}:c.attachEvent&&(y=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",y),d.ready())});return d}(),e="then done fail isResolved isRejected promise".split(" "),f=[].slice;d.extend({_Deferred:function(){var a=[],b,c,e,f={done:function(){if(!e){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=d.type(i),j==="array"?f.done.apply(f,i):j==="function"&&a.push(i);k&&f.resolveWith(k[0],k[1])}return this},resolveWith:function(d,f){if(!e&&!b&&!c){f=f||[],c=1;try{while(a[0])a.shift().apply(d,f)}finally{b=[d,f],c=0}}return this},resolve:function(){f.resolveWith(this,arguments);return this},isResolved:function(){return c||b},cancel:function(){e=1,a=[];return this}};return f},Deferred:function(a){var b=d._Deferred(),c=d._Deferred(),f;d.extend(b,{then:function(a,c){b.done(a).fail(c);return this},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,promise:function(a){if(a==null){if(f)return f;f=a={}}var c=e.length;while(c--)a[e[c]]=b[e[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){function i(a){return function(c){b[a]=arguments.length>1?f.call(arguments,0):c,--g||h.resolveWith(h,f.call(b,0))}}var b=arguments,c=0,e=b.length,g=e,h=e<=1&&a&&d.isFunction(a.promise)?a:d.Deferred();if(e>1){for(;c<e;c++)b[c]&&d.isFunction(b[c].promise)?b[c].promise().then(i(c),h.reject):--g;g||h.resolveWith(h,b)}else h!==a&&h.resolveWith(h,e?[a]:[]);return h.promise()}}),function(){d.support={};var b=c.createElement("div");b.style.display="none",b.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=b.getElementsByTagName("*"),f=b.getElementsByTagName("a")[0],g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=b.getElementsByTagName("input")[0];if(e&&e.length&&f){d.support={leadingWhitespace:b.firstChild.nodeType===3,tbody:!b.getElementsByTagName("tbody").length,htmlSerialize:!!b.getElementsByTagName("link").length,style:/red/.test(f.getAttribute("style")),hrefNormalized:f.getAttribute("href")==="/a",opacity:/^0.55$/.test(f.style.opacity),cssFloat:!!f.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,deleteExpando:!0,optDisabled:!1,checkClone:!1,noCloneEvent:!0,noCloneChecked:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0,reliableMarginRight:!0},i.checked=!0,d.support.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,d.support.optDisabled=!h.disabled;var j=null;d.support.scriptEval=function(){if(j===null){var b=c.documentElement,e=c.createElement("script"),f="script"+d.now();try{e.appendChild(c.createTextNode("window."+f+"=1;"))}catch(g){}b.insertBefore(e,b.firstChild),a[f]?(j=!0,delete a[f]):j=!1,b.removeChild(e)}return j};try{delete b.test}catch(k){d.support.deleteExpando=!1}!b.addEventListener&&b.attachEvent&&b.fireEvent&&(b.attachEvent("onclick",function l(){d.support.noCloneEvent=!1,b.detachEvent("onclick",l)}),b.cloneNode(!0).fireEvent("onclick")),b=c.createElement("div"),b.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var m=c.createDocumentFragment();m.appendChild(b.firstChild),d.support.checkClone=m.cloneNode(!0).cloneNode(!0).lastChild.checked,d(function(){var a=c.createElement("div"),b=c.getElementsByTagName("body")[0];if(b){a.style.width=a.style.paddingLeft="1px",b.appendChild(a),d.boxModel=d.support.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,d.support.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",d.support.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";var e=a.getElementsByTagName("td");d.support.reliableHiddenOffsets=e[0].offsetHeight===0,e[0].style.display="",e[1].style.display="none",d.support.reliableHiddenOffsets=d.support.reliableHiddenOffsets&&e[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(a.style.width="1px",a.style.marginRight="0",d.support.reliableMarginRight=(parseInt(c.defaultView.getComputedStyle(a,null).marginRight,10)||0)===0),b.removeChild(a).style.display="none",a=e=null}});var n=function(a){var b=c.createElement("div");a="on"+a;if(!b.attachEvent)return!0;var d=a in b;d||(b.setAttribute(a,"return;"),d=typeof b[a]==="function");return d};d.support.submitBubbles=n("submit"),d.support.changeBubbles=n("change"),b=e=f=null}}();var g=/^(?:\{.*\}|\[.*\])$/;d.extend({cache:{},uuid:0,expando:"jQuery"+(d.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?d.cache[a[d.expando]]:a[d.expando];return!!a&&!i(a)},data:function(a,c,e,f){if(d.acceptData(a)){var g=d.expando,h=typeof c==="string",i,j=a.nodeType,k=j?d.cache:a,l=j?a[d.expando]:a[d.expando]&&d.expando;if((!l||f&&l&&!k[l][g])&&h&&e===b)return;l||(j?a[d.expando]=l=++d.uuid:l=d.expando),k[l]||(k[l]={},j||(k[l].toJSON=d.noop));if(typeof c==="object"||typeof c==="function")f?k[l][g]=d.extend(k[l][g],c):k[l]=d.extend(k[l],c);i=k[l],f&&(i[g]||(i[g]={}),i=i[g]),e!==b&&(i[c]=e);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[c]:i}},removeData:function(b,c,e){if(d.acceptData(b)){var f=d.expando,g=b.nodeType,h=g?d.cache:b,j=g?b[d.expando]:d.expando;if(!h[j])return;if(c){var k=e?h[j][f]:h[j];if(k){delete k[c];if(!i(k))return}}if(e){delete h[j][f];if(!i(h[j]))return}var l=h[j][f];d.support.deleteExpando||h!=a?delete h[j]:h[j]=null,l?(h[j]={},g||(h[j].toJSON=d.noop),h[j][f]=l):g&&(d.support.deleteExpando?delete b[d.expando]:b.removeAttribute?b.removeAttribute(d.expando):b[d.expando]=null)}},_data:function(a,b,c){return d.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=d.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),d.fn.extend({data:function(a,c){var e=null;if(typeof a==="undefined"){if(this.length){e=d.data(this[0]);if(this[0].nodeType===1){var f=this[0].attributes,g;for(var i=0,j=f.length;i<j;i++)g=f[i].name,g.indexOf("data-")===0&&(g=g.substr(5),h(this[0],g,e[g]))}}return e}if(typeof a==="object")return this.each(function(){d.data(this,a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(c===b){e=this.triggerHandler("getData"+k[1]+"!",[k[0]]),e===b&&this.length&&(e=d.data(this[0],a),e=h(this[0],a,e));return e===b&&k[1]?this.data(k[0]):e}return this.each(function(){var b=d(this),e=[k[0],c];b.triggerHandler("setData"+k[1]+"!",e),d.data(this,a,c),b.triggerHandler("changeData"+k[1]+"!",e)})},removeData:function(a){return this.each(function(){d.removeData(this,a)})}}),d.extend({queue:function(a,b,c){if(a){b=(b||"fx")+"queue";var e=d._data(a,b);if(!c)return e||[];!e||d.isArray(c)?e=d._data(a,b,d.makeArray(c)):e.push(c);return e}},dequeue:function(a,b){b=b||"fx";var c=d.queue(a,b),e=c.shift();e==="inprogress"&&(e=c.shift()),e&&(b==="fx"&&c.unshift("inprogress"),e.call(a,function(){d.dequeue(a,b)})),c.length||d.removeData(a,b+"queue",!0)}}),d.fn.extend({queue:function(a,c){typeof a!=="string"&&(c=a,a="fx");if(c===b)return d.queue(this[0],a);return this.each(function(b){var e=d.queue(this,a,c);a==="fx"&&e[0]!=="inprogress"&&d.dequeue(this,a)})},dequeue:function(a){return this.each(function(){d.dequeue(this,a)})},delay:function(a,b){a=d.fx?d.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){d.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var j=/[\n\t\r]/g,k=/\s+/,l=/\r/g,m=/^(?:href|src|style)$/,n=/^(?:button|input)$/i,o=/^(?:button|input|object|select|textarea)$/i,p=/^a(?:rea)?$/i,q=/^(?:radio|checkbox)$/i;d.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"},d.fn.extend({attr:function(a,b){return d.access(this,a,b,!0,d.attr)},removeAttr:function(a,b){return this.each(function(){d.attr(this,a,""),this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.addClass(a.call(this,b,c.attr("class")))});if(a&&typeof a==="string"){var b=(a||"").split(k);for(var c=0,e=this.length;c<e;c++){var f=this[c];if(f.nodeType===1)if(f.className){var g=" "+f.className+" ",h=f.className;for(var i=0,j=b.length;i<j;i++)g.indexOf(" "+b[i]+" ")<0&&(h+=" "+b[i]);f.className=d.trim(h)}else f.className=a}}return this},removeClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.removeClass(a.call(this,b,c.attr("class")))});if(a&&typeof a==="string"||a===b){var c=(a||"").split(k);for(var e=0,f=this.length;e<f;e++){var g=this[e];if(g.nodeType===1&&g.className)if(a){var h=(" "+g.className+" ").replace(j," ");for(var i=0,l=c.length;i<l;i++)h=h.replace(" "+c[i]+" "," ");g.className=d.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,e=typeof b==="boolean";if(d.isFunction(a))return this.each(function(c){var e=d(this);e.toggleClass(a.call(this,c,e.attr("class"),b),b)});return this.each(function(){if(c==="string"){var f,g=0,h=d(this),i=b,j=a.split(k);while(f=j[g++])i=e?i:!h.hasClass(f),h[i?"addClass":"removeClass"](f)}else if(c==="undefined"||c==="boolean")this.className&&d._data(this,"__className__",this.className),this.className=this.className||a===!1?"":d._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(j," ").indexOf(b)>-1)return!0;return!1},val:function(a){if(!arguments.length){var c=this[0];if(c){if(d.nodeName(c,"option")){var e=c.attributes.value;return!e||e.specified?c.value:c.text}if(d.nodeName(c,"select")){var f=c.selectedIndex,g=[],h=c.options,i=c.type==="select-one";if(f<0)return null;for(var j=i?f:0,k=i?f+1:h.length;j<k;j++){var m=h[j];if(m.selected&&(d.support.optDisabled?!m.disabled:m.getAttribute("disabled")===null)&&(!m.parentNode.disabled||!d.nodeName(m.parentNode,"optgroup"))){a=d(m).val();if(i)return a;g.push(a)}}if(i&&!g.length&&h.length)return d(h[f]).val();return g}if(q.test(c.type)&&!d.support.checkOn)return c.getAttribute("value")===null?"on":c.value;return(c.value||"").replace(l,"")}return b}var n=d.isFunction(a);return this.each(function(b){var c=d(this),e=a;if(this.nodeType===1){n&&(e=a.call(this,b,c.val())),e==null?e="":typeof e==="number"?e+="":d.isArray(e)&&(e=d.map(e,function(a){return a==null?"":a+""}));if(d.isArray(e)&&q.test(this.type))this.checked=d.inArray(c.val(),e)>=0;else if(d.nodeName(this,"select")){var f=d.makeArray(e);d("option",this).each(function(){this.selected=d.inArray(d(this).val(),f)>=0}),f.length||(this.selectedIndex=-1)}else this.value=e}})}}),d.extend({attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,e,f){if(!a||a.nodeType===3||a.nodeType===8||a.nodeType===2)return b;if(f&&c in d.attrFn)return d(a)[c](e);var g=a.nodeType!==1||!d.isXMLDoc(a),h=e!==b;c=g&&d.props[c]||c;if(a.nodeType===1){var i=m.test(c);if(c==="selected"&&!d.support.optSelected){var j=a.parentNode;j&&(j.selectedIndex,j.parentNode&&j.parentNode.selectedIndex)}if((c in a||a[c]!==b)&&g&&!i){h&&(c==="type"&&n.test(a.nodeName)&&a.parentNode&&d.error("type property can't be changed"),e===null?a.nodeType===1&&a.removeAttribute(c):a[c]=e);if(d.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c==="tabIndex"){var k=a.getAttributeNode("tabIndex");return k&&k.specified?k.value:o.test(a.nodeName)||p.test(a.nodeName)&&a.href?0:b}return a[c]}if(!d.support.style&&g&&c==="style"){h&&(a.style.cssText=""+e);return a.style.cssText}h&&a.setAttribute(c,""+e);if(!a.attributes[c]&&(a.hasAttribute&&!a.hasAttribute(c)))return b;var l=!d.support.hrefNormalized&&g&&i?a.getAttribute(c,2):a.getAttribute(c);return l===null?b:l}h&&(a[c]=e);return a[c]}});var r=/\.(.*)$/,s=/^(?:textarea|input|select)$/i,t=/\./g,u=/ /g,v=/[^\w\s.|`]/g,w=function(a){return a.replace(v,"\\$&")};d.event={add:function(c,e,f,g){if(c.nodeType!==3&&c.nodeType!==8){try{d.isWindow(c)&&(c!==a&&!c.frameElement)&&(c=a)}catch(h){}if(f===!1)f=x;else if(!f)return;var i,j;f.handler&&(i=f,f=i.handler),f.guid||(f.guid=d.guid++);var k=d._data(c);if(!k)return;var l=k.events,m=k.handle;l||(k.events=l={}),m||(k.handle=m=function(a){return typeof d!=="undefined"&&d.event.triggered!==a.type?d.event.handle.apply(m.elem,arguments):b}),m.elem=c,e=e.split(" ");var n,o=0,p;while(n=e[o++]){j=i?d.extend({},i):{handler:f,data:g},n.indexOf(".")>-1?(p=n.split("."),n=p.shift(),j.namespace=p.slice(0).sort().join(".")):(p=[],j.namespace=""),j.type=n,j.guid||(j.guid=f.guid);var q=l[n],r=d.event.special[n]||{};if(!q){q=l[n]=[];if(!r.setup||r.setup.call(c,g,p,m)===!1)c.addEventListener?c.addEventListener(n,m,!1):c.attachEvent&&c.attachEvent("on"+n,m)}r.add&&(r.add.call(c,j),j.handler.guid||(j.handler.guid=f.guid)),q.push(j),d.event.global[n]=!0}c=null}},global:{},remove:function(a,c,e,f){if(a.nodeType!==3&&a.nodeType!==8){e===!1&&(e=x);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=d.hasData(a)&&d._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(e=c.handler,c=c.type);if(!c||typeof c==="string"&&c.charAt(0)==="."){c=c||"";for(h in t)d.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+d.map(m.slice(0).sort(),w).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!e){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))d.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=d.event.special[h]||{};for(j=f||0;j<p.length;j++){q=p[j];if(e.guid===q.guid){if(l||n.test(q.namespace))f==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(f!=null)break}}if(p.length===0||f!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&d.removeEvent(a,h,s.handle),g=null,delete t[h]}if(d.isEmptyObject(t)){var u=s.handle;u&&(u.elem=null),delete s.events,delete s.handle,d.isEmptyObject(s)&&d.removeData(a,b,!0)}}},trigger:function(a,c,e){var f=a.type||a,g=arguments[3];if(!g){a=typeof a==="object"?a[d.expando]?a:d.extend(d.Event(f),a):d.Event(f),f.indexOf("!")>=0&&(a.type=f=f.slice(0,-1),a.exclusive=!0),e||(a.stopPropagation(),d.event.global[f]&&d.each(d.cache,function(){var b=d.expando,e=this[b];e&&e.events&&e.events[f]&&d.event.trigger(a,c,e.handle.elem)}));if(!e||e.nodeType===3||e.nodeType===8)return b;a.result=b,a.target=e,c=d.makeArray(c),c.unshift(a)}a.currentTarget=e;var h=d._data(e,"handle");h&&h.apply(e,c);var i=e.parentNode||e.ownerDocument;try{e&&e.nodeName&&d.noData[e.nodeName.toLowerCase()]||e["on"+f]&&e["on"+f].apply(e,c)===!1&&(a.result=!1,a.preventDefault())}catch(j){}if(!a.isPropagationStopped()&&i)d.event.trigger(a,c,i,!0);else if(!a.isDefaultPrevented()){var k,l=a.target,m=f.replace(r,""),n=d.nodeName(l,"a")&&m==="click",o=d.event.special[m]||{};if((!o._default||o._default.call(e,a)===!1)&&!n&&!(l&&l.nodeName&&d.noData[l.nodeName.toLowerCase()])){try{l[m]&&(k=l["on"+m],k&&(l["on"+m]=null),d.event.triggered=a.type,l[m]())}catch(p){}k&&(l["on"+m]=k),d.event.triggered=b}}},handle:function(c){var e,f,g,h,i,j=[],k=d.makeArray(arguments);c=k[0]=d.event.fix(c||a.event),c.currentTarget=this,e=c.type.indexOf(".")<0&&!c.exclusive,e||(g=c.type.split("."),c.type=g.shift(),j=g.slice(0).sort(),h=new RegExp("(^|\\.)"+j.join("\\.(?:.*\\.)?")+"(\\.|$)")),c.namespace=c.namespace||j.join("."),i=d._data(this,"events"),f=(i||{})[c.type];if(i&&f){f=f.slice(0);for(var l=0,m=f.length;l<m;l++){var n=f[l];if(e||h.test(n.namespace)){c.handler=n.handler,c.data=n.data,c.handleObj=n;var o=n.handler.apply(this,k);o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[d.expando])return a;var e=a;a=d.Event(e);for(var f=this.props.length,g;f;)g=this.props[--f],a[g]=e[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=c.documentElement,i=c.body;a.pageX=a.clientX+(h&&h.scrollLeft||i&&i.scrollLeft||0)-(h&&h.clientLeft||i&&i.clientLeft||0),a.pageY=a.clientY+(h&&h.scrollTop||i&&i.scrollTop||0)-(h&&h.clientTop||i&&i.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:d.proxy,special:{ready:{setup:d.bindReady,teardown:d.noop},live:{add:function(a){d.event.add(this,H(a.origType,a.selector),d.extend({},a,{handler:G,guid:a.handler.guid}))},remove:function(a){d.event.remove(this,H(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){d.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},d.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},d.Event=function(a){if(!this.preventDefault)return new d.Event(a);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?y:x):this.type=a,this.timeStamp=d.now(),this[d.expando]=!0},d.Event.prototype={preventDefault:function(){this.isDefaultPrevented=y;var a=this.originalEvent;a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=y;var a=this.originalEvent;a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=y,this.stopPropagation()},isDefaultPrevented:x,isPropagationStopped:x,isImmediatePropagationStopped:x};var z=function(a){var b=a.relatedTarget;try{if(b&&b!==c&&!b.parentNode)return;while(b&&b!==this)b=b.parentNode;b!==this&&(a.type=a.data,d.event.handle.apply(this,arguments))}catch(e){}},A=function(a){a.type=a.data,d.event.handle.apply(this,arguments)};d.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){d.event.special[a]={setup:function(c){d.event.add(this,b,c&&c.selector?A:z,a)},teardown:function(a){d.event.remove(this,b,a&&a.selector?A:z)}}}),d.support.submitBubbles||(d.event.special.submit={setup:function(a,b){if(this.nodeName&&this.nodeName.toLowerCase()!=="form")d.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&d(b).closest("form").length&&E("submit",this,arguments)}),d.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&d(b).closest("form").length&&a.keyCode===13&&E("submit",this,arguments)});else return!1},teardown:function(a){d.event.remove(this,".specialSubmit")}});if(!d.support.changeBubbles){var B,C=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?d.map(a.options,function(a){return a.selected}).join("-"):"":a.nodeName.toLowerCase()==="select"&&(c=a.selectedIndex);return c},D=function D(a){var c=a.target,e,f;if(s.test(c.nodeName)&&!c.readOnly){e=d._data(c,"_change_data"),f=C(c),(a.type!=="focusout"||c.type!=="radio")&&d._data(c,"_change_data",f);if(e===b||f===e)return;if(e!=null||f)a.type="change",a.liveFired=b,d.event.trigger(a,arguments[1],c)}};d.event.special.change={filters:{focusout:D,beforedeactivate:D,click:function(a){var b=a.target,c=b.type;(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")&&D.call(this,a)},keydown:function(a){var b=a.target,c=b.type;(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&D.call(this,a)},beforeactivate:function(a){var b=a.target;d._data(b,"_change_data",C(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in B)d.event.add(this,c+".specialChange",B[c]);return s.test(this.nodeName)},teardown:function(a){d.event.remove(this,".specialChange");return s.test(this.nodeName)}},B=d.event.special.change.filters,B.focus=B.beforeactivate}c.addEventListener&&d.each({focus:"focusin",blur:"focusout"},function(a,b){function f(a){var c=d.event.fix(a);c.type=b,c.originalEvent={},d.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var e=0;d.event.special[b]={setup:function(){e++===0&&c.addEventListener(a,f,!0)},teardown:function(){--e===0&&c.removeEventListener(a,f,!0)}}}),d.each(["bind","one"],function(a,c){d.fn[c]=function(a,e,f){if(typeof a==="object"){for(var g in a)this[c](g,e,a[g],f);return this}if(d.isFunction(e)||e===!1)f=e,e=b;var h=c==="one"?d.proxy(f,function(a){d(this).unbind(a,h);return f.apply(this,arguments)}):f;if(a==="unload"&&c!=="one")this.one(a,e,f);else for(var i=0,j=this.length;i<j;i++)d.event.add(this[i],a,h,e);return this}}),d.fn.extend({unbind:function(a,b){if(typeof a!=="object"||a.preventDefault)for(var e=0,f=this.length;e<f;e++)d.event.remove(this[e],a,b);else for(var c in a)this.unbind(c,a[c]);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){d.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var c=d.Event(a);c.preventDefault(),c.stopPropagation(),d.event.trigger(c,b,this[0]);return c.result}},toggle:function(a){var b=arguments,c=1;while(c<b.length)d.proxy(a,b[c++]);return this.click(d.proxy(a,function(e){var f=(d._data(this,"lastToggle"+a.guid)||0)%c;d._data(this,"lastToggle"+a.guid,f+1),e.preventDefault();return b[f].apply(this,arguments)||!1}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var F={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};d.each(["live","die"],function(a,c){d.fn[c]=function(a,e,f,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:d(this.context);if(typeof a==="object"&&!a.preventDefault){for(var o in a)n[c](o,e,a[o],m);return this}d.isFunction(e)&&(f=e,e=b),a=(a||"").split(" ");while((h=a[i++])!=null){j=r.exec(h),k="",j&&(k=j[0],h=h.replace(r,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,h==="focus"||h==="blur"?(a.push(F[h]+k),h=h+k):h=(F[h]||h)+k;if(c==="live")for(var p=0,q=n.length;p<q;p++)d.event.add(n[p],"live."+H(h,m),{data:e,selector:m,handler:f,origType:h,origHandler:f,preType:l});else n.unbind("live."+H(h,m),f)}return this}}),d.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){d.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},d.attrFn&&(d.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!=="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,e,g){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!=="string")return e;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(f.call(n)==="[object Array]")if(u)if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&e.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&e.push(j[t]);else e.push.apply(e,n);else p(n,e);o&&(k(o,h,e,g),k.uniqueSort(e));return e};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!=="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(f){if(f===!0)continue}else g=o=!0}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b==="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1){}a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b==="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=u;typeof b==="string"&&!j.test(b)&&(b=b.toLowerCase(),d=b,g=t),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=u;typeof b==="string"&&!j.test(b)&&(b=b.toLowerCase(),d=b,g=t),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!=="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!=="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return"text"===c&&(b===c||b===null)},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length==="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(a===b){g=!0;return 0}if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!=="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!=="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};d.find=k,d.expr=k.selectors,d.expr[":"]=d.expr.filters,d.unique=k.uniqueSort,d.text=k.getText,d.isXMLDoc=k.isXML,d.contains=k.contains}();var I=/Until$/,J=/^(?:parents|prevUntil|prevAll)/,K=/,/,L=/^.[^:#\[\.,]*$/,M=Array.prototype.slice,N=d.expr.match.POS,O={children:!0,contents:!0,next:!0,prev:!0};d.fn.extend({find:function(a){var b=this.pushStack("","find",a),c=0;for(var e=0,f=this.length;e<f;e++){c=b.length,d.find(a,this[e],b);if(e>0)for(var g=c;g<b.length;g++)for(var h=0;h<c;h++)if(b[h]===b[g]){b.splice(g--,1);break}}return b},has:function(a){var b=d(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(d.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(Q(this,a,!1),"not",a)},filter:function(a){return this.pushStack(Q(this,a,!0),"filter",a)},is:function(a){return!!a&&d.filter(a,this).length>0},closest:function(a,b){var c=[],e,f,g=this[0];if(d.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(e=0,f=a.length;e<f;e++)i=a[e],j[i]||(j[i]=d.expr.match.POS.test(i)?d(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:d(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=N.test(a)?d(a,b||this.context):null;for(e=0,f=this.length;e<f;e++){g=this[e];while(g){if(l?l.index(g)>-1:d.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b)break}}c=c.length>1?d.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a==="string")return d.inArray(this[0],a?d(a):this.parent().children());return d.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a==="string"?d(a,b):d.makeArray(a),e=d.merge(this.get(),c);return this.pushStack(P(c[0])||P(e[0])?e:d.unique(e))},andSelf:function(){return this.add(this.prevObject)}}),d.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,c){return d.dir(a,"parentNode",c)},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},nextUntil:function(a,b,c){return d.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return d.dir(a,"previousSibling",c)},siblings:function(a){return d.sibling(a.parentNode.firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,b){d.fn[a]=function(c,e){var f=d.map(this,b,c),g=M.call(arguments);I.test(a)||(e=c),e&&typeof e==="string"&&(f=d.filter(e,f)),f=this.length>1&&!O[a]?d.unique(f):f,(this.length>1||K.test(e))&&J.test(a)&&(f=f.reverse());return this.pushStack(f,a,g.join(","))}}),d.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?d.find.matchesSelector(b[0],a)?[b[0]]:[]:d.find.matches(a,b)},dir:function(a,c,e){var f=[],g=a[c];while(g&&g.nodeType!==9&&(e===b||g.nodeType!==1||!d(g).is(e)))g.nodeType===1&&f.push(g),g=g[c];return f},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var R=/ jQuery\d+="(?:\d+|null)"/g,S=/^\s+/,T=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,U=/<([\w:]+)/,V=/<tbody/i,W=/<|&#?\w+;/,X=/<(?:script|object|embed|option|style)/i,Y=/checked\s*(?:[^=]|=\s*.checked.)/i,Z={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};Z.optgroup=Z.option,Z.tbody=Z.tfoot=Z.colgroup=Z.caption=Z.thead,Z.th=Z.td,d.support.htmlSerialize||(Z._default=[1,"div<div>","</div>"]),d.fn.extend({text:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.text(a.call(this,b,c.text()))});if(typeof a!=="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return d.text(this)},wrapAll:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapAll(a.call(this,b))});if(this[0]){var b=d(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapInner(a.call(this,b))});return this.each(function(){var b=d(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=d(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,d(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,e;(e=this[c])!=null;c++)if(!a||d.filter(a,[e]).length)!b&&e.nodeType===1&&(d.cleanData(e.getElementsByTagName("*")),d.cleanData([e])),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&d.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return d.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(R,""):null;if(typeof a!=="string"||X.test(a)||!d.support.leadingWhitespace&&S.test(a)||Z[(U.exec(a)||["",""])[1].toLowerCase()])d.isFunction(a)?this.each(function(b){var c=d(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);else{a=a.replace(T,"<$1></$2>");try{for(var c=0,e=this.length;c<e;c++)this[c].nodeType===1&&(d.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(f){this.empty().append(a)}}return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(d.isFunction(a))return this.each(function(b){var c=d(this),e=c.html();c.replaceWith(a.call(this,b,e))});typeof a!=="string"&&(a=d(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;d(this).remove(),b?d(b).before(a):d(c).append(a)})}return this.length?this.pushStack(d(d.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,e){var f,g,h,i,j=a[0],k=[];if(!d.support.checkClone&&arguments.length===3&&typeof j==="string"&&Y.test(j))return this.each(function(){d(this).domManip(a,c,e,!0)});if(d.isFunction(j))return this.each(function(f){var g=d(this);a[0]=j.call(this,f,c?g.html():b),g.domManip(a,c,e)});if(this[0]){i=j&&j.parentNode,d.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?f={fragment:i}:f=d.buildFragment(a,this,k),h=f.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&d.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)e.call(c?$(this[l],g):this[l],f.cacheable||m>1&&l<n?d.clone(h,!0,!0):h)}k.length&&d.each(k,bc)}return this}}),d.buildFragment=function(a,b,e){var f,g,h,i=b&&b[0]?b[0].ownerDocument||b[0]:c;a.length===1&&typeof a[0]==="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!X.test(a[0])&&(d.support.checkClone||!Y.test(a[0]))&&(g=!0,h=d.fragments[a[0]],h&&(h!==1&&(f=h))),f||(f=i.createDocumentFragment(),d.clean(a,i,f,e)),g&&(d.fragments[a[0]]=h?f:1);return{fragment:f,cacheable:g}},d.fragments={},d.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){d.fn[a]=function(c){var e=[],f=d(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&f.length===1){f[b](this[0]);return this}for(var h=0,i=f.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();d(f[h])[b](j),e=e.concat(j)}return this.pushStack(e,a,f.selector)}}),d.extend({clone:function(a,b,c){var e=a.cloneNode(!0),f,g,h;if((!d.support.noCloneEvent||!d.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!d.isXMLDoc(a)){ba(a,e),f=bb(a),g=bb(e);for(h=0;f[h];++h)ba(f[h],g[h])}if(b){_(a,e);if(c){f=bb(a),g=bb(e);for(h=0;f[h];++h)_(f[h],g[h])}}return e},clean:function(a,b,e,f){b=b||c,typeof b.createElement==="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var g=[];for(var h=0,i;(i=a[h])!=null;h++){typeof i==="number"&&(i+="");if(!i)continue;if(typeof i!=="string"||W.test(i)){if(typeof i==="string"){i=i.replace(T,"<$1></$2>");var j=(U.exec(i)||["",""])[1].toLowerCase(),k=Z[j]||Z._default,l=k[0],m=b.createElement("div");m.innerHTML=k[1]+i+k[2];while(l--)m=m.lastChild;if(!d.support.tbody){var n=V.test(i),o=j==="table"&&!n?m.firstChild&&m.firstChild.childNodes:k[1]==="<table>"&&!n?m.childNodes:[];for(var p=o.length-1;p>=0;--p)d.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!d.support.leadingWhitespace&&S.test(i)&&m.insertBefore(b.createTextNode(S.exec(i)[0]),m.firstChild),i=m.childNodes}}else i=b.createTextNode(i);i.nodeType?g.push(i):g=d.merge(g,i)}if(e)for(h=0;g[h];h++)!f||!d.nodeName(g[h],"script")||g[h].type&&g[h].type.toLowerCase()!=="text/javascript"?(g[h].nodeType===1&&g.splice.apply(g,[h+1,0].concat(d.makeArray(g[h].getElementsByTagName("script")))),e.appendChild(g[h])):f.push(g[h].parentNode?g[h].parentNode.removeChild(g[h]):g[h]);return g},cleanData:function(a){var b,c,e=d.cache,f=d.expando,g=d.event.special,h=d.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&d.noData[j.nodeName.toLowerCase()])continue;c=j[d.expando];if(c){b=e[c]&&e[c][f];if(b&&b.events){for(var k in b.events)g[k]?d.event.remove(j,k):d.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[d.expando]:j.removeAttribute&&j.removeAttribute(d.expando),delete e[c]}}}});var bd=/alpha\([^)]*\)/i,be=/opacity=([^)]*)/,bf=/-([a-z])/ig,bg=/([A-Z]|^ms)/g,bh=/^-?\d+(?:px)?$/i,bi=/^-?\d/,bj={position:"absolute",visibility:"hidden",display:"block"},bk=["Left","Right"],bl=["Top","Bottom"],bm,bn,bo,bp=function(a,b){return b.toUpperCase()};d.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return d.access(this,a,c,!0,function(a,c,e){return e!==b?d.style(a,c,e):d.css(a,c)})},d.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bm(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{"float":d.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,e,f){if(a&&a.nodeType!==3&&a.nodeType!==8&&a.style){var g,h=d.camelCase(c),i=a.style,j=d.cssHooks[h];c=d.cssProps[h]||h;if(e===b){if(j&&"get"in j&&(g=j.get(a,!1,f))!==b)return g;return i[c]}if(typeof e==="number"&&isNaN(e)||e==null)return;typeof e==="number"&&!d.cssNumber[h]&&(e+="px");if(!j||!("set"in j)||(e=j.set(a,e))!==b)try{i[c]=e}catch(k){}}},css:function(a,c,e){var f,g=d.camelCase(c),h=d.cssHooks[g];c=d.cssProps[g]||g;if(h&&"get"in h&&(f=h.get(a,!0,e))!==b)return f;if(bm)return bm(a,c,g)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bf,bp)}}),d.curCSS=d.css,d.each(["height","width"],function(a,b){d.cssHooks[b]={get:function(a,c,e){var f;if(c){a.offsetWidth!==0?f=bq(a,b,e):d.swap(a,bj,function(){f=bq(a,b,e)});if(f<=0){f=bm(a,b,b),f==="0px"&&bo&&(f=bo(a,b,b));if(f!=null)return f===""||f==="auto"?"0px":f}if(f<0||f==null){f=a.style[b];return f===""||f==="auto"?"0px":f}return typeof f==="string"?f:f+"px"}},set:function(a,b){if(!bh.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),d.support.opacity||(d.cssHooks.opacity={get:function(a,b){return be.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style;c.zoom=1;var e=d.isNaN(b)?"":"alpha(opacity="+b*100+")",f=c.filter||"";c.filter=bd.test(f)?f.replace(bd,e):c.filter+" "+e}}),d(function(){d.support.reliableMarginRight||(d.cssHooks.marginRight={get:function(a,b){var c;d.swap(a,{display:"inline-block"},function(){b?c=bm(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bn=function(a,c,e){var f,g,h;e=e.replace(bg,"-$1").toLowerCase();if(!(g=a.ownerDocument.defaultView))return b;if(h=g.getComputedStyle(a,null))f=h.getPropertyValue(e),f===""&&!d.contains(a.ownerDocument.documentElement,a)&&(f=d.style(a,e));return f}),c.documentElement.currentStyle&&(bo=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bh.test(d)&&bi.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bm=bn||bo,d.expr&&d.expr.filters&&(d.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!d.support.reliableHiddenOffsets&&(a.style.display||d.css(a,"display"))==="none"},d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)});var br=/%20/g,bs=/\[\]$/,bt=/\r?\n/g,bu=/#.*$/,bv=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bw=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bx=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,by=/^(?:GET|HEAD)$/,bz=/^\/\//,bA=/\?/,bB=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bC=/^(?:select|textarea)/i,bD=/\s+/,bE=/([?&])_=[^&]*/,bF=/(^|\-)([a-z])/g,bG=function(a,b,c){return b+c.toUpperCase()},bH=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bI=d.fn.load,bJ={},bK={},bL,bM;try{bL=c.location.href}catch(bN){bL=c.createElement("a"),bL.href="",bL=bL.href}bM=bH.exec(bL.toLowerCase())||[],d.fn.extend({load:function(a,c,e){if(typeof a!=="string"&&bI)return bI.apply(this,arguments);if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var g=a.slice(f,a.length);a=a.slice(0,f)}var h="GET";c&&(d.isFunction(c)?(e=c,c=b):typeof c==="object"&&(c=d.param(c,d.ajaxSettings.traditional),h="POST"));var i=this;d.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?d("<div>").append(c.replace(bB,"")).find(g):c)),e&&i.each(e,[c,b,a])}});return this},serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?d.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bC.test(this.nodeName)||bw.test(this.type))}).map(function(a,b){var c=d(this).val();return c==null?null:d.isArray(c)?d.map(c,function(a,c){return{name:b.name,value:a.replace(bt,"\r\n")}}):{name:b.name,value:c.replace(bt,"\r\n")}}).get()}}),d.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){d.fn[b]=function(a){return this.bind(b,a)}}),d.each(["get","post"],function(a,c){d[c]=function(a,e,f,g){d.isFunction(e)&&(g=g||f,f=e,e=b);return d.ajax({type:c,url:a,data:e,success:f,dataType:g})}}),d.extend({getScript:function(a,c){return d.get(a,b,c,"script")},getJSON:function(a,b,c){return d.get(a,b,c,"json")},ajaxSetup:function(a,b){b?d.extend(!0,a,d.ajaxSettings,b):(b=a,a=d.extend(!0,d.ajaxSettings,b));for(var c in {context:1,url:1})c in b?a[c]=b[c]:c in d.ajaxSettings&&(a[c]=d.ajaxSettings[c]);return a},ajaxSettings:{url:bL,isLocal:bx.test(bM[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":d.parseJSON,"text xml":d.parseXML}},ajaxPrefilter:bO(bJ),ajaxTransport:bO(bK),ajax:function(a,c){function v(a,c,l,n){if(r!==2){r=2,p&&clearTimeout(p),o=b,m=n||"",u.readyState=a?4:0;var q,t,v,w=l?bR(e,u,l):b,x,y;if(a>=200&&a<300||a===304){if(e.ifModified){if(x=u.getResponseHeader("Last-Modified"))d.lastModified[k]=x;if(y=u.getResponseHeader("Etag"))d.etag[k]=y}if(a===304)c="notmodified",q=!0;else try{t=bS(e,w),c="success",q=!0}catch(z){c="parsererror",v=z}}else{v=c;if(!c||a)c="error",a<0&&(a=0)}u.status=a,u.statusText=c,q?h.resolveWith(f,[t,c,u]):h.rejectWith(f,[u,c,v]),u.statusCode(j),j=b,s&&g.trigger("ajax"+(q?"Success":"Error"),[u,e,q?t:v]),i.resolveWith(f,[u,c]),s&&(g.trigger("ajaxComplete",[u,e]),--d.active||d.event.trigger("ajaxStop"))}}typeof a==="object"&&(c=a,a=b),c=c||{};var e=d.ajaxSetup({},c),f=e.context||e,g=f!==e&&(f.nodeType||f instanceof d)?d(f):d.event,h=d.Deferred(),i=d._Deferred(),j=e.statusCode||{},k,l={},m,n,o,p,q,r=0,s,t,u={readyState:0,setRequestHeader:function(a,b){r||(l[a.toLowerCase().replace(bF,bG)]=b);return this},getAllResponseHeaders:function(){return r===2?m:null},getResponseHeader:function(a){var c;if(r===2){if(!n){n={};while(c=bv.exec(m))n[c[1].toLowerCase()]=c[2]}c=n[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){r||(e.mimeType=a);return this},abort:function(a){a=a||"abort",o&&o.abort(a),v(0,a);return this}};h.promise(u),u.success=u.done,u.error=u.fail,u.complete=i.done,u.statusCode=function(a){if(a){var b;if(r<2)for(b in a)j[b]=[j[b],a[b]];else b=a[u.status],u.then(b,b)}return this},e.url=((a||e.url)+"").replace(bu,"").replace(bz,bM[1]+"//"),e.dataTypes=d.trim(e.dataType||"*").toLowerCase().split(bD),e.crossDomain==null&&(q=bH.exec(e.url.toLowerCase()),e.crossDomain=q&&(q[1]!=bM[1]||q[2]!=bM[2]||(q[3]||(q[1]==="http:"?80:443))!=(bM[3]||(bM[1]==="http:"?80:443)))),e.data&&e.processData&&typeof e.data!=="string"&&(e.data=d.param(e.data,e.traditional)),bP(bJ,e,c,u);if(r===2)return!1;s=e.global,e.type=e.type.toUpperCase(),e.hasContent=!by.test(e.type),s&&d.active++===0&&d.event.trigger("ajaxStart");if(!e.hasContent){e.data&&(e.url+=(bA.test(e.url)?"&":"?")+e.data),k=e.url;if(e.cache===!1){var w=d.now(),x=e.url.replace(bE,"$1_="+w);e.url=x+(x===e.url?(bA.test(e.url)?"&":"?")+"_="+w:"")}}if(e.data&&e.hasContent&&e.contentType!==!1||c.contentType)l["Content-Type"]=e.contentType;e.ifModified&&(k=k||e.url,d.lastModified[k]&&(l["If-Modified-Since"]=d.lastModified[k]),d.etag[k]&&(l["If-None-Match"]=d.etag[k])),l.Accept=e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+(e.dataTypes[0]!=="*"?", */*; q=0.01":""):e.accepts["*"];for(t in e.headers)u.setRequestHeader(t,e.headers[t]);if(e.beforeSend&&(e.beforeSend.call(f,u,e)===!1||r===2)){u.abort();return!1}for(t in {success:1,error:1,complete:1})u[t](e[t]);o=bP(bK,e,c,u);if(o){u.readyState=1,s&&g.trigger("ajaxSend",[u,e]),e.async&&e.timeout>0&&(p=setTimeout(function(){u.abort("timeout")},e.timeout));try{r=1,o.send(l,v)}catch(y){status<2?v(-1,y):d.error(y)}}else v(-1,"No Transport");return u},param:function(a,c){var e=[],f=function(a,b){b=d.isFunction(b)?b():b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=d.ajaxSettings.traditional);if(d.isArray(a)||a.jquery&&!d.isPlainObject(a))d.each(a,function(){f(this.name,this.value)});else for(var g in a)bQ(g,a[g],c,f);return e.join("&").replace(br,"+")}}),d.extend({active:0,lastModified:{},etag:{}});var bT=d.now(),bU=/(\=)\?(&|$)|\?\?/i;d.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return d.expando+"_"+bT++}}),d.ajaxPrefilter("json jsonp",function(b,c,e){var f=typeof b.data==="string";if(b.dataTypes[0]==="jsonp"||c.jsonpCallback||c.jsonp!=null||b.jsonp!==!1&&(bU.test(b.url)||f&&bU.test(b.data))){var g,h=b.jsonpCallback=d.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2",m=function(){a[h]=i,g&&d.isFunction(i)&&a[h](g[0])};b.jsonp!==!1&&(j=j.replace(bU,l),b.url===j&&(f&&(k=k.replace(bU,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},e.then(m,m),b.converters["script json"]=function(){g||d.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),d.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){d.globalEval(a);return a}}}),d.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),d.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var bV=d.now(),bW,bX;d.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&bZ()||b$()}:bZ,bX=d.ajaxSettings.xhr(),d.support.ajax=!!bX,d.support.cors=bX&&"withCredentials"in bX,bX=b,d.support.ajax&&d.ajaxTransport(function(a){if(!a.crossDomain||d.support.cors){var c;return{send:function(e,f){var g=a.xhr(),h,i;a.username?g.open(a.type,a.url,a.async,a.username,a.password):g.open(a.type,a.url,a.async);if(a.xhrFields)for(i in a.xhrFields)g[i]=a.xhrFields[i];a.mimeType&&g.overrideMimeType&&g.overrideMimeType(a.mimeType),!a.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(i in e)g.setRequestHeader(i,e[i])}catch(j){}g.send(a.hasContent&&a.data||null),c=function(e,i){var j,k,l,m,n;try{if(c&&(i||g.readyState===4)){c=b,h&&(g.onreadystatechange=d.noop,delete bW[h]);if(i)g.readyState!==4&&g.abort();else{j=g.status,l=g.getAllResponseHeaders(),m={},n=g.responseXML,n&&n.documentElement&&(m.xml=n),m.text=g.responseText;try{k=g.statusText}catch(o){k=""}j||!a.isLocal||a.crossDomain?j===1223&&(j=204):j=m.text?200:404}}}catch(p){i||f(-1,p)}m&&f(j,k,m,l)},a.async&&g.readyState!==4?(bW||(bW={},bY()),h=bV++,g.onreadystatechange=bW[h]=c):c()},abort:function(){c&&c(0,1)}}}});var b_={},ca=/^(?:toggle|show|hide)$/,cb=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cc,cd=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];d.fn.extend({show:function(a,b,c){var e,f;if(a||a===0)return this.animate(ce("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)e=this[g],f=e.style.display,!d._data(e,"olddisplay")&&f==="none"&&(f=e.style.display=""),f===""&&d.css(e,"display")==="none"&&d._data(e,"olddisplay",cf(e.nodeName));for(g=0;g<h;g++){e=this[g],f=e.style.display;if(f===""||f==="none")e.style.display=d._data(e,"olddisplay")||""}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ce("hide",3),a,b,c);for(var e=0,f=this.length;e<f;e++){var g=d.css(this[e],"display");g!=="none"&&!d._data(this[e],"olddisplay")&&d._data(this[e],"olddisplay",g)}for(e=0;e<f;e++)this[e].style.display="none";return this},_toggle:d.fn.toggle,toggle:function(a,b,c){var e=typeof a==="boolean";d.isFunction(a)&&d.isFunction(b)?this._toggle.apply(this,arguments):a==null||e?this.each(function(){var b=e?a:d(this).is(":hidden");d(this)[b?"show":"hide"]()}):this.animate(ce("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,e){var f=d.speed(b,c,e);if(d.isEmptyObject(a))return this.each(f.complete);return this[f.queue===!1?"each":"queue"](function(){var b=d.extend({},f),c,e=this.nodeType===1,g=e&&d(this).is(":hidden"),h=this;for(c in a){var i=d.camelCase(c);c!==i&&(a[i]=a[c],delete a[c],c=i);if(a[c]==="hide"&&g||a[c]==="show"&&!g)return b.complete.call(this);if(e&&(c==="height"||c==="width")){b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(d.css(this,"display")==="inline"&&d.css(this,"float")==="none")if(d.support.inlineBlockNeedsLayout){var j=cf(this.nodeName);j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)}else this.style.display="inline-block"}d.isArray(a[c])&&((b.specialEasing=b.specialEasing||{})[c]=a[c][1],a[c]=a[c][0])}b.overflow!=null&&(this.style.overflow="hidden"),b.curAnim=d.extend({},a),d.each(a,function(c,e){var f=new d.fx(h,b,c);if(ca.test(e))f[e==="toggle"?g?"show":"hide":e](a);else{var i=cb.exec(e),j=f.cur();if(i){var k=parseFloat(i[2]),l=i[3]||(d.cssNumber[c]?"":"px");l!=="px"&&(d.style(h,c,(k||1)+l),j=(k||1)/f.cur()*j,d.style(h,c,j+l)),i[1]&&(k=(i[1]==="-="?-1:1)*k+j),f.custom(j,k,l)}else f.custom(j,e,"")}});return!0})},stop:function(a,b){var c=d.timers;a&&this.queue([]),this.each(function(){for(var a=c.length-1;a>=0;a--)c[a].elem===this&&(b&&c[a](!0),c.splice(a,1))}),b||this.dequeue();return this}}),d.each({slideDown:ce("show",1),slideUp:ce("hide",1),slideToggle:ce("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){d.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),d.extend({speed:function(a,b,c){var e=a&&typeof a==="object"?d.extend({},a):{complete:c||!c&&b||d.isFunction(a)&&a,duration:a,easing:c&&b||b&&!d.isFunction(b)&&b};e.duration=d.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in d.fx.speeds?d.fx.speeds[e.duration]:d.fx.speeds._default,e.old=e.complete,e.complete=function(){e.queue!==!1&&d(this).dequeue(),d.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig||(b.orig={})}}),d.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(d.fx.step[this.prop]||d.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=d.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function g(a){return e.step(a)}var e=this,f=d.fx;this.startTime=d.now(),this.start=a,this.end=b,this.unit=c||this.unit||(d.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&d.timers.push(g)&&!cc&&(cc=setInterval(f.tick,f.interval))},show:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),d(this.elem).show()},hide:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=d.now(),c=!0;if(a||b>=this.options.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),this.options.curAnim[this.prop]=!0;for(var e in this.options.curAnim)this.options.curAnim[e]!==!0&&(c=!1);if(c){if(this.options.overflow!=null&&!d.support.shrinkWrapBlocks){var f=this.elem,g=this.options;d.each(["","X","Y"],function(a,b){f.style["overflow"+b]=g.overflow[a]})}this.options.hide&&d(this.elem).hide();if(this.options.hide||this.options.show)for(var h in this.options.curAnim)d.style(this.elem,h,this.options.orig[h]);this.options.complete.call(this.elem)}return!1}var i=b-this.startTime;this.state=i/this.options.duration;var j=this.options.specialEasing&&this.options.specialEasing[this.prop],k=this.options.easing||(d.easing.swing?"swing":"linear");this.pos=d.easing[j||k](this.state,i,0,1,this.options.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update();return!0}},d.extend(d.fx,{tick:function(){var a=d.timers;for(var b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||d.fx.stop()},interval:13,stop:function(){clearInterval(cc),cc=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){d.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),d.expr&&d.expr.filters&&(d.expr.filters.animated=function(a){return d.grep(d.timers,function(b){return a===b.elem}).length});var cg=/^t(?:able|d|h)$/i,ch=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?d.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,g=f.documentElement;if(!c||!d.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=f.body,i=ci(f),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||d.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||d.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:d.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);d.offset.initialize();var c,e=b.offsetParent,f=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(d.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===e&&(l+=b.offsetTop,m+=b.offsetLeft,d.offset.doesNotAddBorder&&(!d.offset.doesAddBorderForTableAndCells||!cg.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),f=e,e=b.offsetParent),d.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;d.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},d.offset={initialize:function(){var a=c.body,b=c.createElement("div"),e,f,g,h,i=parseFloat(d.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";d.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),e=b.firstChild,f=e.firstChild,h=e.nextSibling.firstChild.firstChild,this.doesNotAddBorder=f.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,f.style.position="fixed",f.style.top="20px",this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15,f.style.position=f.style.top="",e.style.overflow="hidden",e.style.position="relative",this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),d.offset.initialize=d.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;d.offset.initialize(),d.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(d.css(a,"marginTop"))||0,c+=parseFloat(d.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var e=d.css(a,"position");e==="static"&&(a.style.position="relative");var f=d(a),g=f.offset(),h=d.css(a,"top"),i=d.css(a,"left"),j=(e==="absolute"||e==="fixed")&&d.inArray("auto",[h,i])>-1,k={},l={},m,n;j&&(l=f.position()),m=j?l.top:parseInt(h,10)||0,n=j?l.left:parseInt(i,10)||0,d.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):f.css(k)}},d.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),e=ch.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(d.css(a,"marginTop"))||0,c.left-=parseFloat(d.css(a,"marginLeft"))||0,e.top+=parseFloat(d.css(b[0],"borderTopWidth"))||0,e.left+=parseFloat(d.css(b[0],"borderLeftWidth"))||0;return{top:c.top-e.top,left:c.left-e.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&(!ch.test(a.nodeName)&&d.css(a,"position")==="static"))a=a.offsetParent;return a})}}),d.each(["Left","Top"],function(a,c){var e="scroll"+c;d.fn[e]=function(c){var f=this[0],g;if(!f)return null;if(c!==b)return this.each(function(){g=ci(this),g?g.scrollTo(a?d(g).scrollLeft():c,a?c:d(g).scrollTop()):this[e]=c});g=ci(f);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:d.support.boxModel&&g.document.documentElement[e]||g.document.body[e]:f[e]}}),d.each(["Height","Width"],function(a,c){var e=c.toLowerCase();d.fn["inner"+c]=function(){return this[0]?parseFloat(d.css(this[0],e,"padding")):null},d.fn["outer"+c]=function(a){return this[0]?parseFloat(d.css(this[0],e,a?"margin":"border")):null},d.fn[e]=function(a){var f=this[0];if(!f)return a==null?null:this;if(d.isFunction(a))return this.each(function(b){var c=d(this);c[e](a.call(this,b,c[e]()))});if(d.isWindow(f)){var g=f.document.documentElement["client"+c];return f.document.compatMode==="CSS1Compat"&&g||f.document.body["client"+c]||g}if(f.nodeType===9)return Math.max(f.documentElement["client"+c],f.body["scroll"+c],f.documentElement["scroll"+c],f.body["offset"+c],f.documentElement["offset"+c]);if(a===b){var h=d.css(f,e),i=parseFloat(h);return d.isNaN(i)?h:i}return this.css(e,typeof a==="string"?a:a+"px")}}),a.jQuery=a.$=d})(window);
\ No newline at end of file
diff --git a/load-dialog.js b/load-dialog.js
deleted file mode 100644
index 35160be..0000000
--- a/load-dialog.js
+++ /dev/null
@@ -1,131 +0,0 @@
-// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview This file contains implementation for the load dialog.
- */
-
-/**
- * Namespace for load dialog.
- */
-var loadDialog = {};
-
-/**
- * Called to initialize the load dialog.
- */
-loadDialog.init = function() {
-  $('#load-file-form', '#load-dialog')[0].reset();
-  $('#apply-errors', '#load-dialog').html('');
-  $('#apply-warnings', '#load-dialog').html('');
-  var applyButton = $('#apply-button', '#load-dialog');
-  applyButton.click(loadDialog.onApplyPress);
-  main.disableInput(applyButton);
-  // Reset the file picker.
-  ui.resetFilePicker('#load-file');
-  loadDialog.configureLoadFilePicker();
-  $('#load-file').focus();
-};
-
-loadDialog.setUiVisibility = function() {
-  return;
-};
-
-/**
- * Load the given ONC configuration and show any errors in errorDom.
- * @param {String} config  ONC formatted string.
- */
-loadDialog.loadConfig = function(configString) {
-  var passphrase = $('#load-passphrase', '#load-dialog');
-  var result = { 'errors': [], 'warnings': [], 'hasOpaqueEntity': false };
-  // Check and see if the config is encrypted or not, and decrypt it
-  // using the passphrase if it is.
-  var config;
-  try {
-    config = JSON.parse(configString);
-  } catch(e) {
-    result.errors.push(['errorDuringLoad', e.toString()]);
-  }
-  if (!result.errors.length && onc.isEncrypted(config)) {
-    result = onc.validateEncryptedConfiguration(config, result);
-    if (!result.errors.length) {
-      try {
-        config = onc.decryptConfig(passphrase.val(), config);
-      } catch(e) {
-        result.errors.push(['errorDuringLoad', e.toString()]);
-      }
-    }
-  }
-  if (!result.errors.length && typeof(config) != 'object') {
-    result.errors.push(['errorLoadUnknown']);
-  }
-  if (!result.errors.length) {
-    result = onc.validateUnencryptedConfiguration(config, result);
-  }
-
-  // Display the errors we found (if any)
-  if (result.errors.length == 0) {
-    $('#apply-header', '#load-dialog').html(chrome.i18n.getMessage
-                                            ('loadSucceeded'));
-  } else {
-    // Clear everything out if we had errors.
-    $('#load-file-form')[0].reset();
-  }
-  ui.showMessages(result, '#load-dialog');
-
-  loadDialog.oncToLoad = config;
-  loadDialog.oncToLoadResult  = result;
-};
-
-/**
- * Handle ONC file load event.
- * @param {Array.<Object>} files  Array of files in file upload format.
- * @returns {Boolean}  Indicates the event needs to be passed to other objects.
- */
-loadDialog.handleLoadFile = function(files) {
-  var applyButton = $('#apply-button', '#load-dialog');
-  $('#apply-errors').html('');
-  for (var i = 0; i < files.length; ++i) {
-    var file = files[i];
-    var reader = new FileReader();
-    reader.onload = function(theFile) {
-      // Enable the Load File button when done reading from disk.
-      loadDialog.oncToLoad = this.result;
-      $('#apply-errors', '#load-dialog').html('');
-      $('#apply-warnings', '#load-dialog').html('');
-      main.enableInput(applyButton);
-    };
-    reader.readAsBinaryString(file);
-  }
-  return false;
-};
-
-/**
- * Configures the ONC load file picker.
- */
-loadDialog.configureLoadFilePicker = function() {
-  $('#load-file').change(function(event) {
-    loadDialog.handleLoadFile(event.target.files);
-  });
-};
-
-/**
- * Handles apply button press in load dialog.
- */
-loadDialog.onApplyPress = function() {
-  loadDialog.loadConfig(loadDialog.oncToLoad);
-  // Ignore apply button if nothing was loaded or there are errors.
-  if (!loadDialog.oncToLoadResult || loadDialog.oncToLoadResult.errors.length) {
-    // Clear the filename and passphrase out if we had errors.
-    $('#load-file-form')[0].reset();
-    main.disableInput($('#apply-button', '#load-dialog'));
-    ui.showMessages(loadDialog.oncToLoadResult, '#load-dialog');
-    return;
-  }
-  main.oncCurrent = loadDialog.oncToLoad;
-  main.externalEntitySet = onc.getEntitySet(main.oncCurrent);
-  loadDialog.oncToLoad = undefined;
-  loadDialog.oncToLoadResult = undefined;
-  ui.dismissDialog();
-};
-
diff --git a/main.html b/main.html
deleted file mode 100644
index 43b8239..0000000
--- a/main.html
+++ /dev/null
@@ -1,743 +0,0 @@
-<!-- Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
-  -- Use of this source code is governed by a BSD-style license that can be
-  -- found in the LICENSE file. -->
-
-<html>
-<head>
-  <script type="text/javascript" src="jquery-1.5.2.min.js"></script>
-  <script type="text/javascript"
-          src="crypto-js/crypto-sha1-hmac-pbkdf2-blockmodes-aes.js"></script>
-
-  <script type="text/javascript" src="asn1.js"></script>
-  <script type="text/javascript" src="base64.js"></script>
-  <script type="text/javascript" src="base64_encode.js"></script>
-  <script type="text/javascript" src="cert-dialog.js"></script>
-  <script type="text/javascript" src="download-dialog.js"></script>
-  <script type="text/javascript" src="load-dialog.js"></script>
-  <script type="text/javascript" src="network-dialog.js"></script>
-  <script type="text/javascript" src="onc.js"></script>
-  <script type="text/javascript" src="remove-dialog.js"></script>
-  <script type="text/javascript" src="save-request-dialog.js"></script>
-  <script type="text/javascript" src="ui.js"></script>
-  <script type="text/javascript" src="vpn-dialog.js"></script>
-  <script type="text/javascript" src="wifi-dialog.js"></script>
-
-  <style>
-    body {
-      -webkit-user-select: none;
-      font-family: 'Chrome Droid Sans', sans-serif;
-      font-size: 10pt;
-    }
-    input[type='password'],
-    input[type='text'],
-    input[type='url'],
-    input:not([type]) {
-      -webkit-border-radius: 2px;
-      border: 1px solid #aaa;
-      font-size: inherit;
-      padding: 3px;
-    }
-    /* SELECT */
-    select {
-      -webkit-appearance: button;
-      -webkit-border-radius: 2px;
-      -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1);
-      -webkit-padding-end: 20px;
-      -webkit-padding-start: 2px;
-      -webkit-user-select: none;
-      background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAYAAAAbQcSUAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sCDwEnBT3jKacAAABaSURBVCjPY2CgA4gC4jQ8OIpokxKBgJmZ+RuQ+R8dg8RB8kQb9v//f4UFCxYsZGNj+4lsEIgPEgfJk+RPdAPJNgjdQD4+vi8UGYRs4Nu3b5soNgjJQFZi1AEAhHNE/wdnPVcAAAAASUVORK5CYII="), -webkit-linear-gradient(#fafafa, #f4f4f4 40%, #e5e5e5);
-      background-position: center right;
-      background-repeat: no-repeat;
-      border: 1px solid #aaa;
-      color: #555;
-      font-size: inherit;
-      margin: 0;
-      overflow: hidden;
-      padding-top: 2px;
-      padding-bottom: 2px;
-      text-overflow: ellipsis;
-      white-space: nowrap;
-    }
-    select:hover {
-      -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2);
-      background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAYAAAAbQcSUAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sCDwEnBT3jKacAAABaSURBVCjPY2CgA4gC4jQ8OIpokxKBgJmZ+RuQ+R8dg8RB8kQb9v//f4UFCxYsZGNj+4lsEIgPEgfJk+RPdAPJNgjdQD4+vi8UGYRs4Nu3b5soNgjJQFZi1AEAhHNE/wdnPVcAAAAASUVORK5CYII="), -webkit-linear-gradient(#fefefe, #f8f8f8 40%, #e9e9e9);
-      color: #333;
-    }
-    select:active {
-      -webkit-box-shadow: inset 0px 1px 3px rgba(0, 0, 0, 0.2);
-      background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAICAYAAAAbQcSUAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sCDwEnBT3jKacAAABaSURBVCjPY2CgA4gC4jQ8OIpokxKBgJmZ+RuQ+R8dg8RB8kQb9v//f4UFCxYsZGNj+4lsEIgPEgfJk+RPdAPJNgjdQD4+vi8UGYRs4Nu3b5soNgjJQFZi1AEAhHNE/wdnPVcAAAAASUVORK5CYII="), -webkit-linear-gradient(#f4f4f4, #efefef 40%, #dcdcdc);
-      color: #444;
-    }
-    /* CHECKBOX, RADIO */
-    input[type=checkbox],
-    input[type=radio] {
-      margin-left: 0;
-      margin-right: 0;
-      position: relative;
-      top: 1px;
-    }
-    button,
-    input[type='button'],
-    input[type='submit'] {
-      -webkit-border-radius: 2px;
-      -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1);
-      -webkit-user-select: none;
-      background: -webkit-linear-gradient(#fafafa, #f4f4f4 40%, #e5e5e5);
-      border: 1px solid #aaa;
-      color: #444;
-      font-size: inherit;
-      margin-bottom: 0px;
-      min-width: 4em;
-      padding: 3px 12px 3px 12px;
-    }
-    #left-pane {
-      background: -webkit-linear-gradient(rgba(234, 238, 243, 0.2), #eaeef3),
-                  -webkit-linear-gradient(left, #eaeef3, #eaeef3 97%, #d3d7db);
-      bottom:0;
-      left:0;
-      overflow:auto;
-      position:absolute;
-      top:0;
-      width:216px;
-      -webkit-border-end: 1px solid #c6c9ce;
-    }
-    .left-item {
-      border-bottom: 1px solid transparent;
-      border-top: 1px solid transparent;
-      color: #426dc9;
-      cursor: pointer;
-      display: block;
-      font-size: 105%;
-      outline: none;
-      padding: 7px 0;
-      text-align: end;
-      text-shadow: white 0 1px 1px;
-      -webkit-padding-end: 24px;
-    }
-    .selected {
-      border-top: 1px solid black;
-      border-bottom: 1px solid black;
-      text-shadow: white 0 1px 1px;
-    }
-    #right-pane {
-      bottom:5px;
-      left:230px;
-      overflow:auto;
-      position:absolute;
-      padding: 0 24px;
-      right:5px;
-      top:5px;
-    }
-    #overlay {
-      -webkit-box-align: center;
-      -webkit-box-orient: vertical;
-      -webkit-box-pack: center;
-      -webkit-transition: 0.25s opacity;
-      background: -webkit-radial-gradient(rgba(127, 127, 127, 0.5),
-                                          rgba(127, 127, 127, 0.5) 35%,
-                                          rgba(0, 0, 0, 0.7));
-      bottom: 0;
-      display:none;
-      left: 0;
-      overflow: auto;
-      padding: 20px;
-      padding-bottom: 130px;
-      position: fixed;
-      right: 0;
-      top: 0;
-      z-index: 10;
-    }
-    .modal-dialog {
-      -webkit-box-shadow: 0px 5px 80px #505050;
-      background: white;
-      border: 1px solid rgb(188, 193, 208);
-      border-radius: 2px;
-      display: none;
-      min-width: 600px;
-      padding: 0;
-      position: relative;
-      z-index: 11;
-    }
-    .modal-dialog .content {
-      padding: 10px 15px 5px 15px;
-    }
-    .action-area {
-      -webkit-box-align: center;
-      -webkit-box-orient: horizontal;
-      -webkit-box-pack: end;
-      border-top: 1px solid rgba(188, 193, 208, .5);
-      display: -webkit-box;
-      padding: 12px;
-    }
-    .entity-list {
-      -webkit-box-flex: 1;
-      display: table-cell;
-      width: 100%;
-    }
-    .entity {
-      -webkit-box-align: center;
-      -webkit-padding-start: 30px;
-      border: 1px solid rgba(255,255,255,0);
-      border-radius: 2px;
-      display: none;
-      min-height: 35px;
-    }
-    .entity:hover {
-      border-color: hsl(214, 91%, 85%);
-      background-color: hsl(214,91%, 97%);
-    }
-    .entity .action {
-      display: none;
-    }
-    .entity .left {
-      display: table-cell;
-    }
-    .entity .name {
-      font-weight: bold
-    }
-    .entity #warning-mark {
-      -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.8);
-      display: none;
-      background-color: yellow;
-      border-color: black;
-      border-radius: 2px;
-      color: black;
-      font-weight: bold;
-      margin-left: 10px;
-      padding: 5px;
-    }
-    .entity #error-mark {
-      -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.8);
-      display: none;
-      background-color: red;
-      border-color: black;
-      border-radius: 2px;
-      color: black;
-      font-weight: bold;
-      margin-left: 10px;
-      padding: 5px;
-    }
-    .entity #mark-removal-mark {
-      color: #ff0000;
-      display: none;
-    }
-    .spacer {
-      -webkit-box-flex: 1;
-    }
-    #cert-box {
-      -webkit-box-shadow: 2px 2px 2px rgba(0,0,0,.1);
-      -webkit-border-radius: 2;
-      border: 1px solid #D0D0D0;
-      margin-bottom: 20px;
-      margin-top: 20px;
-      min-height: 200px;
-      padding: 20px;
-    }
-    #cert-instructions {
-      max-width:400px;
-    }
-    .cert-header {
-      font-weight: bold;
-    }
-    #cert-summary td {
-      font-size: 75%;
-      padding-left: 20px;
-    }
-    #cert-summary table {
-      padding-bottom: 20px;
-    }
-    #apply-errors {
-      color: #ff0000;
-      max-width:100%;
-    }
-    #apply-warnings {
-      color: #807000;
-      max-width:100%;
-    }
-    #apply-header {
-      color: #008000;
-      max-width:100%;
-    }
-    .modal-dialog h1 {
-      background: -webkit-linear-gradient(white, #F8F8F8);
-      border-bottom: 1px solid rgba(188, 193, 208, .5);
-      font-size: 105%;
-      font-weight: bold;
-      padding: 10px 15px 8px 15px;
-    }
-    .template-section {
-      display: none;
-    }
-    h2 {
-      margin:0;
-      padding-top:10px;
-      font-size:12pt;
-    }
-    #right-pane h1 {
-      -webkit-padding-end: 24px;
-      -webkit-user-select: none;
-      border-bottom: 1px solid #EEE;
-      color: #536370;
-      font-weight: normal;
-      font-size: 200%;
-      margin: 0;
-      padding-bottom: 4px;
-      padding-top: 13px;
-      text-shadow: white 0 1px 2px;
-    }
-    #right-pane h3 {
-      -webkit-padding-end: 10px;
-      display: table-cell;
-      margin: 0;
-      width: 130px;
-    }
-    .summary {
-      -webkit-box-orient: horizontal;
-      border-bottom: 1px solid #EEE;
-      margin-top: 17px;
-      padding-bottom: 20px;
-    }
-    input[type=text] {
-      width: 100%;
-      font-size:10pt;
-    }
-    input[type=password] {
-      width: 100%;
-      font-size:10pt;
-    }
-    select option {
-      width: 100%;
-      line-height:10pt;
-      font-weight: bold;
-    }
-    .help {
-      margin:0px;
-      font-size:10pt;
-      font-weight:normal;
-      max-width:100%;
-      margin-bottom:10px;
-    }
-  </style>
-  <title i18n="extName"></title>
-</head>
-
-<div id="left-pane">
-  <div style="height:50px"></div>
-  <div class="left-item selectable" id="wifi-item" i18n="wifiSettingsTab">
-  </div>
-  <div class="left-item selectable" id="vpn-item" i18n="vpnTab"></div>
-  <div class="left-item selectable" id="cert-item"
-       i18n="certificatesAndTrustTab"></div>
-  <div class="left-item selectable" id="load-item" i18n="loadConfigurationTab">
-  </div>
-  <div class="left-item selectable" id="save-request-item"
-       i18n="downloadConfigurationTab"></div>
-</div>
-
-<div id="right-pane">
-  <h1 i18n="settings">Settings</h1>
-  <div id="network-configurations-area" class="summary">
-    <h3 i18n="networkConfigurations"></h3>
-    <div id="network-configurations" class="entity-list">
-      <div id="template" class="entity">
-        <div id="left" class="left"></div>
-        <div id="error-mark">X</div>
-        <div id="warning-mark">!</div>
-        <div id="mark-removal-mark" i18n="markedForRemovalStatus"></div>
-        <div class="spacer"></div>
-        <div class="action">
-          <button id="edit" i18n="edit"></button>
-          <button id="remove" i18n="remove"></button>
-        </div>
-      </div>
-    </div>
-  </div>
-  <div id="certificates-area" class="summary">
-    <h3 i18n="certificates"></h3>
-    <div id="certificates" class="entity-list">
-      <div id="template" class="entity">
-        <div id="left" class="left"></div>
-        <div id="error-mark">X</div>
-        <div id="warning-mark">!</div>
-        <div id="mark-removal-mark" i18n="markedForRemovalStatus"></div>
-        <div class="spacer"></div>
-        <div class="action">
-          <button id="edit" i18n="edit"></button>
-          <button id="remove" i18n="remove"></button>
-        </div>
-      </div>
-    </div>
-  </div>
-</div>
-
-<div id="overlay">
-<div class="modal-dialog" id="wifi-dialog">
-  <h1 i18n="wifiSettings"></h1>
-
-  <div class="content">
-  <h2 i18n="acronymSsid"></h2>
-  <p class="help" i18n="identificationOfTheWirelessNetwork"></p>
-  <input type="text" id="ssid">
-  <div class="checkable">
-    <input type="checkbox" id="hidden-ssid"></input>
-    <span i18n="thisSsidIsNotBroadcast"></span>
-  </div>
-  <div class="checkable">
-    <input type="checkbox" id="auto-connect"></input>
-    <span i18n="automaticallyConnect"></span>
-  </div>
-  <h2 i18n="securityType"></h2>
-  <p class="help" i18n="helpSecurityType"></p>
-  <select id="security">
-    <option i18n="securityNone" value="None"></option>
-    <option i18n="securityWep" value="WEP-PSK"></option>
-    <option i18n="securityWpa" value="WPA-PSK"></option>
-    <option i18n="securityWpaEnterprise" value="WPA-EAP"></option>
-  </select>
-  <div id="passphrase-div" style="display:none">
-    <h2 i18n="wirelessPassphrase"></h2>
-    <p class="help" i18n="helpWirelessPassphrase"></p>
-    <input type="password" id="passphrase">
-  </div>
-  <div id="8021x-div" style="display:none">
-    <h2 i18n="extensibleAuthenticationProtocol"></h2>
-    <p class="help" i18n="selectTheEapToPermit"></p>
-    <select id="eap">
-      <option i18n="acronymPeap" value="PEAP"></option>
-      <option i18n="acronymEapTtls" value="EAP-TTLS"></option>
-      <option i18n="acronymEapTls" value="EAP-TLS"></option>
-      <option i18n="acronymLeap" value="LEAP"></option>
-    </select>
-    <div id="phase2-div">
-      <h2 i18n="innerProtocol"></h2>
-      <p class="help" i18n="helpInnerProtocol"></p>
-      <select id="phase2">
-        <option i18n="automatic" value="Automatic"></option>
-        <option i18n="acronymEapMschapV2" value="EAP-MSCHAP-V2"></option>
-        <option i18n="acronymEapMd5" value="EAP-MD5"></option>
-        <option i18n="acronymEapPap" value="EAP-PAP"></option>
-      </select>
-    </div>
-    <div id="phase2-auth">
-      <div class="checkable">
-        <input type="checkbox" id="save-credentials"></input>
-        <span i18n="specifyUsernameAndPassword"></span>
-      </div>
-      <div id="phase2-auth-cred">
-        <h2 i18n="username"></h2>
-        <p class="help" i18n="helpUsername"></p>
-        <input type="text" id="wifi-identity">
-        <div id="div-password">
-          <h2 i18n="password"></h2>
-          <p class="help" i18n="helpPassword"></p>
-          <input type="password" id="wifi-password">
-        </div>
-      </div>
-    </div>
-    <div id="eap-server-ca">
-      <h2 i18n="serverCertificateAuthority"></h2>
-      <p class="help"
-         i18n="helpServerCertificateAuthority">
-      </p>
-      <select id="wifi-server-ca">
-      </select>
-    </div>
-    <div id="eap-client-cert">
-      <h2 i18n="clientCertificateAuthority"></h2>
-      <p class="help" i18n="helpClientCertificateAuthority"></p>
-      <select id="wifi-client-ca">
-      </select>
-      <h2 i18n="enrollmentUri"></h2>
-      <p class="help" i18n="helpEnrollmentUri"></p>
-      <input id="wifi-enrollment-uri" type="text"></input>
-    </div>
-  </div>
-  <div id="proxy-insertion-point"></div>
-  <input type="text" id="wifi-guid" hidden></input>
-  <div id="apply-header"></div>
-  <div id="apply-errors"></div>
-  <div id="apply-warnings"></div>
-  </div>
-  <div class="action-area">
-    <button id="apply-button" i18n="applySettings"></button>
-    <button id="cancel-button" i18n="cancelSettings"></button>
-  </div>
-</div>
-<div class="modal-dialog" id="vpn-dialog">
-  <h1 i18n="vpnSettings"></h1>
-  <div class="content">
-  <h2 i18n="connectionName"></h2>
-  <p class="help" i18n="helpConnectionName"></p>
-  <input type="text" id="vpn-name">
-  <h2 i18n="remoteHost"></h2>
-  <p class="help" i18n="helpRemoteHost"></p>
-  <input type="text" id="vpn-host">
-  <h2 i18n="vpnType"></h2>
-  <p class="help" i18n="helpVpnType"></p>
-  <select id="vpn-type">
-    <option i18n="l2tpIpsecPsk" value="L2TP-IPsec-PSK"></option>
-    <option i18n="l2tpIpsecCert" value="L2TP-IPsec-Cert"></option>
-    <option i18n="openvpnType" value="OpenVPN"></option>
-  </select>
-  <div id="vpn-psk-div">
-    <h2 i18n="presharedKey"></h2>
-    <p class="help" i18n="helpPresharedKey"></p>
-    <input type="password" id="vpn-psk"></input>
-  </div>
-  <div id="vpn-cert-div">
-    <h2 i18n="serverCertificateAuthority"></h2>
-    <p class="help" i18n="helpServerCertificateAuthority"></p>
-    <select id="vpn-server-ca">
-    </select>
-    <h2 i18n="clientCertificateAuthority"></h2>
-    <p class="help" i18n="helpClientCertificateAuthority"></p>
-    <select id="vpn-client-ca">
-    </select>
-    <h2 i18n="enrollmentUri"></h2>
-    <p class="help" i18n="helpEnrollmentUri"></p>
-    <input id="vpn-enrollment-uri" type="text"></input>
-  </div>
-  <div class="checkable">
-    <input type="checkbox" id="vpn-save-credentials"></input>
-    <span i18n="specifyUsernameAndPassword"></span>
-  </div>
-  <div id="vpn-user-cred">
-    <h2 i18n="username"></h2>
-    <p class="help" i18n="helpUsername"></p>
-    <input id="vpn-username" type="text"></input>
-    <h2 i18n="password"></h2>
-    <p class="help" i18n="helpPassword"></p>
-    <input id="vpn-password" type="password"></input>
-  </div>
-  <div id="proxy-insertion-point"></div>
-  <input type="text" id="vpn-guid" hidden></input>
-  <div id="apply-header"></div>
-  <div id="apply-errors"></div>
-  <div id="apply-warnings"></div>
-  <div class="action-area">
-    <button id="apply-button" i18n="applySettings"></button>
-    <button id="cancel-button" i18n="cancelSettings"></button>
-  </div>
-  </div>
-</div>
-<div class="modal-dialog" id="cert-dialog">
-  <h1 i18n="certificatesAndTrustTab"></h1>
-  <div class="content">
-    <h2 i18n="certificateTab"></h2>
-    <select id="cert-type">
-      <option i18n="certificateTypeClient" value="Client"></option>
-      <option i18n="certificateTypeServer" value="Server"></option>
-      <option i18n="certificateTypeAuthority" value="Authority"></option>
-    </select>
-    <div id="cert-box">
-      <div id="cert-instructions" i18n="dragCertificateHere">
-      </div>
-      <div id="cert-summary">
-        <div id="subject">
-          <div class="cert-header" i18n="X509IssuedTo"></div>
-          <table>
-            <tr>
-              <td i18n="X509CommonName"></td>
-              <td id="commonName" class="cert-fill"></td>
-            </tr>
-            <tr>
-              <td i18n="X509Organization"></td>
-              <td id="organizationName" class="cert-fill"></td>
-            </tr>
-            <tr>
-              <td i18n="X509OrganizationalUnit"></td>
-              <td id="organizationalUnit" class="cert-fill"></td>
-            </tr>
-            <tr>
-              <td i18n="X509SerialNumber"></td>
-              <td id="serialNumber" class="cert-fill"></td>
-            </tr>
-          </table>
-        </div>
-        <div id="issuer">
-          <div class="cert-header" i18n="X509IssuedBy"></div>
-          <table>
-            <tr>
-              <td i18n="X509CommonName"></td>
-              <td id="commonName" class="cert-fill"></td>
-            </tr>
-            <tr>
-              <td i18n="X509Organization"></td>
-              <td id="organizationName" class="cert-fill"></td>
-            </tr>
-            <tr>
-              <td i18n="X509OrganizationalUnit"></td>
-              <td id="organizationalUnit" class="cert-fill"></td>
-            </tr>
-          </table>
-        </div>
-      </div>
-    </div>
-    <div>
-      <input type="file" id="cert-files" />
-    </div>
-    <br/>
-    <div class="checkable">
-      <input type="checkbox" id="web-trust"></input>
-      <span i18n="trustThisCertificateForWeb"></span>
-    </div>
-    <input type="text" id="cert-guid" hidden></input>
-    <div id="apply-header"></div>
-    <div id="apply-errors"></div>
-    <div id="apply-warnings"></div>
-  </div>
-  <div class="action-area">
-    <button id="apply-button" i18n="applySettings"></button>
-    <button id="cancel-button" i18n="cancelSettings"></button>
-  </div>
-</div>
-<div class="modal-dialog" id="load-dialog">
-  <h1 i18n="loadConfigurationTab"></h1>
-  <div class="content">
-    <h2 i18n="loadConfigurationFromFile"></h2>
-    <p class="help" i18n="helpLoadConfigurationFromFile"></p>
-    <br>
-    <form id="load-file-form">
-      <!-- TODO(gspencer): We should fix this UI so that we detect
-           encrypted ONC files and only then show the passphrase
-           field. -->
-      <p class="help" i18n="helpLoadPassphrase"></p>
-      <input type="password" id="load-passphrase"
-             style="max-width:200px;"></input><br/>
-      <input type="file" id="load-file" name="loadFiles" multiple></input>
-    </form>
-    <div id="apply-header"></div>
-    <div id="apply-errors"></div>
-    <br>
-    <div id="apply-warnings"></div>
-  </div>
-  <div class="action-area">
-    <button id="apply-button" i18n="loadFile"></button>
-    <button id="cancel-button" i18n="cancelSettings"></button>
-  </div>
-</div>
-<div class="modal-dialog" id="save-request-dialog">
-  <h1 i18n="saveRequestTab"></h1>
-  <div class="content">
-    <input type="checkbox" id="use-encryption" checked></input>
-    <span i18n="useEncryption"></span><br/>
-    <div id="save-passphrase-div">
-      <h2 i18n="encryptConfigurationFile"></h2>
-      <p class="help" i18n="helpConfigurationPassphrase"></p>
-      <input id="save-passphrase" type="password"
-             style="max-width:200px;"></input>
-      <div id="apply-errors">&nbsp;</div>
-    </div>
-  </div>
-  <div class="action-area">
-    <button id="encrypt-button" i18n="encryptConfiguration"></button>
-    <button id="apply-button" i18n="downloadConfiguration"></button>
-    <button id="cancel-button" i18n="cancelSettings"></button>
-  </div>
-</div>
-<div class="modal-dialog" id="download-dialog">
-  <h1 i18n="downloadConfigurationTab"></h1>
-  <div class="content">
-    <h2 i18n="downloadConfigurationToFile"></h2>
-    <div id="download-link-div">
-      <p class="help" i18n="helpDownloadConfigurationToFile"></p>
-      <a id="download-link" href="about:blank" i18n="downloadLinkText"></a>
-    </div>
-  </div>
-  <div class="action-area">
-    <button id="cancel-button" i18n="doneSettings"></button>
-  </div>
-</div>
-<div class="modal-dialog" id="remove-dialog">
-  <h1 i18n="confirmRemoveMessage"></h1>
-  <div id="remove-content" class="content">
-    <p class="help" id="help-remove-content"></p>
-  </div>
-  <div id="mark-remove-content" class="content">
-    <p class="help" id="help-mark-remove-content"></p>
-  </div>
-  <div>
-  <div class="action-area">
-    <button id="mark-remove-button" i18n="markRemoveButton"></button>
-    <button id="remove-button" i18n="removeButton"></button>
-    <button id="cancel-button" i18n="cancelSettings"></button>
-  </div>
-</div>
-</div>
-
-<!-- template sections copied elsewhere -->
-<div id="proxy-settings-section" class="template-section">
-  <h2 i18n="proxySettings"></h2>
-  <p class="help" i18n="helpProxySettings"></p>
-  <select id="proxy-type">
-    <option i18n="proxyDirect" value="Direct">
-    <option i18n="proxyManual" value="Manual">
-    <option i18n="proxyAutoConfiguration" value="PAC">
-  </select>
-  <div id="proxy-manual-div">
-    <table>
-      <tr>
-        <td>
-          <p class="help" i18n="proxyManualHttp"></p>
-        </td>
-        <td>
-          <input type="text" id="http-proxy-host"></input>
-        </td>
-        <td>
-          <p class="help" i18n="proxyPort"></p>
-        </td>
-        <td>
-          <input type="text" id="http-proxy-port"></input>
-        </td>
-      </tr>
-      <tr>
-        <td>
-          <p class="help" i18n="proxyManualSecureHttp"></p>
-        </td>
-        <td>
-          <input type="text" id="secure-http-proxy-host"></input>
-        </td>
-        <td>
-          <p class="help" i18n="proxyPort"></p>
-        </td>
-        <td>
-          <input type="text" id="secure-http-proxy-port"></input>
-        </td>
-      </tr>
-      <tr>
-        <td>
-          <p class="help" i18n="proxyManualFtp"></p>
-        </td>
-        <td>
-          <input type="text" id="ftp-proxy-host"></input>
-        </td>
-        <td>
-          <p class="help" i18n="proxyPort"></p>
-        </td>
-        <td>
-          <input type="text" id="ftp-proxy-port"></input>
-        </td>
-      </tr>
-      <tr>
-        <td>
-          <p class="help" i18n="proxyManualSocks"></p>
-        </td>
-        <td>
-          <input type="text" id="socks-proxy-host"></input>
-        </td>
-        <td>
-          <p class="help" i18n="proxyPort"></p>
-        </td>
-        <td>
-          <input type="text" id="socks-proxy-port"></input>
-        </td>
-      </tr>
-    </table>
-  </div>
-  <div id="proxy-automatic-div">
-    <p class="help" i18n="helpAutoConfigurationUrl"></p>
-    <input type="text" id="auto-configuration-url"></input>
-  </div>
-</div>
-
-<script type="text/javascript" src="main.js"></script>
diff --git a/main.js b/main.js
deleted file mode 100644
index b0443ae..0000000
--- a/main.js
+++ /dev/null
@@ -1,161 +0,0 @@
-// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview This file contains implementation for the main.html page.
- */
-
-/**
- * Namespace for all other functions in main.js.
- */
-var main = {
-  /**
-   * Current content of onc.  We expect this to be validated when it
-   * is updated and to thus always be valid.  This means at load time
-   * and at "save changes" time in the modal dialogs, it will be
-   * validated.  And it also means that at save time the value can be
-   * written directly out without any further validation.
-   */
-  'externalEntitySet': {
-  },
-  'oncCurrent': {
-    'Type': 'UnencryptedConfiguration',
-    'NetworkConfigurations': [],
-    'Certificates': []
-  }
-};
-
-/**
- * Dictionary from identifier to dialog objects.
- */
-main.dialogs = {
-  'cert': certDialog,
-  'load': loadDialog,
-  'download': downloadDialog,
-  'save-request': saveRequestDialog,
-  'vpn':  vpnDialog,
-  'wifi': wiFiDialog,
-  'remove': removeDialog,
-};
-
-/**
- * Disables an input object (fades it out and disables it).
- * @param {Object} input  The input object to disable.
- */
-main.disableInput = function(input) {
-  input[0].disabled = true;
-  input.fadeTo('fast', 0.50);
-};
-
-/**
- * Enables an input object (fades it in and enables it).
- * @param {Object} input  The input object to enable.
- */
-main.enableInput = function(input) {
-  input[0].disabled = false;
-  input.fadeTo('fast', 1.00);
-};
-
-/**
- * Create GUID.
- * @returns {String}  Returns a GUID string of format
- *                   {XXXXXXXX-XXXX-XXXX-XXXXXXXXXXXXXXXX}.
- */
-main.createGuid = function() {
-  var guidData = new Uint8Array(16);
-  crypto.getRandomValues(guidData);
-  var intervals = [ 4, 2, 2, 8 ];
-  var guid = '{';
-  var offset = 0;
-  for (var i = 0; i < intervals.length; ++i) {
-    if (i > 0)
-      guid += '-';
-    for (var j = 0; j < intervals[i]; ++j) {
-      var hex = guidData[offset].toString(16);
-      if (hex.length == 1)
-        guid += '0';
-      guid += hex;
-      ++offset;
-    }
-  }
-  guid += '}';
-  return guid;
-};
-
-/**
- * Convert a data string into hex representation.
- * @param {String} str  Data string
- * @returns {String}  Hex representation of data string.
- */
-main.toHex = function(str) {
-  var result = '';
-  for (var i = 0; i < str.length; i++) {
-    var byte = str.charCodeAt(i).toString(16);
-    if (byte.length == 1)
-      byte = '0' + byte;
-    result += byte;
-  }
-  return result;
-};
-
-/**
- * Validate the given string is a valid hex number.
- * @param {String} str  Hex string.
- * @returns {Boolean}  Indicates if a valid hex string
- */
-main.isAllHex = function(str) {
-  var allHex = true;
-  var validHexChars = ['a', 'b', 'c', 'd', 'e', 'f',
-                       '0', '1', '2', '3', '4', '5',
-                       '6', '7', '8', '9'];
-  var lowercaseString = str.toLowerCase();
-  for (var i = 0; i < str.length; i++) {
-    if (validHexChars.indexOf(lowercaseString[i]) == -1) {
-      allHex = false;
-      break;
-    }
-  }
-  return allHex;
-};
-
-/**
- * Convert an array of numbers to the equivalent Uint8Array.
- * @param {Array.<Number>} array  Array of numbers to convert.
- * @returns {Uint8Array}  Equivalent Uint8Array.
- */
-main.arrayToUint8Array = function(array) {
-  var uint8array = new Uint8Array(array.length);
-  for (var i = 0; i < array.length; ++i) {
-    uint8array[i] = array[i];
-  }
-  return uint8array;
-};
-
-/**
- * Takes an X509 PEM-formatted certificate and interprets its contents.
- * @param {String} x509  base64 X509 certificate
- * @returns {Object}  Result of asn1.interpretCert on certificate.
- */
-main.interpretCertFromX509Pem = function(x509Pem) {
-  var der = Base64.unarmor(x509Pem);
-  var asn1Data = asn1.parseAsn1(der);
-  return asn1.interpretCert(asn1Data);
-};
-
-$(document).ready(function() {
-  ui.translateText();
-  $('div.selectable').click(function() {
-    var id = $(this)[0].id;
-    var lastDash = id.lastIndexOf('-');
-    if (lastDash != -1) {
-      ui.openDialog(id.slice(0, lastDash));
-    }
-  });
-  // Allow clicking anywhere on the text next to a checkbox to toggle
-  // the checkbox.
-  $('.checkable').mousedown(function(event) {
-    if (event.target.type != 'checkbox')
-      $(':checkbox', this).trigger('click');
-  });
-});
diff --git a/manifest.json b/manifest.json
deleted file mode 100644
index 4d0370f..0000000
--- a/manifest.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-  "app": {
-    "launch": {
-      "local_path": "main.html"
-    }
-  },
-  "default_locale": "en",
-  "description": "__MSG_extDesc__",
-  "name": "__MSG_extName__",
-  "version": "1.1.6"
-  // TODO: Find shippable icons
-}
diff --git a/network-dialog.js b/network-dialog.js
deleted file mode 100644
index a040681..0000000
--- a/network-dialog.js
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * Namespace for any networking (WiFi or VPN) dialog.  Think of this like
- * a base class of wiFiDialog and vpnDialog.
- */
-var networkDialog = {};
-
-/**
- * Initializes the parts of Wi-Fi/VPN dialogs that are shared.
- * @param {Object} derived
- */
-networkDialog.init = function(dialogDom) {
-  networkDialog.dialogDom = dialogDom;
-  var proxyPoint = $('#proxy-insertion-point', dialogDom);
-  // Copy in the proxy template if it's not yet there.
-  if ($('#proxy-settings-section', proxyPoint).length == 0) {
-    proxyPoint.append($('#proxy-settings-section'));
-    $('#proxy-settings-section', proxyPoint).show();
-  }
-  ui.setSelectedI18n($('#proxy-type', proxyPoint), 'proxyDirect');
-  networkDialog.manualProxySettings = [
-    { selectorPrefix: '#http',
-      oncName: 'HTTPProxy' },
-    { selectorPrefix: '#secure-http',
-      oncName: 'SecureHTTPProxy' },
-    { selectorPrefix: '#ftp',
-      oncName: 'FTPProxy' },
-    { selectorPrefix: '#socks',
-      oncName: 'SOCKS' }
-  ];
-  for (var i = 0; i < networkDialog.manualProxySettings.length; ++i) {
-    var setting = networkDialog.manualProxySettings[i];
-    $(setting.selectorPrefix + '-proxy-host').val('');
-    $(setting.selectorPrefix + '-proxy-port').val('');
-  }
-  $('#auto-configuration-url', proxyPoint).val('');
-  $('#proxy-type', proxyPoint).change(function(event) {
-    networkDialog.setUiVisibility();
-  });
-};
-
-/**
- * Sets visibility of common network dialog elements.
- */
-networkDialog.setUiVisibility = function() {
-  var type = $('#proxy-type', networkDialog.dialogDom);
-  if (type.val() == 'Manual')
-    $('#proxy-manual-div', networkDialog.dialogDom).show();
-  else
-    $('#proxy-manual-div', networkDialog.dialogDom).hide();
-  if (type.val() == 'PAC')
-    $('#proxy-automatic-div', networkDialog.dialogDom).show();
-  else
-    $('#proxy-automatic-div', networkDialog.dialogDom).hide();
-};
-
-/**
- * Sets up common network UI based on oncNetwork.
- */
-networkDialog.setToUi = function(oncNetwork) {
-  if ('ProxySettings' in oncNetwork && 'Type' in oncNetwork.ProxySettings) {
-    var oncProxy = oncNetwork.ProxySettings;
-    $('#proxy-type', networkDialog.dialogDom).val(oncProxy.Type);
-    if (oncProxy.Type == 'Direct') {
-    } else if (oncProxy.Type == 'Manual') {
-      for (var i = 0; i < networkDialog.manualProxySettings.length; ++i) {
-        var setting = networkDialog.manualProxySettings[i];
-        $(setting.selectorPrefix + '-proxy-host').val(
-          oncProxy.Manual[setting.oncName].Host)
-        $(setting.selectorPrefix + '-proxy-port').val(
-          oncProxy.Manual[setting.oncName].Port);
-      }
-    } else if (oncProxy.Type == 'PAC') {
-      $('#auto-configuration-url', networkDialog.dialogDom).val(
-        oncProxy.PAC);
-    } else if (oncProxy.Type == 'WPAD') {
-      // WPAD is separately called out in the ONC format, but displayed
-      // here as in Chrome, multiplexed into the Automatic PAC setting
-      // when the PAC URL is empty.
-      $('#proxy-type', networkDialog.dialogDom).val('PAC');
-    }
-  }
-};
-
-/**
- * Reads from the common network UI and stores into oncNetwork.
- * @param {Object} oncNetwork  Network to store into.
- */
-networkDialog.getFromUi = function(oncNetwork) {
-  var dialogDom = networkDialog.dialogDom;
-  var type = $('#proxy-type', dialogDom);
-  var oncProxy = {
-    'Type': type.val()
-  };
-  if (type.val() == 'Manual') {
-    oncProxy.Manual = {};
-    for (var i = 0; i < networkDialog.manualProxySettings.length; ++i) {
-      var setting = networkDialog.manualProxySettings[i];
-      var hostString = $(setting.selectorPrefix + '-proxy-host',
-                         dialogDom).val();
-      var portString = $(setting.selectorPrefix + '-proxy-port',
-                         dialogDom).val();
-      // Skip any empty settings.
-      if (hostString == '' && portString == '')
-        continue;
-      var portVal = portString;
-      // If we cannot preserve value as int, keep it as a string and
-      // get a validation error later.
-      if (parseInt(portVal) == portVal)
-        portVal = parseInt(portVal);
-      oncProxy.Manual[setting.oncName] = { 'Host': hostString,
-                                           'Port': portVal };
-    }
-  } else if (type.val() == 'PAC') {
-    var pacValue = $('#auto-configuration-url', dialogDom).val();
-    if (pacValue == '') {
-      oncProxy.Type = 'WPAD';
-    } else {
-      oncProxy.PAC = pacValue;
-    }
-  }
-  oncNetwork.ProxySettings = oncProxy;
-};
-
-
diff --git a/onc.js b/onc.js
deleted file mode 100644
index 7b69fbc..0000000
--- a/onc.js
+++ /dev/null
@@ -1,805 +0,0 @@
-// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview This file contains implementation for Open Network
- * Configuration format querying and manipulation.
- *
- * See http://dev.chromium.org/chromium-os/chromiumos-design-docs/open-network-configuration.
- */
-
-/**
- * Namespace for ONC manipulation.
- */
-var onc = {};
-
-/**
- * Create an onc blob based on the input onc blob, updating with the
- * given entity.  The entities within the blob will be references to
- * (not copies of) the original blob and entity.
- * @param {Object} entity  ONC entity to use as a replacement
- * @param {Object} type  Either NetworkConfigurations or Certificates.
- * @param {Object} oncData  ONC to update
- * @returns {Boolean}  Indicates if successful.
- */
-onc.createUpdate = function(entity, type, oncData) {
-  if (oncData == null)
-    oncData = main.oncCurrent;
-  var resultOnc = {
-    'NetworkConfigurations': [],
-    'Certificates': []
-  };
-  resultOnc.NetworkConfigurations = oncData.NetworkConfigurations.slice(0);
-  resultOnc.Certificates = oncData.Certificates.slice(0);
-  if (!('GUID' in entity)) {
-    // Issue warning?
-    return resultOnc;
-  }
-  function replaceGuid(array) {
-    for (var i = 0; i < array.length; ++i) {
-      if (array[i].GUID == entity.GUID) {
-        array[i] = entity;
-        return;
-      }
-    }
-    array.push(entity);
-  }
-  if (type == 'NetworkConfigurations')
-    replaceGuid(resultOnc.NetworkConfigurations);
-  if (type == 'Certificates')
-    replaceGuid(resultOnc.Certificates);
-  return resultOnc;
-};
-
-/**
- * Create an empty associative array (JSON object) in the given ONC
- * object.  If there is already one, leave it alone.
- * @param {Object} outer  parent ONC object
- * @param {String} newAssocArray  String name of associative array.
- */
-onc.setUpAssocArray = function(outer, newAssocArray) {
-  if (!(newAssocArray in outer) || !(outer[newAssocArray] instanceof Object)) {
-    outer[newAssocArray] = {};
-  }
-};
-
-/**
- * Set up an associative array (JSON object) in the given ONC object.
- * If there is already one, leave it alone.
- * @param {Object} outer  parent ONC object
- * @param {String} newAssocArray  String name of associative array.
- */
-onc.setUpArray = function(outer, newArray) {
-  if (newArray in outer || !(outer[newArray] instanceof Array))
-    outer[newArray] = [];
-};
-
-/**
- * Update array in place so that it has name in it iff value is non-zero.
- * @param {Array} array  input/output array.
- * @param {Scalar} name  name to find in array.
- * @param {Integer} value  value to use to determine if name should appear.
- */
-onc.setBitArray = function(array, name, value) {
-  if (value) {
-    if (array.indexOf(name) < 0)
-      array.push(name);
-  } else {
-    var index = array.indexOf(name);
-    if (index >= 0)
-      array.splice(index, 1);
-  }
-};
-
-/**
- * Returns an associative array of entity GUIDs to "true".  This
- * enables quickly looking up if aan entity is in the given ONC file.
- * @param {Object} onc  ONC file.
- */
-onc.getEntitySet = function(onc) {
-  var map = {};
-  for (var i = 0; i < main.oncCurrent.Certificates.length; ++i) {
-    var oncCert = main.oncCurrent.Certificates[i];
-    map[oncCert.GUID] = true;
-  }
-  for (var i = 0; i < main.oncCurrent.NetworkConfigurations.length; ++i) {
-    var oncNetwork = main.oncCurrent.NetworkConfigurations[i];
-    map[oncNetwork.GUID] = true;
-  }
-  return map;
-};
-
-/**
- * Find a cert in the cert list by GUID.
- * @returns {Integer}  index into certificate array or -1 if not found.
- */
-onc.findCert = function(guid, oncData) {
-  for (var i = 0; i < oncData.Certificates.length; ++i) {
-    if (oncData.Certificates[i].GUID == guid)
-      return i;
-  }
-  return -1;
-};
-
-/**
- * Find a network in the network list by GUID.
- * @returns {Integer}  index into certificate array or -1 if not found.
- */
-onc.findNetwork = function(guid, oncData) {
-  for (var i = 0; i < oncData.NetworkConfigurations.length; ++i) {
-    if (oncData.NetworkConfigurations[i].GUID == guid)
-      return i;
-  }
-  return -1;
-};
-
-/**
- * Finds an entity (a network or certificate) by GUID.
- * @param {String} guid  GUID of entity
- * @param {Object} oncData  ONC data.
- * @returns {Object}  Object containing 'entityList' and 'index'.  entityList
- *                    is the top level list (Certificates or
- *                    NetworkConfigurations).  index is the index into that
- *                    list.  If none is found, return null.
- */
-onc.findEntity = function(guid, oncData) {
-  var index = onc.findCert(guid, oncData);
-  if (index >= 0) {
-    return { 'entityList': 'Certificates', 'index': index };
-  }
-  index = onc.findNetwork(guid, oncData);
-  if (index >= 0) {
-    return { 'entityList': 'NetworkConfigurations',
-             'index': index };
-  }
-  return null;
-};
-
-/**
- * Removes an entity by GUID.  Returns false if entity did not exist.
- * @params {String} guid  GUID of entity (cert or network) to remove.
- * @params {Object} oncData  ONC blob to update.
- * @returns {Boolean}  Indicates if successful.
- */
-onc.removeEntity = function(guid, oncData) {
-  var entityLocation = onc.findEntity(guid, oncData);
-  if (!entityLocation)
-    return false;
-  var array = oncData[entityLocation.entityList];
-  var index = entityLocation.index;
-  array = array.slice(0, index).concat(array.slice(index + 1));
-  oncData[entityLocation.entityList] = array;
-  return true;
-};
-
-/**
- * Marks an entity for removal by GUID.  Entity must already exist.
- * Returns false if entity did not exist.
- * @params {String} guid  GUID of entity (cert or network) to remove.
- * @params {Object} oncData  ONC blob to update.
- * @returns {Boolean}  Indicates if successful.
- */
-onc.markRemoveEntity = function(guid, oncData) {
-  var entityLocation = onc.findEntity(guid, oncData);
-  if (!entityLocation)
-    return false;
-  var entity = oncData[entityLocation.entityList][entityLocation.index];
-  var removeEntity = {
-    'GUID': guid,
-    'Remove': true
-  };
-  if ('Name' in entity) {
-    // Preserve the Name if it exists for better diagnostics.
-    removeEntity.Name = entity.Name;
-  }
-  oncData[entityLocation.entityList][entityLocation.index] = removeEntity;
-  return true;
-};
-
-/**
- * Determines if a entity has already been marked for removal.
- * @params {Object} oncEntity  ONC blob to update.
- * @returns {Boolean}  Indicates if marked for removal.
- */
-onc.isMarkedForRemoval = function(oncEntity) {
-  return ('Remove' in oncEntity && oncEntity.Remove);
-};
-
-/**
- * Validate an ONC Client Certificate.  This handles both the client
- * certificate reference and certificate pattern cases.
- * @param {Object} network  NetworkConfiguration ONC object.
- * @param {Object} result  Result object indicating errors and warnings.
- */
-onc.validateClientCert = function(outer, index, oncData, result) {
-  var network = oncData.NetworkConfigurations[index];
-  if (!('ClientCertType' in outer)) {
-    result.errors.push(['errorLoadRequiredObjectMissing', 'ClientCertType']);
-    return result;
-  }
-
-  if (outer.ClientCertType == 'Ref') {
-    if (!('ClientCertRef' in outer)) {
-      result.errors.push(['errorLoadRequiredObjectMissing', 'ClientCertRef']);
-      return result;
-    }
-    if (onc.findCert(outer.ClientCertRef, oncData) < 0) {
-      result.errors.push(['errorBadCertReference',
-                          network.Name, 'ClientCertRef', outer.ClientCertRef]);
-    }
-  } else if (outer.ClientCertType == 'Pattern') {
-    if (!('ClientCertPattern' in outer)) {
-      result.errors.push(['errorLoadRequiredObjectMissing',
-                          'ClientCertPattern']);
-      return result;
-    }
-    var pattern = outer.ClientCertPattern;
-    if (!('IssuerCARef' in pattern) &&
-        !('Subject' in pattern)) {
-      result.errors.push(['errorMissingClientCA', network.Name]);
-      return result;
-    }
-    if ('IssuerCARef' in pattern &&
-        onc.findCert(pattern.IssuerCARef, oncData) < 0) {
-      result.errors.push(['errorBadCertReference',
-                          network.Name, 'IssuerCARef', pattern.IssuerCARef]);
-    }
-  } else {
-    result.errors.push(['errorLoadRequiredObjectMissing', 'ClientCertType']);
-  }
-  return result;
-};
-
-onc.validateUnencryptedConfiguration = function(oncData, result) {
-  if (!result)
-    result = { 'errors': [], 'warnings': [], 'hasOpaqueEntity': false };
-  var hasOne;
-  for (var field in oncData) {
-    if (field == 'NetworkConfigurations' ||
-        field == 'Certificates') {
-      hasOne = true;
-    } else if (field != 'Type') {
-      result.warnings.push(['warningUnrecognizedTopLevelField', field]);
-    }
-  }
-  if (!hasOne) {
-    result.errors.push(['errorEmptyOnc']);
-  }
-  if (!('Type' in oncData)) {
-    result.warnings.push(['warningConfigurationTypeMissing']);
-  }
-  if ('Type' in oncData && oncData.Type != 'UnencryptedConfiguration') {
-    result.errors.push(['errorInvalidConfigurationType', oncData.Type]);
-  }
-  if (!('NetworkConfigurations' in oncData))
-    oncData.NetworkConfigurations = [];
-  for (var i = 0; i < oncData.NetworkConfigurations.length; ++i)
-    onc.validateNetwork(i, oncData, result);
-  if (!('Certificates' in oncData))
-    oncData.Certificates = [];
-  for (var i = 0; i < oncData.Certificates.length; ++i)
-    onc.validateCertificate(i, oncData, result);
-  return result;
-};
-
-/**
- * Returns true if the given config has all the required fields for an
- * encrypted configuration.  Does not decrypt anything to check inside
- * the encrypted payload.
- * @param {Object} config An ONC configuration dictionary.
- * @param {Array} result An array of errors and warnings to add to.
- * @returns {Array} the result passed in, plus any new errors or warnings.
- */
-onc.validateEncryptedConfiguration = function(config, result) {
-  if (!config) {
-    result.errors.push(['errorEmptyOnc']);
-    return result;
-  }
-  var requiredFields = { 'Cipher': 'AES256',
-                         'Ciphertext': null,
-                         'HMAC': null,
-                         'HMACMethod': 'SHA1',
-                         'IV': null,
-                         'Iterations': null,
-                         'Salt': null,
-                         'Stretch': 'PBKDF2',
-                         'Type': 'EncryptedConfiguration' };
-  for (field in requiredFields) {
-    if (!(field in config)) {
-      result.errors.push(['errorMissingEncryptionField', field]);
-      continue;
-    }
-    if (requiredFields[field] && config[field] != requiredFields[field]) {
-      result.errors.push(['errorUnsupportedEncryptionMode',
-                          config[field], field]);
-    }
-  }
-  return result;
-}
-
-/**
- * Returns true if the given config is an encrypted ONC file.
- * @param {Object} config An ONC configuration dictionary.
- * @returns {Boolean} True if this ONC file is an encrypted one.
- */
-onc.isEncrypted = function(config) {
-  return (config &&
-          ('Type' in config) &&
-          config.Type == "EncryptedConfiguration");
-};
-
-/**
- * Actually does the config encryption.  Encrypt the result using
- * AES256 using a CBC block cipher, with an HMAC-SHA1 and using a
- * salted, SHA1-iterated stretched key (PBKDF2).  This is what NSS can
- * decrypt on the other side, so using other parameters is probably
- * not going to work, but we keep the file format flexible.
- *
- * @param {String} passphrase Passphrase for encrypting config.
- * @param {String} plaintextConfig Plaintext ONC file JSON string.
- * @returns {String} Encrypted ONC string (JSON format).
- */
-onc.encryptConfig = function(passphrase, config) {
-  try {
-    var plaintextConfig = JSON.stringify(config, null, "  ");
-    var salt = Crypto.util.randomBytes(8);
-    // TODO(gspencer): There is an asyncronous version of PBKDF2 that
-    // would allow the UI to not be locked (so we can put up a wait
-    // spinner) that we should use.  It locks for about a second
-    // for 20000 iterations, so it's not a huge problem, but still...
-    var iterations = 20000;
-    var iv = Crypto.util.randomBytes(16);
-    var stretchedPassphrase = Crypto.PBKDF2(passphrase,
-                                             salt,
-                                             32,
-                                             { iterations: iterations,
-                                               hasher: Crypto.SHA1,
-                                               asBytes:true });
-    var ciphertext = Crypto.AES.encrypt(
-        plaintextConfig,
-        stretchedPassphrase,
-        { iv: iv,
-          mode: new Crypto.mode.CBC(Crypto.pad.pkcs7),
-          asBytes: true });
-
-    var hmac = Crypto.HMAC(Crypto.SHA1,
-                           ciphertext,
-                           stretchedPassphrase,
-                           { asBytes: true });
-
-    // Note that the reason the "output" object doesn't follow style
-    // guide naming conventions is because the objects are used in the
-    // JSON ONC output, and we want the naming to be consistent with
-    // the rest of the ONC output.
-    var output = {
-      'Cipher': 'AES256',
-      'Ciphertext': Crypto.util.bytesToBase64(ciphertext),
-      'HMAC': Crypto.util.bytesToBase64(hmac),
-      'HMACMethod': 'SHA1',
-      'IV': Crypto.util.bytesToBase64(iv),
-      'Iterations': iterations,
-      'Salt': Crypto.util.bytesToBase64(salt),
-      'Stretch': 'PBKDF2',
-      'Type': 'EncryptedConfiguration',
-    };
-
-    return output;
-  } catch(e) {
-    console.error(e);
-  }
-  return "";
-};
-
-/**
- * Actually does the config decryption and parsing.  Uses same
- * decryption parameters as encryption code.
- * @param {String} passphrase  Passphrase for decrypting config.
- * @param {String} cyphertext  Encrypted ONC file contents.
- * @returns {Object} Configuration blob.
- */
-onc.decryptConfig = function(passphrase, encryptedConfig) {
-  var salt = Crypto.util.base64ToBytes(encryptedConfig.Salt);
-  var iv = Crypto.util.base64ToBytes(encryptedConfig.IV);
-  var hmac = Crypto.util.base64ToBytes(encryptedConfig.HMAC)
-  var ciphertext = Crypto.util.base64ToBytes(encryptedConfig.Ciphertext);
-  var stretchedPassphrase = Crypto.PBKDF2(
-      passphrase,
-      salt,
-      32,
-      { iterations: encryptedConfig.Iterations,
-        hasher: Crypto.SHA1,
-        asBytes:true });
-  var calculatedHMAC = Crypto.HMAC(Crypto.SHA1,
-                                   ciphertext,
-                                   stretchedPassphrase,
-                                   { asBytes: true });
-  var hmacPassed = false;
-  if (calculatedHMAC && calculatedHMAC.length == hmac.length) {
-    hmacPassed = true;
-    for (var i = 0; i < calculatedHMAC.length; i++) {
-      if (calculatedHMAC[i] != hmac[i]) {
-        hmacPassed = false;
-      }
-    }
-  }
-
-  var plaintext = Crypto.AES.decrypt(
-      ciphertext,
-      stretchedPassphrase,
-      { iv: iv,
-        mode: new Crypto.mode.CBC(Crypto.pad.pkcs7),
-        asString: true });
-
-  // Defer testing hmac until here to avoid leaking timing info.
-  // Probably futile in Javascript, but still...
-  if (!plaintext || hmacPassed != true) {
-    throw chrome.i18n.getMessage('errorUnableToDecrypt');
-  }
-
-  return JSON.parse(plaintext);
-};
-
-/**
- * Validate the given certificate ONC data.
- * @param {String} index  index into Certificates array in ONC.
- * @param {Object} oncData  ONC data
- * @param {Object} result  Validation results data that will be update.
- */
-onc.validateCertificate = function(index, oncData, result) {
-  if (!result)
-    result = { 'errors': [], 'warnings': [], 'hasOpaqueEntity': false };
-  var certificate = oncData.Certificates[index];
-  if (!('GUID' in certificate)) {
-    result.errors.push(['errorCertificateMissingGUID']);
-    return result;
-  }
-  if ('Remove' in certificate) {
-    // Certificate marked for removal.  Ignore the rest.
-    return result;
-  }
-  if (!('Type' in certificate)) {
-    result.errors.push(['errorLoadRequiredObjectMissing', 'Type']);
-    return result;
-  }
-  if ('X509' in certificate) {
-    var der = Base64.unarmor(certificate.X509);
-    var asn1Data = asn1.parseAsn1(der);
-    if (!asn1Data) {
-      result.errors.push(['errorX509CertificateIsInvalid', certificate.GUID]);
-      return result;
-    }
-    var cert = asn1.interpretCert(asn1Data);
-    if (!asn1Data) {
-      result.errors.push(['errorX509CertificateIsInvalid', certificate.GUID]);
-    }
-  } else if ('PKCS12' in certificate) {
-    // TODO: support or deprecate PKCS12.
-    result.errors.push(['errorPKCS12CertificatesNotYetSupported',
-                        certificate.GUID]);
-    result.hasOpaqueEntity = true;
-  } else {
-    result.errors.push(['errorCertificateMissingPayloadField',
-                        certificate.GUID]);
-    result.hasOpaqueEntity = true;
-  }
-  return result;
-};
-
-/**
- * Validate the ProxyLocation object field.
- * @param {Object} oncManualProxy  ManualProxySettings ONC object
- * @param {String} name  Name optionally associated with ProxyLocation.
- * @param {Object} result  Validation results
- * @returns {Object}  Results object
- */
-onc.validateProxyLocation = function(oncManualProxy, name, result) {
-  if (!(name in oncManualProxy))
-    return;
-  var proxyLocation = oncManualProxy[name];
-  var path = 'ProxySettings.Manual.' + name;
-  if (!('Host' in proxyLocation))
-    result.errors.push(['errorLoadRequiredObjectMissing', path + '.Host']);
-  if (!('Port' in proxyLocation)) {
-    result.errors.push(['errorLoadRequiredObjectMissing', path + '.Port']);
-  } else {
-    if (typeof(proxyLocation.Port) != 'number')
-      result.errors.push(['errorExpectedInt', path + '.Port']);
-    if (proxyLocation.Host == '') {
-      result.errors.push(['errorEmptyProxyHost'])
-    }
-  }
-};
-
-/**
- * Validate the ProxySettings ONC object.
- * @param {Object} oncProxy  ProxySettings ONC object.
- * @param {Object} result  Validation results.
- * @returns {Object}  Results object
- */
-onc.validateProxySettings = function(oncProxy, result) {
-  if (!('Type' in oncProxy)) {
-    result.errors.push(['errorLoadRequiredObjectMissing',
-			'ProxySettings.Type']);
-  }
-  if (oncProxy.Type == 'Direct' || oncProxy.Type == 'WPAD') {
-    // No expectations for these.
-  } else if (oncProxy.Type == 'Manual') {
-    if (!('Manual' in oncProxy)) {
-      result.errors.push(['errorLoadRequiredObjectMissing',
-			  'ProxySettings.Manual']);
-      return result;
-    }
-    onc.validateProxyLocation(oncProxy.Manual, 'HTTPProxy', result);
-    onc.validateProxyLocation(oncProxy.Manual, 'SecureHTTPProxy', result);
-    onc.validateProxyLocation(oncProxy.Manual, 'FTPProxy', result);
-    onc.validateProxyLocation(oncProxy.Manual, 'SOCKS', result);
-  } else if (oncProxy.Type == 'PAC') {
-    // A PAC name must be present in the object.  It also must be
-    // non-empty.  An empty PAC likely was meaning to convey using
-    // WPAD, but we expect a separate 'WPAD' type for that.
-    if (!('PAC' in oncProxy))
-      result.errors.push(['errorLoadRequiredObjectMissing',
-                          'ProxySettings.PAC']);
-    else if (oncProxy.PAC == '')
-      result.errors.push(['errorEmptyProxyURL']);
-  } else {
-    result.errors.push(['errorLoadUnknownProxyType', oncProxy.Type]);
-  }
-};
-
-/**
- * Validate the given NetworkConfiguration ONC object.
- * @param {Integer} index  Index into NetworkConfigurations.
- * @param {Object} oncData  Complete ONC
- * @param {Object} result  Incoming results of validation, updated.
- * @returns {Object}  Results object
- */
-onc.validateNetwork = function(index, oncData, result) {
-  var netConfig = oncData.NetworkConfigurations[index];
-  if (!result)
-    result = { 'errors': [], 'warnings': [], 'hasOpaqueEntity': false };
-  if (!('GUID' in netConfig)) {
-    result.errors.push(['errorLoadRequiredObjectMissing', 'GUID']);
-    return result;
-  }
-  if ('Remove' in netConfig) {
-    // Network marked for removal.  Ignore the rest.
-    return result;
-  }
-  if (!('Type' in netConfig)) {
-    result.errors.push(['errorLoadRequiredObjectMissing', 'Type']);
-    return result;
-  }
-  if (!('Name' in netConfig) || netConfig.Name == '') {
-    result.errors.push(['errorMissingNetworkName', netConfig.Type]);
-    return result;
-  }
-  if ('ProxySettings' in netConfig) {
-    onc.validateProxySettings(netConfig.ProxySettings, result);
-  }
-  if (netConfig.Type == 'WiFi') {
-    onc.validateWiFiNetwork(index, oncData, result);
-  } else if (netConfig.Type == 'VPN') {
-    onc.validateVpnNetwork(index, oncData, result);
-  } else {
-    result.warnings.push(['errorLoadUnknownNetworkConfigType',
-                          netConfig.Type]);
-    result.hasOpaqueEntity = true;
-  }
-  return result;
-};
-
-/**
- * Validate a WiFi NetworkConfiguration ONC object.
- * @param {Integer} index  Index into NetworkConfiguration ONC object.
- * @param {Object} oncData  ONC configuration
- * @param {Object} result  Result object indicating errors and warnings.
- * @returns {Object}  Result of validation.
- */
-onc.validateWiFiNetwork = function(index, oncData, result) {
-  var netConfig = oncData.NetworkConfigurations[index];
-  if (!('WiFi' in netConfig)) {
-    result.errors.push(['errorLoadRequiredObjectMissing', 'WiFi']);
-    return result;
-  }
-  var wifiConfig = netConfig.WiFi;
-  if (!('SSID' in wifiConfig) || wifiConfig.SSID == '') {
-    result.errors.push(['errorWiFiNetworkMissingSSID', 'SSID']);
-    return result;
-  }
-  if (!('Security' in wifiConfig)) {
-    result.errors.push(['errorLoadRequiredObjectMissing', 'Security']);
-    return result;
-  }
-  switch (wifiConfig.Security) {
-  case 'None':
-    break;
-  case 'WEP-PSK':
-    result.warnings.push(['warningWEPInherentlyUnsafe', netConfig.Name]);
-    if ('Passphrase' in netConfig.WiFi) {
-      // 5/13/16/29 characters are needed for 64/128/152/256-bit WEP ascii keys
-      // 10/26/32/58 characters are needed for 64/128/152/256-bit WEP hex keys
-      // Note that the actual bits supplied here are only
-      // 40/104/128/232 bits, respectively, but WEP adds some
-      // randomness to make up the rest of the bits.
-      var hexLengths = [10, 26, 32, 58];
-      var passphrase = netConfig.WiFi.Passphrase;
-      if (passphrase.substr(0, 2) != '0x' ||
-          hexLengths.indexOf(passphrase.length - 2) == -1)
-        result.errors.push(['errorWEPKeyInvalidLength',
-                            netConfig.Name]);
-    } else {
-      result.error.push(['errorPassphraseMissing',
-                         netConfig.Name]);
-    }
-    break;
-  case 'WPA-PSK':
-    if ('Passphrase' in netConfig.WiFi) {
-      if (netConfig.WiFi.Passphrase.length < 8) {
-        result.warnings.push(['warningShortWPAPassphraseUnsafe',
-                              netConfig.WiFi.Security,
-                              netConfig.Name,
-                              netConfig.WiFi.Passphrase.length]);
-      }
-    } else {
-      result.errors.push(['errorPassphraseMissing',
-                          netConfig.Name]);
-    }
-    break;
-  case 'WPA-EAP':
-    if (!('EAP' in netConfig.WiFi)) {
-      result.errors.push(['errorLoadRequiredObjectMissing', 'EAP']);
-      break;
-    }
-    var eapConfig = netConfig.WiFi.EAP;
-    if (wiFiDialog.wifiRequiresServerCertificate()) {
-      if ('ServerCARef' in eapConfig &&
-          onc.findCert(eapConfig.ServerCARef, oncData) < 0) {
-        result.errors.push(['errorBadCertReference',
-                            netConfig.Name, 'ServerCARef',
-                            eapConfig.ServerCARef]);
-      }
-    }
-    if (wiFiDialog.wifiRequiresClientCertficate()) {
-      onc.validateClientCert(eapConfig, index, oncData, result);
-    }
-    if (wiFiDialog.wifiRequiresPassword()) {
-      if (!('Password' in eapConfig))
-        result.warnings.push(['warningEAPPasswordEmpty',
-                              netConfig.Name]);
-    }
-    if (!('Outer' in eapConfig)) {
-      result.errors.push(['errorLoadRequiredObjectMissing',
-                          'WiFi.EAP.Outer']);
-      return result;
-    }
-    switch (eapConfig.Outer) {
-    case 'PEAP':
-    case 'EAP-TTLS':
-    case 'EAP-TLS':
-    case 'LEAP':
-      break;
-    default:
-      result.errors.push(['errorLoadUnhandledEapType',
-                          eapConfig.Outer, netConfig.Name]);
-      return result;
-    }
-    if (!('Identity' in eapConfig) || eapConfig.Identity == '') {
-      result.warnings.push(['warningIdentityMissing', netConfig.Name]);
-    }
-    break;
-  default:
-    result.errors.push(['errorLoadUnhandledSecurityType',
-                        wifiConfig.Security, netConfig.Name]);
-  }
-  return result;
-};
-
-/**
- * Validate a VPN NetworkConfiguration ONC object's user credentials.
- * @param (Object) container  ONC container for user credentials.
- * @param {Integer} index  Index into NetworkConfiguration ONC object.
- * @param {Object} oncData  ONC configuration
- * @param {Object} result  Result object indicating errors and warnings.
- * @returns {Object}  Result of validation.
- */
-onc.validateVpnUserCredentials = function(container, index,
-                                          oncData, result) {
-  var netConfig = oncData.NetworkConfigurations[index];
-  if (!('Username' in container) || container.Username == '') {
-    result.warnings.push(['warningIdentityMissing', netConfig.Name]);
-  }
-  if (!('Password' in container) || container.Password == '') {
-    result.warnings.push(['warningPasswordMissing', netConfig.Name]);
-  }
-};
-
-/**
- * Validate a VPN NetworkConfiguration ONC object's certificates.
- * @param (Object) container  ONC container for certificates.
- * @param {Integer} index  Index into NetworkConfiguration ONC object.
- * @param {Object} oncData  ONC configuration
- * @param {Object} result  Result object indicating errors and warnings.
- * @returns {Object}  Result of validation.
- */
-onc.validateVpnCerts = function(container, index, oncData, result) {
-  var netConfig = oncData.NetworkConfigurations[index];
-  if (!('ServerCARef' in container))
-    result.errors.push(['errorMissingVPNServerCA', netConfig.Name]);
-  else if (onc.findCert(container.ServerCARef, oncData) < 0) {
-    result.errors.push(['errorBadCertReference',
-                        netConfig.Name, 'ServerCARef',
-                        container.ServerCARef]);
-  }
-  onc.validateClientCert(container, index, oncData, result);
-};
- /**
- * Validate a VPN NetworkConfiguration ONC object.
- * @param {Integer} index  Index into NetworkConfiguration ONC object.
- * @param {Object} oncData  ONC configuration
- * @param {Object} result  Result object indicating errors and warnings.
- * @returns {Object}  Result of validation.
- */
-onc.validateVpnNetwork = function(index, oncData, result) {
-  var netConfig = oncData.NetworkConfigurations[index];
-  if (!('VPN' in netConfig)) {
-    result.errors.push(['errorLoadRequiredObjectMissing', 'VPN']);
-    return result;
-  }
-  var vpnConfig = netConfig.VPN;
-  if (!('Type' in vpnConfig)) {
-    result.errors.push(['errorLoadRequiredObjectMissing', 'VPN.Type']);
-  }
-  if (!('Host' in vpnConfig) || vpnConfig.Host == '') {
-    result.errors.push(['errorLoadRequiredObjectMissing', 'VPN.Host']);
-  }
-  if (vpnConfig.Type == 'L2TP-IPsec') {
-    if (!('L2TP' in vpnConfig)) {
-      result.errors.push(['errorLoadRequiredObjectMissing',
-                          'VPN.L2TP']);
-      return result;
-    }
-    onc.validateVpnUserCredentials(vpnConfig.L2TP, index,
-                                   oncData, result)
-    if (!('IPsec' in vpnConfig)) {
-      result.errors.push(['errorLoadRequiredObjectMissing',
-                          'VPN.IPsec']);
-      return result;
-    }
-    var ipsecConfig = vpnConfig.IPsec;
-    if (!('IKEVersion' in ipsecConfig)) {
-      result.errors.push(['errorLoadRequiredObjectMissing',
-                          'VPN.IPsec.IKEVersion']);
-      return result;
-    }
-    if (!('AuthenticationType' in ipsecConfig)) {
-      result.errors.push(['errorLoadRequiredObjectMissing',
-                          'VPN.IPsec.AuthenticationType']);
-      return result;
-    }
-    if (ipsecConfig.AuthenticationType != 'PSK' &&
-        ipsecConfig.AuthenticationType != 'Cert') {
-      result.errors.push(['errorUnsupportedValue',
-                          'VPN.IPsec.AuthenticationType',
-                          ipsecConfig.AuthenticationType]);
-    }
-    if (ipsecConfig.AuthenticationType == 'PSK') {
-      if (!('PSK' in ipsecConfig))
-        result.warnings.push(['warningPreSharedKeyMissing', netConfig.Name]);
-    } else {
-      onc.validateVpnCerts(ipsecConfig, index, oncData, result);
-    }
-  } else if (vpnConfig.Type == 'OpenVPN') {
-    onc.validateVpnUserCredentials(vpnConfig.OpenVPN, index,
-                                   oncData, result)
-    onc.validateVpnCerts(vpnConfig.OpenVPN, index, oncData, result);
-  } else {
-    result.warnings.push(['errorUnsupportedVPNType', netConfig.Name,
-                          vpnConfig.Type]);
-    result.hasOpaqueEntity = true;
-    return result;
-  }
-  return result;
-};
-
diff --git a/remove-dialog.js b/remove-dialog.js
deleted file mode 100644
index ce9063d..0000000
--- a/remove-dialog.js
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview This file contains implementation for the remove
- * entity dialog.
- */
-
-/**
- * Namespace for remove (certificate or network) dialog.
- */
-var removeDialog = {};
-
-removeDialog.setOncData = function(oncData) {
-  removeDialog.oncData = oncData;
-};
-
-removeDialog.onRemovePress = function() {
-  onc.removeEntity(removeDialog.oncData.GUID, main.oncCurrent);
-  ui.updateSummary();
-  ui.dismissDialog();
-};
-
-removeDialog.onMarkRemovePress = function() {
-  onc.markRemoveEntity(removeDialog.oncData.GUID, main.oncCurrent);
-  ui.updateSummary();
-  ui.dismissDialog();
-};
-
-removeDialog.init = function() {
-  var GUID = removeDialog.oncData.GUID;
-  var oncEntityInfo = onc.findEntity(GUID, main.oncCurrent);
-  var isExternalEntity = GUID in main.externalEntitySet;
-  var entity = main.oncCurrent[oncEntityInfo.entityList][oncEntityInfo.index];
-  var replacementI18n;
-  var shortDescription;
-  if (oncEntityInfo.entityList == 'Certificates') {
-    replacementI18n = chrome.i18n.getMessage('certificate');
-    shortDescription = ui.formatCertificate(entity, 1);
-  } else {
-    replacementI18n = chrome.i18n.getMessage('network');
-    shortDescription = ui.formatNetwork(entity, 1);
-  }
-  if (isExternalEntity && !onc.isMarkedForRemoval(entity)) {
-    $('#remove-content').hide();
-    $('#mark-remove-content').show();
-    $('#help-mark-remove-content')[0].innerText =
-      chrome.i18n.getMessage('helpMarkRemoveContent',
-                             [ replacementI18n,
-                               shortDescription ]);
-    $('#mark-remove-button', '#remove-dialog').show();
-  } else {
-    $('#remove-content').show();
-    $('#mark-remove-content').hide();
-    $('#help-remove-content')[0].innerText =
-      chrome.i18n.getMessage('helpRemoveContent',
-                             [ replacementI18n,
-                               shortDescription ]);
-    $('#mark-remove-button', '#remove-dialog').hide();
-  }
-  $('#mark-remove-button', '#remove-dialog').click(
-      removeDialog.onMarkRemovePress);
-  $('#remove-button', '#remove-dialog').click(
-      removeDialog.onRemovePress);
-};
diff --git a/save-request-dialog.js b/save-request-dialog.js
deleted file mode 100644
index 3e7fc99..0000000
--- a/save-request-dialog.js
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview This file contains implementation for the save
- * request dialog.
- */
-
-/**
- * Namespace for save request dialog.
- */
-var saveRequestDialog = {};
-
-/**
- * Called to hide/unhide UI fields.
- */
-saveRequestDialog.setUiVisibility = function() {
-};
-
-/**
- * Validates that the passphrase has been set and is reasonably complex.
- */
-saveRequestDialog.validatePassphrase = function() {
-  var passphraseErrors = $('#apply-errors', '#save-request-dialog');
-  var passphraseField = $('#save-passphrase', '#save-request-dialog');
-  var encryptButton = $('#encrypt-button', '#save-request-dialog');
-  var passphrase = passphraseField.val();
-  if (passphrase.length < 8) {
-    passphraseErrors[0].innerText =
-        chrome.i18n.getMessage('errorPassphraseTooShort');
-    passphraseField.focus();
-    main.disableInput(encryptButton);
-    return;
-  }
-  // This checks to make sure that the passphrase has at least one
-  // non-lowercase letter.
-  var noFancyChars = passphrase.replace(/[^a-z]/g, function(str) { return '';});
-  if (noFancyChars == passphrase) {
-    passphraseErrors[0].innerText =
-        chrome.i18n.getMessage('errorPassphraseTooSimple');
-    passphraseField.focus();
-    main.disableInput(encryptButton);
-    return;
-  }
-  passphraseErrors[0].innerHTML = '&nbsp;';
-  main.enableInput(encryptButton);
-};
-
-/**
- * Proceeds to the save dialog.
- */
-saveRequestDialog.saveFile = function() {
-  ui.openDialog('download');
-};
-
-/**
- * Toggles the availability of the encryption.
- */
-saveRequestDialog.toggleEncryption = function() {
-  var passphraseDiv = $('#save-passphrase-div', '#save-request-dialog');
-  if ($('#use-encryption', '#save-request-dialog').is(':checked')) {
-    main.enableInput($('#save-passphrase', '#save-request-dialog'));
-    passphraseDiv.fadeTo('fast', 1.0);
-    $('#apply-button', '#save-request-dialog').hide();
-    $('#encrypt-button', '#save-request-dialog').show();
-  } else {
-    main.disableInput($('#save-passphrase', '#save-request-dialog'));
-    passphraseDiv.fadeTo('fast', 0.50);
-    $('#apply-button', '#save-request-dialog').show();
-    $('#encrypt-button', '#save-request-dialog').hide();
-  }
-};
-
-/**
- * Called to initialize the save request dialog.
- */
-saveRequestDialog.init = function() {
-  var passphraseField = $('#save-passphrase', '#save-request-dialog');
-  var encryptButton = $('#encrypt-button', '#save-request-dialog');
-  var applyButton = $('#apply-button', '#save-request-dialog');
-  var useEncryptionCheck = $('#use-encryption', '#save-request-dialog');
-  passphraseField.val('');
-  $('#save-passphrase-div', '#save-request-dialog').show();
-  passphraseField.keyup(saveRequestDialog.validatePassphrase);
-  encryptButton.click(saveRequestDialog.saveFile);
-  applyButton.click(saveRequestDialog.saveFile);
-  applyButton.hide();
-  useEncryptionCheck.click(saveRequestDialog.toggleEncryption);
-  main.disableInput(encryptButton);
-  $('#cancel-button', '#save-request-dialog').focus();
-  saveRequestDialog.toggleEncryption();  // to set up the initial state.
-};
-
diff --git a/ui.js b/ui.js
deleted file mode 100644
index b5c1fb8..0000000
--- a/ui.js
+++ /dev/null
@@ -1,390 +0,0 @@
-// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview This file contains implementation for UI elements.
- */
-
-/**
- * Namespace for generic UI manipulation.
- */
-var ui = {};
-
-/**
- * Opens the dialog identified by the given ID prefix.
- * @param {String} idPrefix  HTML ID prefix of menu item and dialog
- *                           (ie. 'wifi').
- */
-ui.openDialog = function(idPrefix) {
-  // Close anything else that is already open - though none should be.
-  ui.dismissDialog();
-  var dialogDoms = $('#' + idPrefix + '-dialog');
-  $('#overlay')[0].style.display = '-webkit-box';
-  $('#overlay').keydown(function(event) {
-    if (event.which == 27)
-      ui.dismissDialog();
-    if (event.which == 13) {
-      // Try to apply.
-      $('#apply-button', '#' + idPrefix + '-dialog').click();
-    }
-  });
-  dialogDoms.show();
-  $('#cancel-button', dialogDoms).click(ui.onDialogCancelPress);
-  $('#apply-header', dialogDoms).html('');
-  $('#apply-errors', dialogDoms).html('');
-  $('#apply-warnings', dialogDoms).html('');
-  main.dialogs[idPrefix].init();
-};
-
-/**
- * Return the currently selected option's i18n tag.
- * @param {String} selector  jquery selector for the option.
- * @returns {String}  i18n tag of current selected or '' if none selected.
- */
-ui.getSelectedI18n = function(selector) {
-  var dom = $(selector)[0];
-  var selectedIndex = dom.selectedIndex;
-  if (selectedIndex < 0)
-    return '';
-  return dom.options[selectedIndex].getAttribute('i18n');
-};
-
-/**
- * Sets the current option based on i18n tag value.  If no tag exists or
- * none matches, make no changes.
- * @param {String} selector  jquery selector for the option.
- * @param {String} i18n  Value to set
- */
-ui.setSelectedI18n = function(selector, i18n) {
-  var dom = $(selector)[0];
-  var toSelect = -1;
-  for (var i = 0; i < dom.options.length; ++i) {
-    if (dom.options[i].getAttribute('i18n') == i18n) {
-      toSelect = i;
-      break;
-    }
-  }
-  if (toSelect >= 0)
-    dom.selectedIndex = toSelect;
-};
-
-/**
- * Dismiss/hide the active modal dialog.
- */
-ui.dismissDialog = function() {
-  $('#overlay').hide();
-  for (var dialog in main.dialogs)
-    $('#' + dialog + '-dialog').hide();
-  ui.updateSummary();
-};
-
-/**
- * Handle cancel button press on any dialog.
- */
-ui.onDialogCancelPress = function() {
-  ui.dismissDialog();
-};
-
-/**
- * Handle edit button press in the list of networks and certs.
- * @param {String} dialogId  id for dialog to open
- * @param {Integer} index  offset inside arrays of main.oncCurrent
- */
-ui.onEditPress = function(dialogId, index) {
-  var dialog = main.dialogs[dialogId];
-  ui.openDialog(dialogId);
-  var result;
-  var oncData;
-  if (dialogId == 'cert') {
-    oncData = main.oncCurrent.Certificates[index];
-    result = onc.validateCertificate(index, main.oncCurrent);
-  } else {
-    oncData = main.oncCurrent.NetworkConfigurations[index];
-    result = onc.validateNetwork(index, main.oncCurrent);
-  }
-  ui.showMessages(result, '#' + dialogId + '-dialog');
-  dialog.setToUi(oncData);
-  dialog.setUiVisibility();
-};
-
-/**
- * Handle remove button press in the list of networks and certs.
- * @param {Object} oncData  ONC blob for the entity to remove.
- */
-ui.onRemovePress = function(oncData) {
-  // Currently we always trust the user.  If the user wants to remove
-  // a certificate that is referenced by a network, allow it.  Upon
-  // updating the summary they should see that the network referencing
-  // it now has an error.
-  // TODO: Use the "Remove" tag when the entity was loaded (vs created
-  // this session).
-
-  removeDialog.setOncData(oncData);
-  ui.openDialog('remove');
-};
-
-/**
- * Reset the given file picker.  The file picker must be its parent's
- * last child.
- * @param {String} domId  Query string to find picker.
- */
-ui.resetFilePicker = function(domId) {
-  var pickerClone = $(domId).clone();
-  var parent = $(domId).parent()[0];
-  parent.removeChild($(domId)[0]);
-  parent.appendChild(pickerClone[0]);
-};
-
-/**
- * Converts the given message list into localized HTML to display.
- * @param {Array.<Array.<String>>} messageList array of messages to
- *   be converted.
- */
-ui.convertMessagesToHtml = function(messageList) {
-  if (!messageList.length)
-    return '';
-  messages = [];
-  for (var i = 0; i < messageList.length; i++) {
-    var messageFormat = messageList[i];
-    var message;
-    if (messageFormat.length > 1) {
-      message = chrome.i18n.getMessage(messageFormat[0],
-                                       messageFormat.slice(1));
-    } else {
-      message = chrome.i18n.getMessage(messageFormat[0]);
-    }
-    if (!message) {
-      message = 'NO TRANSLATION FOR: ' + messageFormat[0];
-    }
-    messages.push(message);
-  }
-  return '<p>' + messages.join('</p><p>') + '<\p>';
-};
-
-/**
- * Depending on the results, apply the changes or show warnings.
- * @param {Object} result  Result of compiling the UI to ONC.
- * @param {Object} oncTest  ONC resulting from applying change.
- * @param {Object} dialog  DOM node of dialog.
- */
-ui.showMessagesAndApply = function(result, oncTest, dialog) {
-  ui.showMessages(result, dialog);
-  // Require the user to fix errors.
-  if (result.errors.length)
-    return;
-  main.oncCurrent = oncTest;
-  ui.dismissDialog();
-};
-
-/**
- * Update a certificate dropdown with the currently loaded certificates.
- * Currently only Certificate Authority certs are listed.
- * @param {Object} optionList  DOM option list to update.
- * @param {Boolean} clearFirst  Clear the option list before adding.
- */
-ui.updateCertificateDropdown = function(optionList, clearFirst) {
-  if (clearFirst) optionList.options.length = 0;
-  optionList.disabled = false;
-  for (var i = 0; i < main.oncCurrent.Certificates.length; ++i) {
-    var oncCert = main.oncCurrent.Certificates[i];
-    if (oncCert.Type != 'Authority')
-      continue;
-    var certDescription = ui.formatCertificate(oncCert, 1);
-    optionList.options.add(new Option(certDescription, oncCert.GUID));
-  }
-  if (optionList.options.length == 0) {
-    optionList.options.add(new Option(chrome.i18n.getMessage
-                                      ('certificateEmpty'), 'empty'));
-    optionList.disabled = true;
-  }
-};
-
-/**
- * Shows the error or warning mark as appropriate for the given entity.
- * @param {Object} result  Validation result.
- * @param {DOM} entityDom  DOM of entity in the list.
- */
-ui.setEntityStatus = function(oncEntity, result, entityDom) {
-  var whichMark = null;
-  if (result.errors.length)
-    whichMark = '#error-mark';
-  else if (result.warnings.length)
-    whichMark = '#warning-mark';
-  if (whichMark) {
-    $(whichMark, entityDom).show();
-    // if you click on the warning/error, edit the entry.
-    $(whichMark, entityDom).click(function(event) {
-      $('#edit', this.parentNode).click();
-    });
-  }
-  if (onc.isMarkedForRemoval(oncEntity))
-    $('#mark-removal-mark', entityDom).show();
-};
-
-/**
- * Format a network configuration for display.
- * @param {Object} oncNetwork  ONC network configuration
- */
-ui.formatNetwork = function(oncNetwork, maxLines) {
-  var bestName = chrome.i18n.getMessage('unknownName');
-  if ('Name' in oncNetwork)
-    bestName = oncNetwork.Name;
-  else if ('GUID' in oncNetwork)
-    bestName = oncNetwork.GUID;
-  if (maxLines == 1) {
-    return bestName;
-  } else {
-    var bestType = chrome.i18n.getMessage('unknownType');
-    if ('Type' in oncNetwork)
-      bestType = oncNetwork.Type;
-    return bestName + '<br>' + bestType;
-  }
-};
-
-/**
- * Handle edit press on a network in the summary list.
- */
-ui.onNetworkEditPress = function() {
-  var parent = $(this).parent();
-  var index = parent.data('index')
-  if (parent.data('onc').Type == 'WiFi')
-    ui.onEditPress('wifi', index);
-  else
-    ui.onEditPress('vpn', index);
-};
-
-/**
- * Format a network configuration for display.
- * @param {Object} oncNetwork  ONC network configuration
- * @param {Integer} maxLines Maximum lines available for description.
-                    Defaults to no maximum.
- */
-ui.formatCertificate = function(oncCert, maxLines) {
-  var cert = null;
-  var bestName = [ chrome.i18n.getMessage('unknownName'), '' ];
-  if ('GUID' in oncCert) {
-    bestName[0] = oncCert['GUID'];
-  }
-  if ('X509' in oncCert) {
-    cert = main.interpretCertFromX509Pem(oncCert.X509);
-  }
-  if (cert && 'commonName' in cert.subject) {
-    bestName[0] = cert.subject.commonName;
-  }
-  if (cert && 'commonName' in cert.issuer) {
-    bestName[1] = cert.subject.commonName;
-  }
-
-  if (maxLines == 1)
-    return bestName[0];
-  return bestName[0] + '<br>\n [' + bestName[1] + ']';
-};
-
-/**
- * Handle edit press on a network in the summary list.
- */
-ui.onCertificateEditPress = function() {
-  var parent = $(this).parent();
-  var index = parent.data('index')
-  ui.onEditPress('cert', index);
-};
-
-/**
- * Show the summary of the current ONC settings for a given kind of entity.
- * @param {Array.<Object>} list  List of entities (networks or certificates)
- * @param {String} id  query id of the list's top level DOM.
- * @param {Function} validator  Called to validate this entity.
- * @param {Function} formatter  Called to format entity to HTML.
- * @param {Function} editCallback  Called to handle edit press of this entity.
- */
-ui.showSummaryList = function(list, id, validator, formatter, editCallback) {
-  for (var i = 0; i < list.length; ++i) {
-    var oncEntity = list[i];
-    var result = validator(i, main.oncCurrent);
-    var newDom = $('#template', id).clone();
-    newDom[0].id = '';
-    $(id).append(newDom);
-    $('#left', newDom).html(formatter(oncEntity));
-    ui.setEntityStatus(oncEntity, result, newDom);
-
-    var editButton = $('#edit', newDom);
-    editButton.parent().data('onc', oncEntity);
-    editButton.parent().data('index', i);
-    editButton.click(editCallback);
-    // For opaque entities which we do not know how to edit or
-    // entities marked for removal already, simply remove the edit
-    // button.  User can still preserve such entities and remove them,
-    // but not modify them.
-    if (result.hasOpaqueEntity || onc.isMarkedForRemoval(oncEntity)) {
-      editButton[0].parentNode.removeChild(editButton[0]);
-    }
-    var removeButton = $('#remove', newDom);
-    removeButton.click(function() {
-      ui.onRemovePress($(this).parent().data('onc'));
-    });
-    newDom.hover(
-      function() {
-        $('.action', this).show();
-      },
-      function() {
-        $('.action', this).hide();
-      });
-    newDom[0].style.display = '-webkit-box';
-  }
-};
-
-/**
- * Update the summary (right) pane.
- */
-ui.updateSummary = function() {
-  var rightPane = $('#right-pane')[0];
-
-  // Remove all entities other than the template.
-  var entities = $('.entity');
-  for (var i = 0; i < entities.length; ++i) {
-    if (entities[i].style.display != '')
-      entities[i].parentNode.removeChild(entities[i]);
-  }
-
-  ui.showSummaryList(main.oncCurrent.NetworkConfigurations,
-                     '#network-configurations',
-                     onc.validateNetwork,
-                     ui.formatNetwork,
-                     ui.onNetworkEditPress);
-
-  ui.showSummaryList(main.oncCurrent.Certificates,
-                     '#certificates',
-                     onc.validateCertificate,
-                     ui.formatCertificate,
-                     ui.onCertificateEditPress);
-};
-
-/**
- * Show the results in the dialog.
- * @param {Object} result  Result of compiling the UI to ONC.
- * @param {Object} dialog  DOM node of dialog.
- */
-ui.showMessages = function(result, dialog) {
-  $('#apply-errors', dialog).html(ui.convertMessagesToHtml
-                                  (result.errors));
-  $('#apply-warnings', dialog).html(ui.convertMessagesToHtml
-                                    (result.warnings));
-};
-
-/**
- * Handles loading the body of the extension.  Called from onload
- * event handler.
- */
-ui.translateText = function() {
-  var i18nNodes = document.querySelectorAll('[i18n]');
-  for (var i = 0; i < i18nNodes.length; ++i) {
-    var i18nId = i18nNodes[i].getAttribute('i18n');
-    var translation = chrome.i18n.getMessage(i18nId);
-    if (translation == '') {
-      translation = 'NO TRANSLATION FOR: ' + i18nId;
-    }
-    i18nNodes[i].textContent = translation;
-  }
-};
-
diff --git a/vpn-dialog.js b/vpn-dialog.js
deleted file mode 100644
index 4e4123f..0000000
--- a/vpn-dialog.js
+++ /dev/null
@@ -1,209 +0,0 @@
-// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview This file contains implementation for the VPN
- * configuration dialog.
- */
-
-/**
- * Namespace for VPN dialog.
- */
-var vpnDialog = {};
-
-/**
- * Based on current VPN setting, set visible configuration.
- */
-vpnDialog.setUiVisibility = function() {
-  var setting = $('#vpn-type').val();
-  if (setting == 'L2TP-IPsec-PSK') {
-    $('#vpn-psk-div').show();
-    $('#vpn-cert-div').hide();
-  } else if (setting == 'L2TP-IPsec-Cert' || setting == 'OpenVPN') {
-    $('#vpn-psk-div').hide();
-    $('#vpn-cert-div').show();
-  }
-  if ($('#vpn-save-credentials').is(':checked'))
-    $('#vpn-user-cred').show();
-  else
-    $('#vpn-user-cred').hide();
-  networkDialog.setUiVisibility();
-};
-
-/**
- * Gets the username and password for the user from the UI.
- * @param {Object} container The destination container for the credentials.
- */
-vpnDialog.getUserCredentialsFromUi = function(container) {
-  var saveCredentials = $('#vpn-save-credentials').is(':checked');
-  container.SaveCredentials = saveCredentials;
-  if (saveCredentials) {
-    container.Username = $('#vpn-username').val();
-    container.Password = $('#vpn-password').val();
-  } else {
-    delete container.Username;
-    delete container.Password;
-  }
-};
-
-/**
- * Gets the certificate information from the UI.
- * @param {Object} container The destination container for the certificate info.
- */
-vpnDialog.getCertsFromUi = function(container) {
-  var serverCa = $('#vpn-server-ca').val();
-  if (serverCa != 'empty') {
-    container.ServerCARef = serverCa;
-  }
-  container.ClientCertType = 'Pattern';
-  var clientCa = $('#vpn-client-ca').val();
-  onc.setUpAssocArray(container, 'ClientCertPattern');
-  if (clientCa != 'empty') {
-    container.ClientCertPattern.IssuerCARef = clientCa;
-  }
-  if ($('#vpn-enrollment-uri').val()) {
-    container.ClientCertPattern.EnrollmentUri = $('#vpn-enrollment-uri').val();
-  } else {
-    delete container.ClientCertPattern.EnrollmentUri;
-  }
-};
-
-/**
- * Validate and convert the VPN configuration to ONC.
- * @returns {Object}      ONC NetworkConfiguration object for VPN.
- */
-vpnDialog.getFromUi = function() {
-  var network = {};
-  if (vpnDialog.oncBase)
-    network = vpnDialog.oncBase;
-  network.GUID = $('#vpn-guid').val();
-  network.Name = $('#vpn-name').val();
-  network.Type = 'VPN';
-  onc.setUpAssocArray(network, 'VPN');
-  network.VPN.Host = $('#vpn-host').val();
-  var vpnType = $('#vpn-type').val();
-  if (vpnType == 'L2TP-IPsec-PSK' || vpnType == 'L2TP-IPsec-Cert') {
-    network.VPN.Type = 'L2TP-IPsec';
-    onc.setUpAssocArray(network.VPN, 'IPsec');
-    network.VPN.IPsec.IKEVersion = 1;
-    onc.setUpAssocArray(network.VPN, 'L2TP');
-    vpnDialog.getUserCredentialsFromUi(network.VPN.L2TP);
-  } else {
-    network.VPN.Type = 'OpenVPN';
-    onc.setUpAssocArray(network.VPN, 'OpenVPN');
-    vpnDialog.getUserCredentialsFromUi(network.VPN.OpenVPN);
-  }
-  if (vpnType == 'L2TP-IPsec-Cert') {
-    network.VPN.IPsec.AuthenticationType = 'Cert';
-    vpnDialog.getCertsFromUi(network.VPN.IPsec);
-    delete network.VPN.IPsec.PSK;
-  } else if (vpnType == 'L2TP-IPsec-PSK') {
-    network.VPN.IPsec.AuthenticationType = 'PSK';
-    if ($('#vpn-psk').val())
-      network.VPN.IPsec.PSK = $('#vpn-psk').val();
-    else
-      delete network.VPN.IPsec.PSK;
-    delete network.VPN.IPsec.ServerCARef;
-    delete network.VPN.IPsec.ClientCertPattern;
-  } else if ($('#vpn-type').val() == 'OpenVPN') {
-    vpnDialog.getCertsFromUi(network.VPN.OpenVPN);
-  }
-  networkDialog.getFromUi(network);
-  return network;
-};
-
-/**
- * Handle save button press on the VPN modal dialog.  Responsible for
- * showing errors, blocking save, and dismissing modal dialog.
- */
-vpnDialog.onApplyPress = function() {
-  var newVpn = vpnDialog.getFromUi();
-  var oncTest = onc.createUpdate(newVpn, 'NetworkConfigurations');
-  var result = onc.validateNetwork(onc.findNetwork(newVpn.GUID, oncTest),
-                                   oncTest);
-  ui.showMessagesAndApply(result, oncTest, $('#vpn-dialog')[0]);
-};
-
-/**
- * Called to initialize the VPN dialog.
- */
-vpnDialog.init = function() {
-  $('#vpn-name').val('');
-  $('#vpn-host').val('');
-  $('#vpn-psk').val('');
-  $('#vpn-save-credentials')[0].checked = false;
-  $('#vpn-username').val('');
-  $('#vpn-password').val('');
-  $('#vpn-enrollment-uri').val('');
-  $('#vpn-guid').val(main.createGuid());
-  ui.updateCertificateDropdown($('#vpn-server-ca')[0], true);
-  ui.updateCertificateDropdown($('#vpn-client-ca')[0], true);
-  $('#apply-button', '#vpn-dialog').click(vpnDialog.onApplyPress);
-  $('#vpn-type').change(vpnDialog.setUiVisibility);
-  $('#vpn-save-credentials').change(vpnDialog.setUiVisibility);
-  vpnDialog.setUiVisibility();
-  networkDialog.init($('#vpn-dialog'));
-  $('#vpn-name').focus();
-};
-
-/**
- * Set up the UI with an object from ONC that has certificate information.
- * @param {Object} netconfig  VPN ONC object
- **/
-vpnDialog.setCertToUi = function(vpnConfig) {
-  if (onc.findCert(vpnConfig.ServerCARef, main.oncCurrent) >= 0)
-    $('#vpn-server-ca').val(vpnConfig.ServerCARef);
-  if (vpnConfig.ClientCertType == 'Pattern') {
-    if (onc.findCert(vpnConfig.ClientCertPattern.IssuerCARef,
-                     main.oncCurrent) >= 0) {
-      $('#vpn-client-ca').val(vpnConfig.ClientCertPattern.IssuerCARef);
-    }
-    if ('EnrollmentUri' in vpnConfig.ClientCertPattern)
-      $('#vpn-enrollment-uri').val(vpnConfig.ClientCertPattern.EnrollmentUri);
-  }
-};
-
-/**
- * Set up the UI with an object from ONC that has user credentials.
- * @param {Object} netconfig  VPN ONC object
- **/
-vpnDialog.setUserCredentialsToUi = function(vpnConfig) {
-  if ('Username' in vpnConfig)
-    $('#vpn-username').val(vpnConfig.Username);
-  if ('Password' in vpnConfig)
-    $('#vpn-password').val(vpnConfig.Password);
-  if ('SaveCredentials' in vpnConfig && vpnConfig.SaveCredentials)
-    $('#vpn-save-credentials')[0].checked = true;
-};
-
-/**
- * Set up the UI with given VPN ONC configuration.
- * @param {Object} netconfig  VPN ONC object
- **/
-vpnDialog.setToUi = function(netConfig) {
-  vpnDialog.oncBase = netConfig;
-  $('#vpn-name').val(netConfig.Name);
-  $('#vpn-guid').val(netConfig.GUID);
-  var vpnConfig = netConfig.VPN;
-  $('#vpn-type').val(vpnConfig.Type);
-  $('#vpn-host').val(vpnConfig.Host);
-  if (vpnConfig.Type == 'L2TP-IPsec') {
-    var ipsecConfig = vpnConfig.IPsec;
-    if (ipsecConfig.AuthenticationType == 'PSK') {
-      $('#vpn-type').val('L2TP-IPsec-PSK');
-      if ('PSK' in ipsecConfig)
-        $('#vpn-psk').val(ipsecConfig.PSK);
-    } else if (ipsecConfig.AuthenticationType == 'Cert') {
-      $('#vpn-type').val('L2TP-IPsec-Cert');
-      vpnDialog.setCertToUi(ipsecConfig);
-    }
-    vpnDialog.setUserCredentialsToUi(vpnConfig.L2TP);
-  } else {
-    $('#vpn-type').val('OpenVPN');
-    vpnDialog.setCertToUi(vpnConfig.OpenVPN);
-    vpnDialog.setUserCredentialsToUi(vpnConfig.OpenVPN);
-  }
-  networkDialog.setToUi(netConfig);
-};
-
diff --git a/wifi-dialog.js b/wifi-dialog.js
deleted file mode 100644
index d99add2..0000000
--- a/wifi-dialog.js
+++ /dev/null
@@ -1,298 +0,0 @@
-// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-/**
- * @fileoverview This file contains implementation for the VPN
- * configuration dialog.
- */
-
-/**
- * Namespace for WiFi dialog.
- */
-var wiFiDialog = {};
-
-/**
- * Called to hide/show fields according to settings.
- */
-wiFiDialog.setUiVisibility = function() {
-  wiFiDialog.setWifiSecurityVisible();
-  wiFiDialog.setEapVisible();
-  wiFiDialog.setCredentialsVisible();
-  networkDialog.setUiVisibility();
-};
-
-/**
- * Based on current Wi-Fi security setting, set visible configuration.
- */
-wiFiDialog.setWifiSecurityVisible = function() {
-  var security = $('#security').val();
-  if (security == 'WEP-PSK' || security == 'WPA-PSK') {
-    $('#passphrase-div').show();
-  } else {
-    $('#passphrase-div').hide();
-  }
-  if (security == 'WPA-EAP') {
-    $('#8021x-div').show();
-  } else {
-    $('#8021x-div').hide();
-  }
-};
-
-/**
- * Based on current EAP settings, return if password is required for
- * connection.
- * @returns {Boolean}
- */
-wiFiDialog.wifiRequiresPassword = function() {
-  var security = $('#eap').val();
-  return (security == 'EAP-TTLS' || security == 'PEAP' || security == 'LEAP');
-};
-
-/**
- * Based on current EAP settings, return if an inner authentication protocol
- * method setting is required.
- * @returns {Boolean}
- */
-wiFiDialog.wifiRequiresPhase2Method = function() {
-  var security = $('#eap').val();
-  return security == 'EAP-TTLS' || security == 'PEAP';
-};
-
-/**
- * Based on current EAP settings, return if a server certificate check is
- * required.
- * @returns {Boolean}
- */
-wiFiDialog.wifiRequiresServerCertificate = function() {
-  var security = $('#eap').val();
-  return (security == 'EAP-TTLS' || security == 'PEAP' ||
-          security == 'EAP-TLS');
-};
-
-/**
- * Based on current EAP settings, return if a client certificate check is
- * required.
- * @returns {Boolean}
- */
-wiFiDialog.wifiRequiresClientCertficate = function() {
-  return $('#eap').val() == 'EAP-TLS';
-};
-
-/**
- * Based on current EAP setting, set visible configuration.
- */
-wiFiDialog.setEapVisible = function() {
-  if (wiFiDialog.wifiRequiresPhase2Method()) {
-    $('#phase2-div').show();
-  } else {
-    $('#phase2-div').hide();
-  }
-
-  if (wiFiDialog.wifiRequiresServerCertificate()) {
-    $('#eap-server-ca').show();
-  } else {
-    $('#eap-server-ca').hide();
-  }
-
-  if (wiFiDialog.wifiRequiresClientCertficate()) {
-    $('#eap-client-cert').show();
-  } else {
-    $('#eap-client-cert').hide();
-  }
-};
-
-/**
- * Set visible credentials based on kind of EAP chosen.
- */
-wiFiDialog.setCredentialsVisible = function() {
-  if ($('#save-credentials').is(':checked'))
-    $('#phase2-auth-cred').show();
-  else
-    $('#phase2-auth-cred').hide();
-  if (wiFiDialog.wifiRequiresPassword())
-    $('#div-password', '#phase2-auth-cred').show();
-  else
-    $('#div-password', '#phase2-auth-cred').hide();
-};
-
-/**
- * Validate and convert the WiFi configuration to ONC.
- * @returns {Object}  Result array containing warnings, errors, and the
- *                    ONC NetworkConfiguration object for WiFi.
- */
-wiFiDialog.getFromUi = function() {
-  var network = {};
-  if (wiFiDialog.oncBase)
-    network = wiFiDialog.oncBase;
-  network.GUID = $('#wifi-guid').val();
-  network.Name = $('#ssid').val();
-  network.Type = 'WiFi';
-  onc.setUpAssocArray(network, 'WiFi');
-  network.WiFi.AutoConnect = $('#auto-connect').is(':checked');
-  network.WiFi.HiddenSSID = $('#hidden-ssid').is(':checked') != false;
-  network.WiFi.Security = $('#security').val();
-  network.WiFi.SSID = $('#ssid').val();
-  switch (network.WiFi.Security) {
-  case 'WEP-PSK':
-  case 'WPA-PSK':
-    network.WiFi.Passphrase = $('#passphrase').val();
-    delete network.WiFi.EAP;
-    break;
-  case 'WPA-EAP':
-    onc.setUpAssocArray(network.WiFi, 'EAP');
-    network.WiFi.EAP.Outer = $('#eap').val();
-    network.WiFi.EAP.UseSystemCAs = $('#wifi-server-ca').val() != 'ignore';
-    if ($('#save-credentials').is(':checked')) {
-      network.WiFi.EAP.SaveCredentials = true;
-      // Don't bother getting the username/password if save
-      // credentials is off.  That would be an inconsistent state.
-      network.WiFi.EAP.Identity = $('#wifi-identity').val();
-      network.WiFi.EAP.Password = $('#wifi-password').val();
-    }
-    if (wiFiDialog.wifiRequiresServerCertificate()) {
-      if ($('#wifi-server-ca').val() != 'default') {
-        network.WiFi.EAP.ServerCARef = $('#wifi-server-ca').val();
-      }
-    }
-    if (wiFiDialog.wifiRequiresClientCertficate()) {
-      network.WiFi.EAP.ClientCertType = 'Pattern';
-      onc.setUpAssocArray(network.WiFi.EAP, 'ClientCertPattern');
-      if ($('#wifi-client-ca').val() != 'empty') {
-        network.WiFi.EAP.ClientCertPattern.IssuerCARef =
-          $('#wifi-client-ca').val();
-      }
-      network.WiFi.EAP.ClientCertPattern.EnrollmentUri =
-        $('#wifi-enrollment-uri').val();
-    }
-    delete network.WiFi.Passphrase;
-    break;
-  }
-
-  if (network.WiFi.Security == 'WEP-PSK') {
-    var asciiLengths = [5, 13, 16, 29];
-    if (asciiLengths.indexOf(network.WiFi.Passphrase.length) != -1) {
-      // Store the WEP passphrase as hex as required by ONC.
-      network.WiFi.Passphrase = '0x' + main.toHex(network.WiFi.Passphrase);
-    } else {
-      var hexNumber = network.WiFi.Passphrase;
-      if (hexNumber.substr(0, 2) == '0x')
-        hexNumber = hexNumber.substr(2);
-      network.WiFi.Passphrase = '0x' + hexNumber.toLowerCase();
-    }
-  }
-  networkDialog.getFromUi(network);
-  return network;
-};
-
-/**
- * Handle apply button press on the WiFi modal dialog.  Responsible for
- * showing errors, blocking save, and dismissing modal dialog.
- */
-wiFiDialog.onApplyPress = function() {
-  var newWiFi = wiFiDialog.getFromUi();
-  var oncTest = onc.createUpdate(newWiFi, 'NetworkConfigurations');
-  var result = onc.validateNetwork(onc.findNetwork(newWiFi.GUID, oncTest),
-                                   oncTest);
-  ui.showMessagesAndApply(result, oncTest, $('#wifi-dialog')[0]);
-};
-
-/**
- * Called to initialize the WiFi dialog.
- */
-wiFiDialog.init = function() {
-  $('#ssid').val('');
-  $('#hidden-ssid')[0].checked = false;
-  $('#auto-connect')[0].checked = false;
-  ui.setSelectedI18n('#security', 'securityNone');
-  $('#passphrase').val('');
-  ui.setSelectedI18n('#eap', 'acronymPeap');
-  ui.setSelectedI18n('#phase2', 'automatic');
-  $('#save-credentials')[0].checked = false;
-  $('#wifi-identity').val('');
-  $('#wifi-password').val('');
-  $('#wifi-server-ca').val('');
-  $('#wifi-client-ca').val('');
-  $('#wifi-guid').val(main.createGuid());
-  var serverCaDom = $('#wifi-server-ca')[0];
-  serverCaDom.options.length = 0;
-  serverCaDom.options.add(new Option(chrome.i18n.getMessage
-                                     ('useAnyDefaultCA'), 'default'));
-  ui.updateCertificateDropdown(serverCaDom, false);
-  serverCaDom.options.add(new Option(chrome.i18n.getMessage
-                                     ('doNotCheckCA'), 'ignore'));
-  ui.updateCertificateDropdown($('#wifi-client-ca')[0], true);
-  $('#apply-button', '#wifi-dialog').click(wiFiDialog.onApplyPress);
-  $('#security').change(function() {
-    wiFiDialog.setUiVisibility();
-  });
-  $('#eap').change(wiFiDialog.setUiVisibility);
-  $('#save-credentials').click(function() {
-    wiFiDialog.setUiVisibility();
-  });
-  wiFiDialog.setUiVisibility();
-  networkDialog.init($('#wifi-dialog'));
-  $('#ssid').focus();
-};
-
-/**
- * Set up the UI with given WiFi ONC configuration.
- * @param {Object} netconfig  WiFi ONC object
- **/
-wiFiDialog.setToUi = function(netConfig) {
-  // Preserve any existing settings.
-  wiFiDialog.oncBase = netConfig;
-  $('#wifi-guid').val(netConfig.GUID);
-  wifiConfig = netConfig.WiFi;
-  $('#ssid').val(wifiConfig.SSID);
-  if ('AutoConnect' in wifiConfig)
-    $('#auto-connect')[0].checked = wifiConfig.AutoConnect != false;
-  if ('HiddenSSID' in wifiConfig)
-    $('#hidden-ssid')[0].checked = wifiConfig.HiddenSSID != false;
-  if ('Passphrase' in wifiConfig) {
-    // Strip off any '0x' from hex passphrases.  We'll correctly
-    // interpret it as a hex passphrase when we save and add the
-    // '0x' back on.
-    if (wifiConfig.Security == 'WEP-PSK' &&
-        wifiConfig.Passphrase.substr(0, 2) == '0x')
-      wifiConfig.Passphrase = wifiConfig.Passphrase.substr(2);
-    $('#passphrase').val(wifiConfig.Passphrase);
-  }
-  $('#security').val(wifiConfig.Security);
-  if ('EAP' in wifiConfig && wifiConfig.Security == 'WPA-EAP') {
-    var eapConfig = netConfig.WiFi.EAP;
-    switch (eapConfig.Outer) {
-    case 'PEAP':
-    case 'EAP-TTLS':
-    case 'EAP-TLS':
-    case 'LEAP':
-      $('#eap').val(eapConfig.Outer);
-      break;
-    }
-    if ('Identity' in eapConfig) {
-      $('#wifi-identity').val(eapConfig.Identity);
-    }
-    if ('Password' in eapConfig) {
-      $('#wifi-password').val(eapConfig.Password);
-    }
-    if ('SaveCredentials' in eapConfig && eapConfig.SaveCredentials)
-      $('#save-credentials')[0].checked = true;
-    if (onc.findCert(eapConfig.ServerCARef, main.oncCurrent) >= 0)
-      $('#wifi-server-ca').val(eapConfig.ServerCARef);
-    else if (!('UseSystemCAs' in eapConfig) || eapConfig.UseSystemCAs) {
-      $('#wifi-server-ca').val('default');
-    } else {
-      $('#wifi-server-ca').val('ignore');
-    }
-    if ('ClientCertPattern' in eapConfig) {
-      // TODO: handle more complex client cert patterns.
-      var certPattern = eapConfig.ClientCertPattern;
-      if ('IssuerCARef' in certPattern)
-        $('#wifi-client-ca').val(certPattern.IssuerCARef);
-      if ('EnrollmentUri' in certPattern)
-        $('#wifi-enrollment-uri').val(certPattern.EnrollmentUri);
-    }
-  }
-  networkDialog.setToUi(netConfig);
-};
-