Lines Matching +full:op +full:- +full:tee
4 * MDDRIVER.C - test driver for MD2, MD4 and MD5
8 * Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
183 static int digest = -1;
207 opt_end = -1,
241 { "time-trial", no_argument, 0, opt_time_trial },
242 { "self-test", no_argument, 0, opt_self_test },
251 { "ignore-missing", no_argument, 0, opt_ignore_missing },
269 { "ignore-missing", no_argument, 0, opt_ignore_missing },
319 if (strcmp(checksumsfile, "-") == 0) in gnu_check()
330 while (linelen > 0 && linebuf[linelen - 1] == '\n') in gnu_check()
331 linelen--; in gnu_check()
334 hashstr = linebuf + linelen - hashstrlen; in gnu_check()
342 strncmp(filename - 2, " (", 2) == 0 && in gnu_check()
343 strncmp(hashstr - 4, ") = ", 4) == 0 && in gnu_check()
345 *(hashstr - 4) = '\0'; in gnu_check()
370 rec->filename = strdup(filename + 1); in gnu_check()
371 rec->input_mode = (enum input_mode)*filename; in gnu_check()
373 rec->filename = strdup(filename); in gnu_check()
374 rec->input_mode = input_mode; in gnu_check()
377 rec->chksum = strdup(hashstr); in gnu_check()
378 if (rec->chksum == NULL || rec->filename == NULL) in gnu_check()
380 rec->next = NULL; in gnu_check()
382 next = &rec->next; in gnu_check()
392 -sstring - digests string
393 -t - runs time trial
394 -x - runs test script
395 filename - digests file
396 (none) - digests standard input
422 * similar to BSD's -r flag. We install links to this program with in main()
425 * the digest lookup works. Also, make -t a nop when running in this mode in main()
427 * on unix-like systems). The -c flag conflicts, so it's just disabled in main()
432 * but uses a command-line argument to select the algorithm, and in main()
433 * supports only SHA-1 and SHA-2. in main()
443 } else if (len > 3 && strcmp(progname + len - 3, "sum") == 0) { in main()
444 len -= 3; in main()
451 * was -b, which means something else (input_binary) in in main()
498 /* in BSD mode, -b is now a no-op */ in main()
577 argc -= optind; in main()
592 while (argc--) in main()
596 for (rec = head; rec != NULL; rec = rec->next) { in main()
597 argv[argc] = rec->filename; in main()
619 input_mode = rec->input_mode; in main()
620 checkAgainst = rec->chksum; in main()
621 rec = rec->next; in main()
625 if (strcmp(filename, "-") == 0) { in main()
650 MDOutput(&Algorithm[digest], p, "-"); in main()
683 MDInput(const Algorithm_t *alg, FILE *f, char *buf, bool tee) in MDInput() argument
693 alg->Init(&context); in MDInput()
698 if (tee && fwrite(block, 1, len, stdout) != len) in MDInput()
700 alg->Update(&context, block, len); in MDInput()
708 if (tee && putchar('\n') == EOF) in MDInput()
710 alg->Update(&context, "\n", 1); in MDInput()
716 if (tee && in MDInput()
717 fwrite(p, 1, q - p, stdout) != in MDInput()
718 (size_t)(q - p)) in MDInput()
720 alg->Update(&context, p, q - p); in MDInput()
734 byte |= *p - '0'; in MDInput()
736 if (tee && putchar(byte) == EOF) in MDInput()
738 alg->Update(&context, &byte, 1); in MDInput()
747 alg->End(&context, buf); in MDInput()
751 if (tee && putchar('\n') == EOF) in MDInput()
753 alg->Update(&context, "\n", 1); in MDInput()
757 return (alg->End(&context, buf)); in MDInput()
789 strncmp(alg->name, "SHA512t", 7) == 0) { in MDOutput()
790 printf("%.6s/%s", alg->name, alg->name + 7); in MDOutput()
792 printf("%s", alg->name); in MDOutput()
809 * Measures the time to digest TEST_BLOCK_COUNT TEST_BLOCK_LEN-byte blocks.
822 printf("%s time trial. Digesting %d %d-byte blocks ...", in MDTimeTrial()
823 alg->name, TEST_BLOCK_COUNT, TEST_BLOCK_LEN); in MDTimeTrial()
834 alg->Init(&context); in MDTimeTrial()
836 alg->Update(&context, block, TEST_BLOCK_LEN); in MDTimeTrial()
837 p = alg->End(&context, buf); in MDTimeTrial()
862 "MD5 has not yet (2001-09-03) been broken, but sufficient attacks have been made \
1004 printf("%s test suite:\n", alg->name); in MDTestSuite()
1006 (*alg->Data)(MDTestInput[i], strlen(MDTestInput[i]), buffer); in MDTestSuite()
1007 printf("%s (\"%s\") = %s", alg->name, MDTestInput[i], buffer); in MDTestSuite()
1008 if (strcmp(buffer, (*alg->TestOutput)[i]) == 0) { in MDTestSuite()
1009 printf(" - verified correct\n"); in MDTestSuite()
1011 printf(" - INCORRECT RESULT!\n"); in MDTestSuite()
1023 fprintf(stderr, "usage: %ssum [-bctwz] [files ...]\n", alg->progname); in usage()
1026 fprintf(stderr, "usage: shasum [-0bchqstUvw] [-a alg] [files ...]\n"); in usage()
1029 fprintf(stderr, "usage: %s [-pqrtx] [-c string] [-s string] [files ...]\n", in usage()
1030 alg->progname); in usage()