sl@0: // COMMENTS SHOULD ALWAYS BEGIN IN A NEW LINE, NEVER EMBED COMMENTS WITHIN DATA sl@0: sl@0: ENCRYPT_TEST_DATA_1 sl@0: // To test setkey() and encrypt() functions with all zeroes as key and data sl@0: KEY :0000000000000000000000000000000000000000000000000000000000000000 sl@0: DATA_BLOCK :0000000000000000000000000000000000000000000000000000000000000000 sl@0: // A value of 0 indicates encryption sl@0: ED_FLAG :0 sl@0: EXPECTED_OUTPUT:1000110010100110010011011110100111000001101100010010001110100111 sl@0: END_TEST_DATA sl@0: sl@0: ENCRYPT_TEST_DATA_2 sl@0: // To test setkey() and encrypt() functions with all zeroes as key sl@0: KEY :0000000000000000000000000000000000000000000000000000000000000000 sl@0: DATA_BLOCK :0000100110000000000000011110110100001001100001010000010100101100 sl@0: // A value of 0 indicates encryption sl@0: ED_FLAG :0 sl@0: EXPECTED_OUTPUT:0110110110000110111111010111001001101010001000001011011010110001 sl@0: END_TEST_DATA sl@0: sl@0: ENCRYPT_TEST_DATA_3 sl@0: // To test setkey() and encrypt() functions with all ones in the bit vectors of sl@0: // both key and data sl@0: KEY :1111111111111111111111111111111111111111111111111111111111111111 sl@0: DATA_BLOCK :1111111111111111111111111111111111111111111111111111111111111111 sl@0: // A value of 0 indicates encryption sl@0: ED_FLAG :0 sl@0: EXPECTED_OUTPUT:0111001101011001101100100001011000111110010011101101110001011000 sl@0: END_TEST_DATA sl@0: sl@0: ENCRYPT_TEST_DATA_4 sl@0: // To test setkey() and encrypt() functions with all ones in the bit vector of sl@0: // key sl@0: KEY :1111111111111111111111111111111111111111111111111111111111111111 sl@0: DATA_BLOCK :0111000101110011011000110111010011010001011010010110111101111111 sl@0: // A value of 0 indicates encryption sl@0: ED_FLAG :0 sl@0: EXPECTED_OUTPUT:1101100001000111000111011001010111011111101101101111101010001100 sl@0: END_TEST_DATA sl@0: sl@0: ENCRYPT_TEST_DATA_5 sl@0: // To test setkey() and encrypt() functions sl@0: KEY :0101101001111010101010100101110001111101101010100111011111101010 sl@0: DATA_BLOCK :0000100110000000000000011110110100001001100001010000010100101100 sl@0: // A value of 0 indicates encryption sl@0: ED_FLAG :0 sl@0: EXPECTED_OUTPUT:1001110010101010100010100010111111100110001001001101000000111110 sl@0: END_TEST_DATA sl@0: sl@0: ENCRYPT_TEST_DATA_6 sl@0: // To test setkey() and encrypt() functions. KEY value is unchanged sl@0: KEY :0101101001111010101010100101110001111101101010100111011111101010 sl@0: DATA_BLOCK :0111000101110011011000110111010011010001011010010110111101111111 sl@0: // A value of 0 indicates encryption sl@0: ED_FLAG :0 sl@0: EXPECTED_OUTPUT:1010100110000001111010011100110101001111111010111001100000110100 sl@0: END_TEST_DATA sl@0: sl@0: ENCRYPT_TEST_DATA_7 sl@0: // To test setkey() and encrypt() function. Key value is unchanged sl@0: KEY :0101101001111010101010100101110001111101101010100111011111101010 sl@0: DATA_BLOCK :0000000000000000000000000000000000000000000000000000000000000000 sl@0: // A value of 0 indicates encryption sl@0: ED_FLAG :0 sl@0: EXPECTED_OUTPUT:1111111101110111111110100101100000110110100100001110000110111111 sl@0: END_TEST_DATA sl@0: sl@0: ENCRYPT_TEST_DATA_8 sl@0: // To test setkey() and encrypt() function. Key value is unchanged sl@0: KEY :0101101001111010101010100101110001111101101010100111011111101010 sl@0: DATA_BLOCK :1111111111111111111111111111111111111111111111111111111111111111 sl@0: // A value of 0 indicates encryption sl@0: ED_FLAG :0 sl@0: EXPECTED_OUTPUT: 1111110011010110011011000110100010111111001110111000011111101100 sl@0: END_TEST_DATA sl@0: sl@0: ENCRYPT_TEST_DATA_9 sl@0: // To test setkey() and encrypt() function. ED_FLAG changed to denote a decrypt action. sl@0: KEY :0101101001111010101010100101110001111101101010100111011111101010 sl@0: DATA_BLOCK :1111110011010110011011000110100010111111001110111000011111101100 sl@0: // A value of 0 indicates encryption sl@0: ED_FLAG :1 sl@0: EXPECTED_OUTPUT: 11111111111111111111111111111111111111111111111111111111111111111 sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_1 sl@0: // To test crypt() function - DES algorithm. Password-eight characters in length sl@0: PASSWORD :password sl@0: SALT :XY sl@0: EXPECTED_OUTPUT:XYGpusIMIT/IM sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_2 sl@0: // To test crypt() function - DES algorithm. Password-less than eight characters sl@0: // in length sl@0: PASSWORD :passS sl@0: SALT :XY sl@0: EXPECTED_OUTPUT:XYGFf3I4Sg2K2 sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_3 sl@0: // To test crypt() function - DES algorithm. Password-less than eight characters sl@0: // in length sl@0: PASSWORD :pa sl@0: SALT :9D sl@0: EXPECTED_OUTPUT:9DWVv8b/n8C2M sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_4 sl@0: // To test crypt() function - DES algorithm. Password-more than eight characters sl@0: // in length sl@0: PASSWORD :passwordXYTEY sl@0: SALT :.Q sl@0: EXPECTED_OUTPUT:.Q7kADsEJ1WMI sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_5 sl@0: // To test crypt() function - DES algorithm. Password-more than eight characters sl@0: // in length - notice that the output depends on the first eight characters of sl@0: // the passowrd and "salt". sl@0: PASSWORD :passwordXY367USH sl@0: SALT :.Q sl@0: EXPECTED_OUTPUT:.Q7kADsEJ1WMI sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_6 sl@0: // To test crypt() function - DES algorithm. NULL as password with a valid "salt" sl@0: PASSWORD : sl@0: SALT :.Q sl@0: EXPECTED_OUTPUT:.QJ.W2gUJgXaI sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_7 sl@0: // To test crypt() function - DES algorithm. NULL as password with a valid "salt" sl@0: PASSWORD : sl@0: SALT :YU sl@0: EXPECTED_OUTPUT:YU6VVzA5TJabA sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_8 sl@0: // To test crypt() function - DES algorithm. NULL as password with a valid "salt" sl@0: PASSWORD : sl@0: SALT :/. sl@0: EXPECTED_OUTPUT:/.elhbtlysKy6 sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_9 sl@0: // To test crypt() function - DES algorithm. NULL as password with a valid "salt" sl@0: PASSWORD : sl@0: SALT :// sl@0: EXPECTED_OUTPUT://plGAV7Hp3Zo sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_10 sl@0: // To test crypt() function - DES algorithm. NULL as password with a valid "salt" sl@0: PASSWORD : sl@0: SALT :aB sl@0: EXPECTED_OUTPUT:aBtwyC/9wKybE sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_11 sl@0: // To test crypt() function - DES algorithm. Valid password with a "salt" which sl@0: // is one-character in length. Output differs from that of Linux's sl@0: PASSWORD :OuEIW90I sl@0: SALT :a sl@0: EXPECTED_OUTPUT: sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_12 sl@0: // To test crypt() function - DES algorithm. Valid password with a "salt" which sl@0: // is longer two characters in length sl@0: PASSWORD :OuEIW90I sl@0: SALT :iKOI0 sl@0: EXPECTED_OUTPUT:iKr4GcNvuB/Wk sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_13 sl@0: // To test crypt() function - DES algorithm. A valid password and no "salt" sl@0: // Output differs from that of Linux's sl@0: PASSWORD :uShyU7w9 sl@0: SALT : sl@0: EXPECTED_OUTPUT: sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_14 sl@0: // To test crypt() function. Both password and salt being sl@0: // NULL. Output differs from that of Linux's sl@0: PASSWORD : sl@0: SALT : sl@0: EXPECTED_OUTPUT: sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_15 sl@0: // To test crypt() function - MD5 algorithm. Both password and salt sl@0: // are valid sl@0: PASSWORD :password sl@0: SALT :$1$ sl@0: EXPECTED_OUTPUT:$1$$I2o9Z7NcvQAKp7wyCTlia0 sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_16 sl@0: // To test crypt() function - MD5 algorithm. Both password and salt sl@0: // are valid with password being more than 8 characters in length sl@0: PASSWORD :passwordUEI091H sl@0: SALT :$1$ sl@0: EXPECTED_OUTPUT:$1$$V1X9nybzyUbSXdm8CAqve. sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_018 sl@0: // To test crypt() function - MD5 algorithm. Both password and salt sl@0: // are valid with password being more than 8 characters in length, and sl@0: // '/' embedded within the string. Salt consists of "$1$" followed sl@0: // by eight characters, and terminated by "$" sl@0: PASSWORD :pass//rdI09Y. sl@0: SALT :$1$password$ sl@0: EXPECTED_OUTPUT:$1$password$PnpYLDVZ8stpwScDiSk170 sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_17 sl@0: // To test crypt() function - MD5 algorithm. Both password and salt sl@0: // are valid with password being more than 8 characters in length, and sl@0: // '/' embedded within the string. Salt consists of "$1$" followed sl@0: // by eight characters, and NOT terminated by "$" sl@0: PASSWORD :pass//rdI09Y. sl@0: SALT :$1$password sl@0: EXPECTED_OUTPUT:$1$password$PnpYLDVZ8stpwScDiSk170 sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_18 sl@0: // To test crypt() function - MD5 algorithm. Both password and salt sl@0: // are valid with password being more than 8 characters in length, and sl@0: // '/' embedded within the string. Salt consists of just "$1$" sl@0: PASSWORD :pass//rdI09Y. sl@0: SALT :$1$ sl@0: EXPECTED_OUTPUT:$1$$Q.yyUXhIuZxEiqLaLs9Yt/ sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_19 sl@0: // To test crypt() function - MD5 algorithm. Both password and salt sl@0: // are valid with the length of the password being less than 8. sl@0: // Salt consists of just "$1$" sl@0: PASSWORD ://URi sl@0: SALT :$1$ sl@0: EXPECTED_OUTPUT:$1$$dNOmQGH620K312nN0mn1H/ sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_20 sl@0: // To test crypt() function - MD5 algorithm. Both password and salt sl@0: // are valid with the length of the password being less than 8. sl@0: // Salt consists of "$1$" followed by a string, and terminated by sl@0: // "$" sl@0: PASSWORD ://URi sl@0: SALT :$1$paU7$ sl@0: EXPECTED_OUTPUT:$1$paU7$L1IzpLbp2c1NZn1fI5ZF3/ sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_21 sl@0: // To test crypt() function - MD5 algorithm. Both password and salt sl@0: // are valid with the length of the password being less than 8. sl@0: // Salt consists of "$1$" followed by a string, and NOT terminated by sl@0: // "$" sl@0: PASSWORD ://URi sl@0: SALT :$1$paU7 sl@0: EXPECTED_OUTPUT:$1$paU7$L1IzpLbp2c1NZn1fI5ZF3/ sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_22 sl@0: // To test crypt() function - MD5 algorithm. Both password and salt sl@0: // are valid with the length of the password being less than 8. sl@0: // Salt consists of just "$1$" sl@0: PASSWORD ://URi sl@0: SALT :$1$ sl@0: EXPECTED_OUTPUT:$1$$dNOmQGH620K312nN0mn1H/ sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_23 sl@0: // To test crypt() function - MD5 algorithm. NULL as password and "$1$" sl@0: // as salt sl@0: PASSWORD : sl@0: SALT :$1$ sl@0: EXPECTED_OUTPUT:$1$$qRPK7m23GJusamGpoGLby/ sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_24 sl@0: // To test crypt() function - MD5 algorithm. NULL as password. Salt consists sl@0: // of "$1$" followed by a string, and terminated by "$" sl@0: PASSWORD : sl@0: SALT :$1$oI./$ sl@0: EXPECTED_OUTPUT:$1$oI./$rZsQHWhxaiZQFk7TPVtZv0 sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_25 sl@0: // To test crypt() function - MD5 algorithm. NULL as password. Salt consists sl@0: // of "$1$" followed by a string with a "$" embedded within the string, and sl@0: // NOT terminated by "$" sl@0: PASSWORD : sl@0: SALT :$1$o$./ sl@0: EXPECTED_OUTPUT:$1$o$q44o3M/kTKnXAewu70WtZ/ sl@0: END_TEST_DATA sl@0: sl@0: CRYPT_TEST_DATA_26 sl@0: // To test crypt() function - MD5 algorithm. NULL as password. Salt consists sl@0: // of "$1$" followed by a string, and NOT terminated by "$" sl@0: PASSWORD : sl@0: SALT :$1$oi8URVn sl@0: EXPECTED_OUTPUT:$1$oi8URVn$f8o6zSdfLb/OggBchx70f0 sl@0: END_TEST_DATA sl@0: