]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_transform/lib/SecMaskGenerationFunctionTransform.h
Security-58286.200.222.tar.gz
[apple/security.git] / OSX / libsecurity_transform / lib / SecMaskGenerationFunctionTransform.h
1 /*
2 * Copyright (c) 2011 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 libsecurity_transform_SecMaskGenerationFunctionTransform_h
25 #define libsecurity_transform_SecMaskGenerationFunctionTransform_h
26
27 #include "SecTransform.h"
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /*!
34 @function SecMaskGenerationFunctionTransformCreate
35 @abstract Creates a MGF computation object.
36 @param hashType The type of digest to compute the MGF with. You may pass NULL
37 for this parameter, in which case an appropriate
38 algorithm will be chosen for you (SHA1 for MGF1).
39 @param length The desired digest length. Note that certain
40 algorithms may only support certain sizes. You may
41 pass 0 for this parameter, in which case an
42 appropriate length will be chosen for you.
43 @param error A pointer to a CFErrorRef. This pointer will be set
44 if an error occurred. This value may be NULL if you
45 do not want an error returned.
46 @result A pointer to a SecTransformRef object. This object must
47 be released with CFRelease when you are done with
48 it. This function will return NULL if an error
49 occurred.
50 @discussion This function creates a transform which computes a
51 fixed length (maskLength) deterministic pseudorandom output.
52 */
53
54
55 SecTransformRef SecCreateMaskGenerationFunctionTransform(CFStringRef hashType, int length, CFErrorRef *error)
56 /* __OSX_AVAILABLE_STARTING(__MAC_10_8,__IPHONE_NA) */;
57
58 #ifdef __cplusplus
59 }
60 #endif
61
62 #endif