|
| 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