Lines Matching refs:vec
162 $vec = { desc => "", file => "", sha256 => "", sha384 => "", sha512 => "" };
171 $vec->{desc} = $data;
174 $vec->{file} = $data;
176 $vec->{sha256} = $data;
178 $vec->{sha384} = $data;
180 $vec->{sha512} = $data;
204 $vec->{desc} = $data;
206 $vec->{file} = $data;
208 $vec->{sha256} = $data;
210 $vec->{sha384} = $data;
212 $vec->{sha512} = $data;
219 if (!$vec->{desc}) {
223 if (!$vec->{file}) {
227 if (! -f $vec->{file}) {
229 "'$vec->{file}' is not a readable file. Check the FILE filed in " .
232 if (!($vec->{sha256} || $vec->{sha384} || $vec->{sha512})) {
237 if ($vec->{sha256} !~ /^(|[a-f0-9]{64})$/) {
241 if ($vec->{sha384} !~ /^(|[a-f0-9]{96})$/) {
245 if ($vec->{sha512} !~ /^(|[a-f0-9]{128})$/) {
250 if ($hashes & (($vec->{sha256} ? 1 : 0) | ($vec->{sha384} ? 2 : 0) | ($vec->{sha512} ? 4 : 0))) {
251 push(@VECTORS, $vec);
258 foreach $vec (@VECTORS) {
261 print "\t" . join("\n\t", split(/\n/, $vec->{desc})) . "\n";
262 print "VECTOR DATA FILE:\n\t$vec->{file}\n";
266 $prog =~ s/\%/'$vec->{file}'/g;
274 $prog =~ s/\%/'$vec->{file}'/g;
280 $prog =~ s/\%/'$vec->{file}'/g;
286 $prog =~ s/\%/'$vec->{file}'/g;
291 …usage("Unable to generate any hashes for file '$vec->{file}'!\n") if (!$sha256 && !$sha384 && $sha…
300 if ($vec->{sha256} eq $sha256) {
303 print "SHA256 DOES NOT MATCH:\n\tEXPECTED:\n\t\t$vec->{sha256}\n" .
310 if ($vec->{sha384} eq $sha384) {
315 substr($vec->{sha384}, 0, 64) . "\n\t\t" .
316 substr($vec->{sha384}, -32) . "\n\tGOT:\n\t\t" .
323 if ($vec->{sha512} eq $sha512) {
328 substr($vec->{sha512}, 0, 64) . "\n\t\t" .
329 substr($vec->{sha512}, -32) . "\n\tGOT:\n\t\t" .