]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_transform/lib/SecMaskGenerationFunctionTransform.h
Security-57740.1.18.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 maskGenerationFunctionType The MGF algorigh to use, currently only kSecMaskGenerationFunctionMGF1
37 @param digestType The type of digest to compute the MGF with. You may pass NULL
38 for this parameter, in which case an appropriate
39 algorithm will be chosen for you (SHA1 for MGF1).
40 @param digestLength The desired digest length. Note that certain
41 algorithms may only support certain sizes. You may
42 pass 0 for this parameter, in which case an
43 appropriate length will be chosen for you.
44 @param maskLength The desired mask length.
45 @param error A pointer to a CFErrorRef. This pointer will be set
46 if an error occurred. This value may be NULL if you
47 do not want an error returned.
48 @result A pointer to a SecTransformRef object. This object must
49 be released with CFRelease when you are done with
50 it. This function will return NULL if an error
51 occurred.
52 @discussion This function creates a transform which computes a
53 fixed length (maskLength) deterministic pseudorandom output.
54 */
55
56
57 SecTransformRef SecCreateMaskGenerationFunctionTransform(CFStringRef hashType, int length, CFErrorRef *error)
58 /* __OSX_AVAILABLE_STARTING(__MAC_10_8,__IPHONE_NA) */;
59
60 #ifdef __cplusplus
61 }
62 #endif
63
64 #endif