]>
git.saurik.com Git - apple/security.git/blob - SecurityTests/clxutils/threadTest/digestClient.cpp
4 #include "testParams.h"
5 #include <Security/Security.h>
6 #include <security_cdsa_client/cspclient.h>
11 int digestClientInit(TestParams
*testParams
)
16 using namespace Security
;
17 using namespace CssmClient
;
19 int digestClient(TestParams
*testParams
)
23 for(loopNum
=0; loopNum
<testParams
->numLoops
; loopNum
++) {
24 if(testParams
->verbose
) {
25 printf("secTrustEval loop %d\n", loopNum
);
27 else if(!testParams
->quiet
) {
28 printChar(testParams
->progressChar
);
31 CSP
*csp
= new CSP(gGuidAppleCSP
);
33 Digest
*digest
= new Digest(*csp
, CSSM_ALGID_SHA1
);
34 CssmData
ptext((char *)"test", 4);
35 CssmData
dig(digData
, sizeof(digData
));
36 digest
->digest(ptext
, dig
);
37 if(dig
.Length
!= 20) {
38 printf("***digest length error\n");
45 printf("***CSP/Digest client threw exeption\n");
51 printf("Hit CR to continue: ");