41 #include <QtCore/QIODevice> 
   42 #include <QtCore/QTextCodec> 
   66   0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
 
   67   0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50,
 
   68   0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
 
   69   0x59, 0x5A, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66,
 
   70   0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E,
 
   71   0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76,
 
   72   0x77, 0x78, 0x79, 0x7A, 0x30, 0x31, 0x32, 0x33,
 
   73   0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x2B, 0x2F
 
   78   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
   79   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
   80   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
   81   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
   82   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
   83   0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x3F,
 
   84   0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B,
 
   85   0x3C, 0x3D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
   86   0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
 
   87   0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,
 
   88   0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
 
   89   0x17, 0x18, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00,
 
   90   0x00, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20,
 
   91   0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
 
   92   0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30,
 
   93   0x31, 0x32, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00
 
   98   0x60, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
 
   99   0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
 
  100   0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
 
  101   0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
 
  102   0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
 
  103   0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F,
 
  104   0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
 
  105   0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F
 
  110   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  111   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  112   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  113   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  114   0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
 
  115   0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
 
  116   0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
 
  117   0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
 
  118   0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
 
  119   0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
 
  120   0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
 
  121   0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
 
  122   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  123   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  124   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  125   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 
  130   '0', 
'1', 
'2', 
'3', 
'4', 
'5', 
'6', 
'7',
 
  131   '8', 
'9', 
'A', 
'B', 
'C', 
'D', 
'E', 
'F' 
  143   register const char * s = _s;
 
  147     if ((0 == *s) || (c == *s)) 
break; ++s;
 
  148     if ((0 == *s) || (c == *s)) 
break; ++s;
 
  149     if ((0 == *s) || (c == *s)) 
break; ++s;
 
  150     if ((0 == *s) || (c == *s)) 
