Lines Matching defs:alg
683 MDInput(const Algorithm_t *alg, FILE *f, char *buf, bool tee)
693 alg->Init(&context);
700 alg->Update(&context, block, len);
710 alg->Update(&context, "\n", 1);
720 alg->Update(&context, p, q - p);
738 alg->Update(&context, &byte, 1);
747 alg->End(&context, buf);
753 alg->Update(&context, "\n", 1);
757 return (alg->End(&context, buf));
764 MDOutput(const Algorithm_t *alg, char *p, const char *name)
789 strncmp(alg->name, "SHA512t", 7) == 0) {
790 printf("%.6s/%s", alg->name, alg->name + 7);
792 printf("%s", alg->name);
812 MDTimeTrial(const Algorithm_t *alg)
823 alg->name, TEST_BLOCK_COUNT, TEST_BLOCK_LEN);
834 alg->Init(&context);
836 alg->Update(&context, block, TEST_BLOCK_LEN);
837 p = alg->End(&context, buf);
999 MDTestSuite(const Algorithm_t *alg)
1004 printf("%s test suite:\n", alg->name);
1006 (*alg->Data)(MDTestInput[i], strlen(MDTestInput[i]), buffer);
1007 printf("%s (\"%s\") = %s", alg->name, MDTestInput[i], buffer);
1008 if (strcmp(buffer, (*alg->TestOutput)[i]) == 0) {
1018 usage(const Algorithm_t *alg)
1023 fprintf(stderr, "usage: %ssum [-bctwz] [files ...]\n", alg->progname);
1026 fprintf(stderr, "usage: shasum [-0bchqstUvw] [-a alg] [files ...]\n");
1030 alg->progname);