1//
2//  testutil.h
3//  CommonCrypto
4//
5//  Created by Richard Murphy on 1/21/14.
6//  Copyright (c) 2014 Apple Inc. All rights reserved.
7//
8
9#include <stdio.h>
10#include <string.h>
11#include "testmore.h"
12#include "testbyteBuffer.h"
13#define COMMON_DIGEST_FOR_RFC_1321
14
15#include <CommonCrypto/CommonDigestSPI.h>
16#include <CommonCrypto/CommonHMAC.h>
17#include <CommonCrypto/CommonKeyDerivation.h>
18
19#ifndef CommonCrypto_testutil_h
20#define CommonCrypto_testutil_h
21
22int expectedEqualsComputed(char *label, byteBuffer expected, byteBuffer computed);
23char *digestName(CCDigestAlgorithm digestSelector);
24
25#define HMAC_UNIMP 99
26CCHmacAlgorithm digestID2HMacID(CCDigestAlgorithm digestSelector);
27CCPseudoRandomAlgorithm digestID2PRF(CCDigestAlgorithm digestSelector);
28
29
30
31static inline byteBuffer mallocDigestByteBuffer(CCDigestAlgorithm alg) {
32    return mallocByteBuffer(CCDigestGetOutputSize(alg));
33}
34
35#endif
36