Ejemplo n.º 1
0
 public static function provideTestVerify()
 {
     $results = array();
     $file = \PasswordLibTest\getTestDataFile('Vectors/pbkdf.custom.test-vectors');
     $nessie = new PasswordLibTest\lib\VectorParser\SSV($file);
     foreach ($nessie->getVectors() as $vector) {
         $results[] = array($vector[0], $vector[1], true);
     }
     return $results;
 }
Ejemplo n.º 2
0
 public static function provideTestVerify()
 {
     $file = \PasswordLibTest\getTestDataFile('Vectors/apr1.test-vectors');
     $nessie = new PasswordLibTest\lib\VectorParser\NESSIE($file);
     $results = array();
     foreach ($nessie->getVectors() as $vector) {
         $results[] = array($vector['P'], $vector['H'], (bool) $vector['Value']);
     }
     $file = \PasswordLibTest\getTestDataFile('Vectors/apr1.custom.test-vectors');
     $nessie = new PasswordLibTest\lib\VectorParser\SSV($file);
     foreach ($nessie->getVectors() as $vector) {
         $results[] = array($vector[0], $vector[1], true);
     }
     return $results;
 }
Ejemplo n.º 3
0
 public static function provideTestDerive()
 {
     $file = \PasswordLibTest\getTestDataFile('Vectors/pbkdf2-draft-josefsson-sha1.test-vectors');
     $nessie = new PasswordLibTest\lib\VectorParser\NESSIE($file);
     $data = array('sha1' => $nessie->getVectors());
     $file = \PasswordLibTest\getTestDataFile('Vectors/pbkdf2-draft-josefsson-sha256.test-vectors');
     $nessie = new PasswordLibTest\lib\VectorParser\NESSIE($file);
     $data['sha256'] = $nessie->getVectors();
     $results = array();
     foreach ($data as $algo => $vectors) {
         foreach ($vectors as $row) {
             $results[] = array(str_replace('\\0', "", $row['P']), str_replace('\\0', "", $row['S']), $row['c'], $row['dkLen'], $algo, strtoupper($row['DK']));
         }
     }
     return $results;
 }