]> git.saurik.com Git - apple/xnu.git/blob - EXTERNAL_HEADERS/corecrypto/ccdigest_priv.h
xnu-6153.41.3.tar.gz
[apple/xnu.git] / EXTERNAL_HEADERS / corecrypto / ccdigest_priv.h
1 /*
2 * ccdigest_priv.h
3 * corecrypto
4 *
5 * Created on 12/07/2010
6 *
7 * Copyright (c) 2010,2011,2012,2015 Apple Inc. All rights reserved.
8 *
9 */
10
11 #ifndef _CORECRYPTO_CCDIGEST_PRIV_H_
12 #define _CORECRYPTO_CCDIGEST_PRIV_H_
13
14 #include <corecrypto/cc_priv.h>
15 #include <corecrypto/ccdigest.h>
16 #include <corecrypto/ccasn1.h>
17
18 CC_INLINE CC_NONNULL((1))
19 bool ccdigest_oid_equal(const struct ccdigest_info *di, ccoid_t oid) {
20 if(di->oid == NULL && CCOID(oid) == NULL) return true;
21 if(di->oid == NULL || CCOID(oid) == NULL) return false;
22 return ccoid_equal(di->oid, oid);
23 }
24
25 typedef const struct ccdigest_info *(ccdigest_lookup)(ccoid_t oid);
26
27 #include <stdarg.h>
28 const struct ccdigest_info *ccdigest_oid_lookup(ccoid_t oid, ...);
29
30 #define ccdigest_copy_state(_di_, _dst_, _src_) cc_memcpy_nochk(_dst_, _src_, (_di_)->state_size)
31
32 #endif /* _CORECRYPTO_CCDIGEST_PRIV_H_ */