]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_transform/lib/SecMaskGenerationFunctionTransform.h
Security-57740.51.3.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 maskLength The desired mask length.
44 @param error A pointer to a CFErrorRef. This pointer will be set
45 if an error occurred. This value may be NULL if you
46 do not want an error returned.
47 @result A pointer to a SecTransformRef object. This object must
48 be released with CFRelease when you are done with
49 it. This function will return NULL if an error
50 occurred.
51 @discussion This function creates a transform which computes a
52 fixed length (maskLength) deterministic pseudorandom output.
53 */
54
55
56 SecTransformRef SecCreateMaskGenerationFunctionTransform(CFStringRef hashType, int length, CFErrorRef *error)
57 /* __OSX_AVAILABLE_STARTING(__MAC_10_8,__IPHONE_NA) */;
58
59 #ifdef __cplusplus
60 }
61 #endif
62
63 #endif