stdlibs/libcrypt/test/group/test_data.dat
changeset 59 09fa7c3c5079
equal deleted inserted replaced
52:bf6a71c50e42 59:09fa7c3c5079
       
     1 // COMMENTS SHOULD ALWAYS BEGIN IN A NEW LINE, NEVER EMBED COMMENTS WITHIN DATA
       
     2 
       
     3 ENCRYPT_TEST_DATA_1
       
     4 // To test setkey() and encrypt() functions with  all zeroes as key and data
       
     5 KEY            :0000000000000000000000000000000000000000000000000000000000000000
       
     6 DATA_BLOCK     :0000000000000000000000000000000000000000000000000000000000000000
       
     7 // A value of 0 indicates encryption
       
     8 ED_FLAG        :0
       
     9 EXPECTED_OUTPUT:1000110010100110010011011110100111000001101100010010001110100111
       
    10 END_TEST_DATA
       
    11 
       
    12 ENCRYPT_TEST_DATA_2
       
    13 // To test setkey() and encrypt() functions with  all zeroes as key
       
    14 KEY            :0000000000000000000000000000000000000000000000000000000000000000
       
    15 DATA_BLOCK     :0000100110000000000000011110110100001001100001010000010100101100
       
    16 // A value of 0 indicates encryption
       
    17 ED_FLAG        :0
       
    18 EXPECTED_OUTPUT:0110110110000110111111010111001001101010001000001011011010110001
       
    19 END_TEST_DATA
       
    20 
       
    21 ENCRYPT_TEST_DATA_3
       
    22 // To test setkey() and encrypt() functions with all ones in the bit vectors of
       
    23 // both key and data
       
    24 KEY            :1111111111111111111111111111111111111111111111111111111111111111
       
    25 DATA_BLOCK     :1111111111111111111111111111111111111111111111111111111111111111
       
    26 // A value of 0 indicates encryption
       
    27 ED_FLAG        :0
       
    28 EXPECTED_OUTPUT:0111001101011001101100100001011000111110010011101101110001011000
       
    29 END_TEST_DATA
       
    30 
       
    31 ENCRYPT_TEST_DATA_4
       
    32 // To test setkey() and encrypt() functions with all ones in the bit vector of
       
    33 // key
       
    34 KEY            :1111111111111111111111111111111111111111111111111111111111111111
       
    35 DATA_BLOCK     :0111000101110011011000110111010011010001011010010110111101111111
       
    36 // A value of 0 indicates encryption
       
    37 ED_FLAG        :0
       
    38 EXPECTED_OUTPUT:1101100001000111000111011001010111011111101101101111101010001100
       
    39 END_TEST_DATA
       
    40 
       
    41 ENCRYPT_TEST_DATA_5
       
    42 // To test setkey() and encrypt() functions
       
    43 KEY            :0101101001111010101010100101110001111101101010100111011111101010
       
    44 DATA_BLOCK     :0000100110000000000000011110110100001001100001010000010100101100
       
    45 // A value of 0 indicates encryption
       
    46 ED_FLAG        :0
       
    47 EXPECTED_OUTPUT:1001110010101010100010100010111111100110001001001101000000111110
       
    48 END_TEST_DATA
       
    49 
       
    50 ENCRYPT_TEST_DATA_6
       
    51 // To test setkey() and encrypt() functions. KEY value is unchanged
       
    52 KEY            :0101101001111010101010100101110001111101101010100111011111101010
       
    53 DATA_BLOCK     :0111000101110011011000110111010011010001011010010110111101111111
       
    54 // A value of 0 indicates encryption
       
    55 ED_FLAG        :0
       
    56 EXPECTED_OUTPUT:1010100110000001111010011100110101001111111010111001100000110100
       
    57 END_TEST_DATA
       
    58 
       
    59 ENCRYPT_TEST_DATA_7
       
    60 // To test setkey() and encrypt() function. Key value is unchanged
       
    61 KEY            :0101101001111010101010100101110001111101101010100111011111101010
       
    62 DATA_BLOCK     :0000000000000000000000000000000000000000000000000000000000000000
       
    63 // A value of 0 indicates encryption
       
    64 ED_FLAG        :0
       
    65 EXPECTED_OUTPUT:1111111101110111111110100101100000110110100100001110000110111111
       
    66 END_TEST_DATA
       
    67 
       
    68 ENCRYPT_TEST_DATA_8
       
    69 // To test setkey() and encrypt() function. Key value is unchanged
       
    70 KEY            :0101101001111010101010100101110001111101101010100111011111101010
       
    71 DATA_BLOCK     :1111111111111111111111111111111111111111111111111111111111111111
       
    72 // A value of 0 indicates encryption
       
    73 ED_FLAG        :0
       
    74 EXPECTED_OUTPUT:   1111110011010110011011000110100010111111001110111000011111101100
       
    75 END_TEST_DATA
       
    76 
       
    77 ENCRYPT_TEST_DATA_9
       
    78 // To test setkey() and encrypt() function. ED_FLAG changed to denote a decrypt action.
       
    79 KEY            :0101101001111010101010100101110001111101101010100111011111101010
       
    80 DATA_BLOCK     :1111110011010110011011000110100010111111001110111000011111101100
       
    81 // A value of 0 indicates encryption
       
    82 ED_FLAG        :1
       
    83 EXPECTED_OUTPUT:   11111111111111111111111111111111111111111111111111111111111111111
       
    84 END_TEST_DATA
       
    85 
       
    86 CRYPT_TEST_DATA_1
       
    87 // To test crypt() function - DES algorithm. Password-eight characters in length
       
    88 PASSWORD       :password
       
    89 SALT           :XY
       
    90 EXPECTED_OUTPUT:XYGpusIMIT/IM
       
    91 END_TEST_DATA
       
    92 
       
    93 CRYPT_TEST_DATA_2
       
    94 // To test crypt() function - DES algorithm. Password-less than eight characters 
       
    95 // in length
       
    96 PASSWORD       :passS
       
    97 SALT           :XY
       
    98 EXPECTED_OUTPUT:XYGFf3I4Sg2K2
       
    99 END_TEST_DATA
       
   100 
       
   101 CRYPT_TEST_DATA_3
       
   102 // To test crypt() function - DES algorithm. Password-less than eight characters 
       
   103 // in length
       
   104 PASSWORD       :pa
       
   105 SALT           :9D
       
   106 EXPECTED_OUTPUT:9DWVv8b/n8C2M
       
   107 END_TEST_DATA
       
   108 
       
   109 CRYPT_TEST_DATA_4
       
   110 // To test crypt() function - DES algorithm. Password-more than eight characters 
       
   111 // in length
       
   112 PASSWORD       :passwordXYTEY
       
   113 SALT           :.Q
       
   114 EXPECTED_OUTPUT:.Q7kADsEJ1WMI
       
   115 END_TEST_DATA
       
   116 
       
   117 CRYPT_TEST_DATA_5
       
   118 // To test crypt() function - DES algorithm. Password-more than eight characters 
       
   119 // in length - notice that the output depends on the first eight characters of
       
   120 // the passowrd and "salt".
       
   121 PASSWORD       :passwordXY367USH
       
   122 SALT           :.Q
       
   123 EXPECTED_OUTPUT:.Q7kADsEJ1WMI
       
   124 END_TEST_DATA
       
   125 
       
   126 CRYPT_TEST_DATA_6
       
   127 // To test crypt() function - DES algorithm. NULL as password with a valid "salt"
       
   128 PASSWORD       :
       
   129 SALT           :.Q
       
   130 EXPECTED_OUTPUT:.QJ.W2gUJgXaI
       
   131 END_TEST_DATA
       
   132 
       
   133 CRYPT_TEST_DATA_7
       
   134 // To test crypt() function - DES algorithm. NULL as password with a valid "salt"
       
   135 PASSWORD       :
       
   136 SALT           :YU
       
   137 EXPECTED_OUTPUT:YU6VVzA5TJabA
       
   138 END_TEST_DATA
       
   139 
       
   140 CRYPT_TEST_DATA_8
       
   141 // To test crypt() function - DES algorithm. NULL as password with a valid "salt"
       
   142 PASSWORD       :
       
   143 SALT           :/.
       
   144 EXPECTED_OUTPUT:/.elhbtlysKy6
       
   145 END_TEST_DATA
       
   146 
       
   147 CRYPT_TEST_DATA_9
       
   148 // To test crypt() function - DES algorithm. NULL as password with a valid "salt"
       
   149 PASSWORD       :
       
   150 SALT           ://
       
   151 EXPECTED_OUTPUT://plGAV7Hp3Zo
       
   152 END_TEST_DATA
       
   153 
       
   154 CRYPT_TEST_DATA_10
       
   155 // To test crypt() function - DES algorithm. NULL as password with a valid "salt"
       
   156 PASSWORD       :
       
   157 SALT           :aB
       
   158 EXPECTED_OUTPUT:aBtwyC/9wKybE
       
   159 END_TEST_DATA
       
   160 
       
   161 CRYPT_TEST_DATA_11
       
   162 // To test crypt() function - DES algorithm. Valid password with a "salt" which
       
   163 // is one-character in length. Output differs from that of Linux's
       
   164 PASSWORD       :OuEIW90I
       
   165 SALT           :a
       
   166 EXPECTED_OUTPUT:
       
   167 END_TEST_DATA
       
   168 
       
   169 CRYPT_TEST_DATA_12
       
   170 // To test crypt() function - DES algorithm. Valid password with a "salt" which
       
   171 // is longer two characters in length
       
   172 PASSWORD       :OuEIW90I
       
   173 SALT           :iKOI0
       
   174 EXPECTED_OUTPUT:iKr4GcNvuB/Wk
       
   175 END_TEST_DATA
       
   176 
       
   177 CRYPT_TEST_DATA_13
       
   178 // To test crypt() function - DES algorithm. A valid password and no "salt"
       
   179 // Output differs from that of Linux's
       
   180 PASSWORD       :uShyU7w9
       
   181 SALT           :
       
   182 EXPECTED_OUTPUT:
       
   183 END_TEST_DATA
       
   184 
       
   185 CRYPT_TEST_DATA_14
       
   186 // To test crypt() function. Both password and salt being
       
   187 // NULL. Output differs from that of Linux's
       
   188 PASSWORD       :
       
   189 SALT           :
       
   190 EXPECTED_OUTPUT:
       
   191 END_TEST_DATA
       
   192 
       
   193 CRYPT_TEST_DATA_15
       
   194 // To test crypt() function - MD5 algorithm. Both password and salt
       
   195 // are valid
       
   196 PASSWORD       :password
       
   197 SALT           :$1$
       
   198 EXPECTED_OUTPUT:$1$$I2o9Z7NcvQAKp7wyCTlia0
       
   199 END_TEST_DATA
       
   200 
       
   201 CRYPT_TEST_DATA_16
       
   202 // To test crypt() function - MD5 algorithm. Both password and salt
       
   203 // are valid with password being more than 8 characters in length
       
   204 PASSWORD       :passwordUEI091H
       
   205 SALT           :$1$
       
   206 EXPECTED_OUTPUT:$1$$V1X9nybzyUbSXdm8CAqve.
       
   207 END_TEST_DATA
       
   208 
       
   209 CRYPT_TEST_DATA_018
       
   210 // To test crypt() function - MD5 algorithm. Both password and salt
       
   211 // are valid with password being more than 8 characters in length, and
       
   212 // '/' embedded within the string. Salt consists of "$1$" followed
       
   213 // by eight characters, and terminated by "$"
       
   214 PASSWORD       :pass//rdI09Y.
       
   215 SALT           :$1$password$
       
   216 EXPECTED_OUTPUT:$1$password$PnpYLDVZ8stpwScDiSk170
       
   217 END_TEST_DATA
       
   218 
       
   219 CRYPT_TEST_DATA_17
       
   220 // To test crypt() function - MD5 algorithm. Both password and salt
       
   221 // are valid with password being more than 8 characters in length, and
       
   222 // '/' embedded within the string. Salt consists of "$1$" followed
       
   223 // by eight characters, and NOT terminated by "$"
       
   224 PASSWORD       :pass//rdI09Y.
       
   225 SALT           :$1$password
       
   226 EXPECTED_OUTPUT:$1$password$PnpYLDVZ8stpwScDiSk170
       
   227 END_TEST_DATA
       
   228 
       
   229 CRYPT_TEST_DATA_18
       
   230 // To test crypt() function - MD5 algorithm. Both password and salt
       
   231 // are valid with password being more than 8 characters in length, and
       
   232 // '/' embedded within the string. Salt consists of just "$1$"
       
   233 PASSWORD       :pass//rdI09Y.
       
   234 SALT           :$1$
       
   235 EXPECTED_OUTPUT:$1$$Q.yyUXhIuZxEiqLaLs9Yt/
       
   236 END_TEST_DATA
       
   237 
       
   238 CRYPT_TEST_DATA_19
       
   239 // To test crypt() function - MD5 algorithm. Both password and salt
       
   240 // are valid with the length of the password being less than 8.
       
   241 // Salt consists of just "$1$"
       
   242 PASSWORD       ://URi
       
   243 SALT           :$1$
       
   244 EXPECTED_OUTPUT:$1$$dNOmQGH620K312nN0mn1H/
       
   245 END_TEST_DATA
       
   246 
       
   247 CRYPT_TEST_DATA_20
       
   248 // To test crypt() function - MD5 algorithm. Both password and salt
       
   249 // are valid with the length of the password being less than 8.
       
   250 // Salt consists of "$1$" followed by a string, and terminated by
       
   251 // "$"
       
   252 PASSWORD       ://URi
       
   253 SALT           :$1$paU7$
       
   254 EXPECTED_OUTPUT:$1$paU7$L1IzpLbp2c1NZn1fI5ZF3/
       
   255 END_TEST_DATA
       
   256 
       
   257 CRYPT_TEST_DATA_21
       
   258 // To test crypt() function - MD5 algorithm. Both password and salt
       
   259 // are valid with the length of the password being less than 8.
       
   260 // Salt consists of "$1$" followed by a string, and NOT terminated by
       
   261 // "$"
       
   262 PASSWORD       ://URi
       
   263 SALT           :$1$paU7
       
   264 EXPECTED_OUTPUT:$1$paU7$L1IzpLbp2c1NZn1fI5ZF3/
       
   265 END_TEST_DATA
       
   266 
       
   267 CRYPT_TEST_DATA_22
       
   268 // To test crypt() function - MD5 algorithm. Both password and salt
       
   269 // are valid with the length of the password being less than 8.
       
   270 // Salt consists of just "$1$"
       
   271 PASSWORD       ://URi
       
   272 SALT           :$1$
       
   273 EXPECTED_OUTPUT:$1$$dNOmQGH620K312nN0mn1H/
       
   274 END_TEST_DATA
       
   275 
       
   276 CRYPT_TEST_DATA_23
       
   277 // To test crypt() function - MD5 algorithm. NULL as password and "$1$"
       
   278 // as salt
       
   279 PASSWORD       :
       
   280 SALT           :$1$
       
   281 EXPECTED_OUTPUT:$1$$qRPK7m23GJusamGpoGLby/
       
   282 END_TEST_DATA
       
   283 
       
   284 CRYPT_TEST_DATA_24
       
   285 // To test crypt() function - MD5 algorithm. NULL as password. Salt consists
       
   286 // of "$1$" followed by a string, and terminated by "$"
       
   287 PASSWORD       :
       
   288 SALT           :$1$oI./$
       
   289 EXPECTED_OUTPUT:$1$oI./$rZsQHWhxaiZQFk7TPVtZv0
       
   290 END_TEST_DATA
       
   291 
       
   292 CRYPT_TEST_DATA_25
       
   293 // To test crypt() function - MD5 algorithm. NULL as password. Salt consists
       
   294 // of "$1$" followed by a string with a "$" embedded within the string, and 
       
   295 // NOT terminated by "$"
       
   296 PASSWORD       :
       
   297 SALT           :$1$o$./
       
   298 EXPECTED_OUTPUT:$1$o$q44o3M/kTKnXAewu70WtZ/
       
   299 END_TEST_DATA
       
   300 
       
   301 CRYPT_TEST_DATA_26
       
   302 // To test crypt() function - MD5 algorithm. NULL as password. Salt consists
       
   303 // of "$1$" followed by a string, and NOT terminated by "$"
       
   304 PASSWORD       :
       
   305 SALT           :$1$oi8URVn
       
   306 EXPECTED_OUTPUT:$1$oi8URVn$f8o6zSdfLb/OggBchx70f0
       
   307 END_TEST_DATA
       
   308