break; ++s;
 
  171   unsigned int lineLength;
 
  174   const unsigned int length = in.size();
 
  175   const unsigned int end = length - 1;
 
  182   out.resize ((length*12)/10);
 
  188   for (
unsigned int i = 0; i < length; i++)
 
  190     unsigned char c (data[i]);
 
  194     pos = cursor-out.data();
 
  195     if (out.size()-pos < 16) {
 
  196       out.resize(out.size()+4096);
 
  197       cursor = out.data()+pos;
 
  202     if ((c >= 33) && (c <= 126) && (
'=' != c))
 
  216          ((i < end) && ((useCRLF && (
'\r' == data[i + 1]) && (
'\n' == data[i + 2]))
 
  218                         (!useCRLF && (
'\n' == data[i + 1]))))
 
  234     else if ((useCRLF && (
'\r' == c) && (i < end) && (
'\n' == data[i + 1])) ||
 
  235              (!useCRLF && (
'\n' == c)))
 
  276   out.truncate(cursor - out.data());
 
  296   const unsigned int length = in.size();
 
  302   for (
unsigned int i = 0; i < length; i++)
 
  313         if ((
'\n' == c1) || (
'\r' == c1 && 
'\n' == c2))
 
  328           if (hexChar0 < 16 && hexChar1 < 16)
 
  330             *cursor++ = char((hexChar0 * 16) | hexChar1);
 
  342   out.truncate(cursor - out.data());
 
  360     unsigned int sidx = 0;
 
  362     const char* data = in.data();
 
  363     const unsigned int len = in.size();
 
  365     unsigned int out_len = ((len+2)/3)*4;
 
  370     insertLFs = (insertLFs && out_len > 76);
 
  372       out_len += ((out_len-1)/76);
 
  375     out.resize( out_len );
 
  384                 if ( count && (count%76) == 0 )
 
  389             out[didx++] = 
Base64EncMap[((data[sidx+1] >> 4) & 017) |
 
  390                                        ((data[sidx] << 4) & 077)];
 
  391             out[didx++] = 
Base64EncMap[((data[sidx+2] >> 6) & 003) |
 
  392                                        ((data[sidx+1] << 2) & 077)];
 
  400         if ( insertLFs && (count > 0) && (count%76) == 0 )
 
  406             out[didx++] = 
Base64EncMap[((data[sidx+1] >> 4) & 017) |
 
  407                                        ((data[sidx] << 4) & 077)];
 
  417     while (didx < out.size())
 
  438     int len = in.size(), tail = len;
 
  439     const char* data = in.data();
 
  442     while ( count < len && (data[count] == 
'\n' || data[count] == 
'\r' ||
 
  443             data[count] == 
'\t' || data[count] == 
' ') )
 
  446     if ( strncasecmp(data+count, 
"begin", 5) == 0 )
 
  449         while ( count < len && data[count] != 
'\n' && data[count] != 
'\r' )
 
  452         while ( count < len && (data[count] == 
'\n' || data[count] == 
'\r') )
 
  456         tail = (len -= count);
 
  461     while ( data[tail-1] == 
'=' || data[tail-1] == 
'\n' ||
 
  462             data[tail-1] == 
'\r' )
 
  463         if ( data[--tail] != 
'=' ) len = tail;
 
  465     unsigned int outIdx = 0;
 
  466     out.resize( (count=len) );
 
  467     for (
int idx = 0; idx < count; idx++)
 
  471         unsigned char ch = data[idx];
 
  472         if ((ch > 47 && ch < 58) || (ch > 64 && ch < 91) ||
 
  473             (ch > 96 && ch < 123) || ch == 
'+' || ch == 
'/' || ch == 
'=')
 
  487     len = (tail>(len/4)) ? tail-(len/4) : 0;
 
  488     int sidx = 0, didx = 0;
 
  493           out[didx] = (((out[sidx] << 2) & 255) | ((out[sidx+1] >> 4) & 003));
 
  494           out[didx+1] = (((out[sidx+1] << 4) & 255) | ((out[sidx+2] >> 2) & 017));
 
  495           out[didx+2] = (((out[sidx+2] << 6) & 255) | (out[sidx+3] & 077));
 
  502         out[didx] = (((out[sidx] << 2) & 255) | ((out[sidx+1] >> 4) & 003));
 
  505         out[didx] = (((out[sidx+1] << 4) & 255) | ((out[sidx+2] >> 2) & 017));
 
  508     if ( len == 0 || len < out.size() )
 
  516     return QByteArray( out.data(), out.size()+1 );
 
  525     unsigned int sidx = 0;
 
  527     unsigned int line_len = 45;
 
  529     const char nl[] = 
"\n";
 
  530     const char* data = in.data();
 
  531     const unsigned int nl_len = strlen(nl);
 
  532     const unsigned int len = in.size();
 
  534     out.resize( (len+2)/3*4 + ((len+line_len-1)/line_len)*(nl_len+1) );
 
  536     while (sidx+line_len < len)
 
  542         for (
unsigned int end = sidx+line_len; sidx < end; sidx += 3)
 
  544             out[didx++] = 
UUEncMap[(data[sidx] >> 2) & 077];
 
  545             out[didx++] = 
UUEncMap[((data[sidx+1] >> 4) & 017) |
 
  546                                    ((data[sidx] << 4) & 077)];
 
  547             out[didx++] = 
UUEncMap[((data[sidx+2] >> 6) & 003) |
 
  548                                 ((data[sidx+1] << 2) & 077)];
 
  549             out[didx++] = 
UUEncMap[data[sidx+2] & 077];
 
  555         memcpy(out.data()+didx, nl, nl_len);
 
  564         out[didx++] = 
UUEncMap[(data[sidx] >> 2) & 077];
 
  565         out[didx++] = 
UUEncMap[((data[sidx+1] >> 4) & 017) |
 
  566                                ((data[sidx] << 4) & 077)];
 
  567         out[didx++] = 
UUEncMap[((data[sidx+2] >> 6) & 003) |
 
  568                                ((data[sidx+1] << 2) & 077)];
 
  569         out[didx++] = 
UUEncMap[data[sidx+2] & 077];
 
  575         out[didx++] = 
UUEncMap[(data[sidx] >> 2) & 077];
 
  576         out[didx++] = 
UUEncMap[((data[sidx+1] >> 4) & 017) |
 
  577                                ((data[sidx] << 4) & 077)];
 
  578         out[didx++] = 
UUEncMap[(data[sidx+1] << 2) & 077];
 
  583         out[didx++] = 
UUEncMap[(data[sidx] >> 2) & 077];
 
  584         out[didx++] = 
UUEncMap[(data[sidx] << 4) & 077];
 
  590     memcpy(out.data()+didx, nl, nl_len);
 
  594     if ( didx != out.size() )
 
  615     const char* data = in.data();
 
  619     while ( count < len && (data[count] == 
'\n' || data[count] == 
'\r' ||
 
  620             data[count] == 
'\t' || data[count] == 
' ') )
 
  624     if ( strncasecmp( data+count, 
"begin", 5) == 0 )
 
  627         while ( count < len && data[count] != 
'\n' && data[count] != 
'\r' )
 
  630         while ( count < len && (data[count] == 
'\n' || data[count] == 
'\r') )
 
  638     out.resize( len/4*3 );
 
  642         line_len = 
UUDecMap[ (
unsigned char) data[sidx++]];
 
  649              A = 
UUDecMap[(
unsigned char) data[sidx]];
 
  650              B = 
UUDecMap[(
unsigned char) data[sidx+1]];
 
  651              C = 
UUDecMap[(
unsigned char) data[sidx+2]];
 
  652              D = 
UUDecMap[(
unsigned char) data[sidx+3]];
 
  653              out[didx++] = ( ((A << 2) & 255) | ((B >> 4) & 003) );
 
  654              out[didx++] = ( ((B << 4) & 255) | ((C >> 2) & 017) );
 
  655              out[didx++] = ( ((C << 6) & 255) | (D & 077) );
 
  662             A = 
UUDecMap[(
unsigned char) data[sidx]];
 
  663             B = 
UUDecMap[(
unsigned char) data[sidx+1]];
 
  664             out[didx++] = ( ((A << 2) & 255) | ((B >> 4) & 003) );
 
  669             B = 
UUDecMap[(
unsigned char) data[sidx+1]];
 
  670             C = 
UUDecMap[(
unsigned char) data[sidx+2]];
 
  671             out[didx++] = ( ((B << 4) & 255) | ((C >> 2) & 017) );
 
  675         while (sidx < len  && data[sidx] != 
'\n' && data[sidx] != 
'\r')
 
  679         while (sidx < len  && (data[sidx] == 
'\n' || data[sidx] == 
'\r'))
 
  683         if ( hasLF && strncasecmp( data+sidx, 
"end", 3) == 0 )
 
  687     if ( didx < out.size()  )
 
  701     if(!msg.startsWith(QLatin1String(
"=?")) || (encEnd=msg.lastIndexOf(QLatin1String(
"?=")))==-1)
 
  704     notEncodedText=msg.mid(encEnd+2);
 
  705     encodedText=msg.left(encEnd);
 
  706     encodedText=encodedText.mid(2,encodedText.length()-2);
 
  707     int questionMark=encodedText.indexOf(QLatin1Char(
'?'));
 
  708     if (questionMark==-1)
 
  710     charset=encodedText.left(questionMark).toLower();
 
  711     encoding=encodedText.at(questionMark+1).toLower();
 
  712     if (encoding != QLatin1Char(
'b') && encoding != QLatin1Char(
'q'))
 
  714     encodedText=encodedText.mid(questionMark+3);
 
  715     if(charset.indexOf(QLatin1Char(
' '))!=-1 && encodedText.indexOf(QLatin1Char(
' '))!=-1)
 
  718     QByteArray tmpIn = encodedText.toLocal8Bit();
 
  719     if(encoding == QLatin1Char(
'q'))
 
  723     if (charset != QLatin1String(
"us-ascii")) {
 
  724         QTextCodec *codec = QTextCodec::codecForName(charset.toLocal8Bit());
 
  727         decodedText = codec->toUnicode(tmpOut);
 
  728         decodedText = decodedText.replace(QLatin1Char(
'_'), QLatin1Char(
' '));
 
  730         decodedText = QString::fromLocal8Bit(tmpOut.replace(
'_', 
' '));
 
  733     return decodedText + notEncodedText;
 
  764     update(in.data(), int(in.size()));
 
  769     update(reinterpret_cast<const unsigned char*>(in), len);
 
  775         len = qstrlen(reinterpret_cast<const char*>(in));
 
  781         kWarning() << 
"KMD5::update called after state was finalized!";
 
  790     buffer_index = 
static_cast<quint32>((m_count[0] >> 3) & 0x3F);
 
  792     if (  (m_count[0] += (in_length << 3))<(in_length << 3) )
 
  795     m_count[1] += (in_length >> 29);
 
  796     buffer_space = 64 - buffer_index;
 
  798     if (in_length >= buffer_space)
 
  800         memcpy (m_buffer + buffer_index, in, buffer_space);
 
  803         for (in_index = buffer_space; in_index + 63 < in_length;
 
  805             transform (reinterpret_cast<const unsigned char*>(in+in_index));
 
  812     memcpy(m_buffer+buffer_index, in+in_index, in_length-in_index);
 
  820     while ((len=file.read(buffer, 
sizeof(buffer))) > 0)
 
  828     if (m_finalized) 
return;
 
  832     static const unsigned char PADDING[64]=
 
  834         0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 
  835         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 
  836         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 
  837         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 
  840     encode (bits, m_count, 8);
 
  844     index = 
static_cast<quint32>((m_count[0] >> 3) & 0x3f);
 
  845     padLen = (index < 56) ? (56 - index) : (120 - index);
 
  846     update (reinterpret_cast<const char*>(PADDING), padLen);
 
  849     update (reinterpret_cast<const char*>(bits), 8);
 
  852     encode (m_digest, m_state, 16);
 
  856     memset ( (
void *)m_buffer, 0, 
sizeof(*m_buffer));
 
  871     return (0 == strcmp(
hexDigest().data(), hexdigest));
 
  883     memcpy( bin, m_digest, 16 );
 
  892     sprintf(s.data(), 
"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
 
  893             m_digest[0], m_digest[1], m_digest[2], m_digest[3], m_digest[4], m_digest[5],
 
  894             m_digest[6], m_digest[7], m_digest[8], m_digest[9], m_digest[10], m_digest[11],
 
  895             m_digest[12], m_digest[13], m_digest[14], m_digest[15]);
 
  904     sprintf(s.data(), 
"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
 
  905             m_digest[0], m_digest[1], m_digest[2], m_digest[3], m_digest[4], m_digest[5],
 
  906             m_digest[6], m_digest[7], m_digest[8], m_digest[9], m_digest[10], m_digest[11],
 
  907             m_digest[12], m_digest[13], m_digest[14], m_digest[15]);
 
  913     return QByteArray::fromRawData(reinterpret_cast<const char*>(m_digest),16).toBase64();
 
  929     m_state[0] = 0x67452301;
 
  930     m_state[1] = 0xefcdab89;
 
  931     m_state[2] = 0x98badcfe;
 
  932     m_state[3] = 0x10325476;
 
  934     memset ( m_buffer, 0, 
sizeof(*m_buffer));
 
  935     memset ( m_digest, 0, 
sizeof(*m_digest));
 
  941     quint32 a = m_state[0], b = m_state[1], c = m_state[2], d = m_state[3], x[16];
 
  943     decode (x, block, 64);
 
  946     Q_ASSERT(!m_finalized);  
 
  949     FF (a, b, c, d, x[ 0], 
KMD5_S11, 0xd76aa478); 
 
  950     FF (d, a, b, c, x[ 1], 
KMD5_S12, 0xe8c7b756); 
 
  951     FF (c, d, a, b, x[ 2], 
KMD5_S13, 0x242070db); 
 
  952     FF (b, c, d, a, x[ 3], 
KMD5_S14, 0xc1bdceee); 
 
  953     FF (a, b, c, d, x[ 4], 
KMD5_S11, 0xf57c0faf); 
 
  954     FF (d, a, b, c, x[ 5], 
KMD5_S12, 0x4787c62a); 
 
  955     FF (c, d, a, b, x[ 6], 
KMD5_S13, 0xa8304613); 
 
  956     FF (b, c, d, a, x[ 7], 
KMD5_S14, 0xfd469501); 
 
  957     FF (a, b, c, d, x[ 8], 
KMD5_S11, 0x698098d8); 
 
  958     FF (d, a, b, c, x[ 9], 
KMD5_S12, 0x8b44f7af); 
 
  959     FF (c, d, a, b, x[10], 
KMD5_S13, 0xffff5bb1); 
 
  960     FF (b, c, d, a, x[11], 
KMD5_S14, 0x895cd7be); 
 
  961     FF (a, b, c, d, x[12], 
KMD5_S11, 0x6b901122); 
 
  962     FF (d, a, b, c, x[13], 
KMD5_S12, 0xfd987193); 
 
  963     FF (c, d, a, b, x[14], 
KMD5_S13, 0xa679438e); 
 
  964     FF (b, c, d, a, x[15], 
KMD5_S14, 0x49b40821); 
 
  967     GG (a, b, c, d, x[ 1], 
KMD5_S21, 0xf61e2562); 
 
  968     GG (d, a, b, c, x[ 6], 
KMD5_S22, 0xc040b340); 
 
  969     GG (c, d, a, b, x[11], 
KMD5_S23, 0x265e5a51); 
 
  970     GG (b, c, d, a, x[ 0], 
KMD5_S24, 0xe9b6c7aa); 
 
  971     GG (a, b, c, d, x[ 5], 
KMD5_S21, 0xd62f105d); 
 
  972     GG (d, a, b, c, x[10], 
KMD5_S22,  0x2441453); 
 
  973     GG (c, d, a, b, x[15], 
KMD5_S23, 0xd8a1e681); 
 
  974     GG (b, c, d, a, x[ 4], 
KMD5_S24, 0xe7d3fbc8); 
 
  975     GG (a, b, c, d, x[ 9], 
KMD5_S21, 0x21e1cde6); 
 
  976     GG (d, a, b, c, x[14], 
KMD5_S22, 0xc33707d6); 
 
  977     GG (c, d, a, b, x[ 3], 
KMD5_S23, 0xf4d50d87); 
 
  978     GG (b, c, d, a, x[ 8], 
KMD5_S24, 0x455a14ed); 
 
  979     GG (a, b, c, d, x[13], 
KMD5_S21, 0xa9e3e905); 
 
  980     GG (d, a, b, c, x[ 2], 
KMD5_S22, 0xfcefa3f8); 
 
  981     GG (c, d, a, b, x[ 7], 
KMD5_S23, 0x676f02d9); 
 
  982     GG (b, c, d, a, x[12], 
KMD5_S24, 0x8d2a4c8a); 
 
  985     HH (a, b, c, d, x[ 5], 
KMD5_S31, 0xfffa3942); 
 
  986     HH (d, a, b, c, x[ 8], 
KMD5_S32, 0x8771f681); 
 
  987     HH (c, d, a, b, x[11], 
KMD5_S33, 0x6d9d6122); 
 
  988     HH (b, c, d, a, x[14], 
KMD5_S34, 0xfde5380c); 
 
  989     HH (a, b, c, d, x[ 1], 
KMD5_S31, 0xa4beea44); 
 
  990     HH (d, a, b, c, x[ 4], 
KMD5_S32, 0x4bdecfa9); 
 
  991     HH (c, d, a, b, x[ 7], 
KMD5_S33, 0xf6bb4b60); 
 
  992     HH (b, c, d, a, x[10], 
KMD5_S34, 0xbebfbc70); 
 
  993     HH (a, b, c, d, x[13], 
KMD5_S31, 0x289b7ec6); 
 
  994     HH (d, a, b, c, x[ 0], 
KMD5_S32, 0xeaa127fa); 
 
  995     HH (c, d, a, b, x[ 3], 
KMD5_S33, 0xd4ef3085); 
 
  996     HH (b, c, d, a, x[ 6], 
KMD5_S34,  0x4881d05); 
 
  997     HH (a, b, c, d, x[ 9], 
KMD5_S31, 0xd9d4d039); 
 
  998     HH (d, a, b, c, x[12], 
KMD5_S32, 0xe6db99e5); 
 
  999     HH (c, d, a, b, x[15], 
KMD5_S33, 0x1fa27cf8); 
 
 1000     HH (b, c, d, a, x[ 2], 
KMD5_S34, 0xc4ac5665); 
 
 1003     II (a, b, c, d, x[ 0], 
KMD5_S41, 0xf4292244); 
 
 1004     II (d, a, b, c, x[ 7], 
KMD5_S42, 0x432aff97); 
 
 1005     II (c, d, a, b, x[14], 
KMD5_S43, 0xab9423a7); 
 
 1006     II (b, c, d, a, x[ 5], 
KMD5_S44, 0xfc93a039); 
 
 1007     II (a, b, c, d, x[12], 
KMD5_S41, 0x655b59c3); 
 
 1008     II (d, a, b, c, x[ 3], 
KMD5_S42, 0x8f0ccc92); 
 
 1009     II (c, d, a, b, x[10], 
KMD5_S43, 0xffeff47d); 
 
 1010     II (b, c, d, a, x[ 1], 
KMD5_S44, 0x85845dd1); 
 
 1011     II (a, b, c, d, x[ 8], 
KMD5_S41, 0x6fa87e4f); 
 
 1012     II (d, a, b, c, x[15], 
KMD5_S42, 0xfe2ce6e0); 
 
 1013     II (c, d, a, b, x[ 6], 
KMD5_S43, 0xa3014314); 
 
 1014     II (b, c, d, a, x[13], 
KMD5_S44, 0x4e0811a1); 
 
 1015     II (a, b, c, d, x[ 4], 
KMD5_S41, 0xf7537e82); 
 
 1016     II (d, a, b, c, x[11], 
KMD5_S42, 0xbd3af235); 
 
 1017     II (c, d, a, b, x[ 2], 
KMD5_S43, 0x2ad7d2bb); 
 
 1018     II (b, c, d, a, x[ 9], 
KMD5_S44, 0xeb86d391); 
 
 1025     memset ( static_cast<void *>(x), 0, 
sizeof(x) );
 
 1030     return (x << n) | (x >> (32-n))  ;
 
 1035     return (x & y) | (~x & z);
 
 1040     return (x & z) | (y & ~z);
 
 1050     return y ^ (x | ~z);
 
 1056     a += F(b, c, d) + x + ac;
 
 1057     a = rotate_left (a, s) +b;
 
 1063     a += G(b, c, d) + x + ac;
 
 1064     a = rotate_left (a, s) +b;
 
 1070     a += H(b, c, d) + x + ac;
 
 1071     a = rotate_left (a, s) +b;
 
 1077     a += I(b, c, d) + x + ac;
 
 1078     a = rotate_left (a, s) +b;
 
 1084 #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN 
 1085     memcpy(output, in, len);
 
 1088     for (i = 0, j = 0; j < len; i++, j += 4)
 
 1090         output[j]   = 
static_cast<quint8
>((in[i] & 0xff));
 
 1091         output[j+1] = 
static_cast<quint8
>(((in[i] >> 8) & 0xff));
 
 1092         output[j+2] = 
static_cast<quint8
>(((in[i] >> 16) & 0xff));
 
 1093         output[j+3] = 
static_cast<quint8
>(((in[i] >> 24) & 0xff));
 
 1100 void KMD5::decode (
quint32 *output, 
const unsigned char* in, 
quint32 len)
 
 1102 #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN 
 1103     memcpy(output, in, len);
 
 1107     for (i = 0, j = 0; j < len; i++, j += 4)
 
 1108         output[i] = static_cast<quint32>(in[j]) |
 
 1109                     (
static_cast<quint32>(in[j+1]) << 8)  |
 
 1110                     (
static_cast<quint32>(in[j+2]) << 16) |
 
 1111                     (
static_cast<quint32>(in[j+3]) << 24);
 
static const char UUEncMap[64]
QString decodeRFC2047String(const QString &text)
Decodes string text according to RFC2047, i.e., the construct =?charset?[qb]?encoded?=. 
static const char hexChars[16]
static const char Base64EncMap[64]
QByteArray uudecode(const QByteArray &in)
Decodes the given data using the uudecode algorithm. 
static const char UUDecMap[128]
bool verify(const KMD5::Digest &digest)
returns true if the calculated digest for the given message matches the given one. 
QByteArray base64Decode(const QByteArray &in)
Decodes the given data that was encoded using the base64 algorithm. 
void update(const char *in, int len=-1)
Updates the message to be digested. 
const Digest & rawDigest()
QByteArray quotedPrintableEncode(const QByteArray &in, bool useCRLF=true)
Encodes the given data using the quoted-printable algorithm. 
QByteArray hexDigest()
Returns the value of the calculated message digest in a hexadecimal representation. 
void finalize()
finalizes the digest 
QByteArray base64Encode(const QByteArray &in, bool insertLFs=false)
Encodes the given data using the base64 algorithm. 
void transform(const unsigned char buffer[64])
Performs the real update work. 
void output(QList< Action > actions, QHash< QString, QString > domain)
static int rikFindChar(register const char *_s, const char c)
QByteArray uuencode(const QByteArray &in)
Encodes the given data using the uuencode algorithm. 
void reset()
Calling this function will reset the calculated message digest. 
static const char Base64DecMap[128]
static const unsigned int maxQPLineLength
QByteArray base64Digest()
Returns the value of the calculated message digest in a base64-encoded representation. 
QByteArray quotedPrintableDecode(const QByteArray &in)
Decodes a quoted-printable encoded data.