Skip to content

Commit e2fb103

Browse files
committed
libc: Add all macOS CommonCrypto headers
Closes #23795.
1 parent abca5bd commit e2fb103

File tree

8 files changed

+1400
-1
lines changed

8 files changed

+1400
-1
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) 2006-2012 Apple, Inc. All Rights Reserved.
3+
*
4+
* @APPLE_LICENSE_HEADER_START@
5+
*
6+
* This file contains Original Code and/or Modifications of Original Code
7+
* as defined in and that are subject to the Apple Public Source License
8+
* Version 2.0 (the 'License'). You may not use this file except in
9+
* compliance with the License. Please obtain a copy of the License at
10+
* http://www.opensource.apple.com/apsl/ and read it before using this
11+
* file.
12+
*
13+
* The Original Code and all software distributed under the License are
14+
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15+
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16+
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17+
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18+
* Please see the License for the specific language governing rights and
19+
* limitations under the License.
20+
*
21+
* @APPLE_LICENSE_HEADER_END@
22+
*/
23+
24+
#ifndef __COMMONCRYPTO_PUBLIC__
25+
#define __COMMONCRYPTO_PUBLIC__
26+
27+
#include <CommonCrypto/CommonCryptor.h>
28+
#include <CommonCrypto/CommonDigest.h>
29+
#include <CommonCrypto/CommonHMAC.h>
30+
#include <CommonCrypto/CommonKeyDerivation.h>
31+
#include <CommonCrypto/CommonSymmetricKeywrap.h>
32+
33+
#endif /* __COMMONCRYPTO_PUBLIC__ */
34+
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
//
2+
// CommonCryptoError.h
3+
// CommonCrypto
4+
//
5+
// Copyright (c) 2014 Platform Security. All rights reserved.
6+
//
7+
8+
#ifndef CommonCrypto_CommonCryptoError_h
9+
#define CommonCrypto_CommonCryptoError_h
10+
11+
/*
12+
* Copyright (c) 2014 Apple Inc. All Rights Reserved.
13+
*
14+
* @APPLE_LICENSE_HEADER_START@
15+
*
16+
* This file contains Original Code and/or Modifications of Original Code
17+
* as defined in and that are subject to the Apple Public Source License
18+
* Version 2.0 (the 'License'). You may not use this file except in
19+
* compliance with the License. Please obtain a copy of the License at
20+
* http://www.opensource.apple.com/apsl/ and read it before using this
21+
* file.
22+
*
23+
* The Original Code and all software distributed under the License are
24+
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
25+
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
26+
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
27+
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
28+
* Please see the License for the specific language governing rights and
29+
* limitations under the License.
30+
*
31+
* @APPLE_LICENSE_HEADER_END@
32+
*/
33+
34+
#include <stdint.h>
35+
36+
#if defined(__cplusplus)
37+
extern "C" {
38+
#endif
39+
40+
/*!
41+
@enum CCCryptorStatus
42+
@abstract Return values from CommonCryptor operations.
43+
44+
@constant kCCSuccess Operation completed normally.
45+
@constant kCCParamError Illegal parameter value.
46+
@constant kCCBufferTooSmall Insufficent buffer provided for specified
47+
operation.
48+
@constant kCCMemoryFailure Memory allocation failure.
49+
@constant kCCAlignmentError Input size was not aligned properly.
50+
@constant kCCDecodeError Input data did not decode or decrypt
51+
properly.
52+
@constant kCCUnimplemented Function not implemented for the current
53+
algorithm.
54+
@constant kCCInvalidKey Key is not valid.
55+
*/
56+
enum {
57+
kCCSuccess = 0,
58+
kCCParamError = -4300,
59+
kCCBufferTooSmall = -4301,
60+
kCCMemoryFailure = -4302,
61+
kCCAlignmentError = -4303,
62+
kCCDecodeError = -4304,
63+
kCCUnimplemented = -4305,
64+
kCCOverflow = -4306,
65+
kCCRNGFailure = -4307,
66+
kCCUnspecifiedError = -4308,
67+
kCCCallSequenceError= -4309,
68+
kCCKeySizeError = -4310,
69+
kCCInvalidKey = -4311,
70+
};
71+
typedef int32_t CCStatus;
72+
typedef int32_t CCCryptorStatus;
73+
74+
#if defined(__cplusplus)
75+
}
76+
#endif
77+
78+
#endif

0 commit comments

Comments
 (0)