]>
git.saurik.com Git - apple/security.git/blob - AppleCSP/CryptKitCSP/FEEAsymmetricContext.h
2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
20 * FEEAsymmetricContext.h - CSPContexts for FEE asymmetric encryption
22 * Created March 8 2001 by dmitch.
25 #ifdef CRYPTKIT_CSP_ENABLE
27 #ifndef _FEE_ASYMMETRIC_CONTEXT_H_
28 #define _FEE_ASYMMETRIC_CONTEXT_H_
30 #include <Security/CSPsession.h>
32 #include "AppleCSPContext.h"
33 #include "AppleCSPSession.h"
34 #include "BlockCryptor.h"
35 #include <CryptKit/feeFEED.h>
36 #include <CryptKit/feeFEEDExp.h>
40 class FEEDContext
: public BlockCryptor
{
42 FEEDContext(AppleCSPSession
&session
) :
43 BlockCryptor(session
),
50 /* called by CSPFullPluginSession */
51 void init(const Context
&context
, bool encoding
= true);
53 /* called by BlockCryptor */
55 const void *plainText
, // length implied (one block)
58 size_t &cipherTextLen
, // in/out, throws on overflow
61 const void *cipherText
, // length implied (one cipher block)
63 size_t &plainTextLen
, // in/out, throws on overflow
67 * Additional query size support, necessary because we don't conform to
68 * BlockCryptor's standard one-to-one block scheme
71 size_t outSize
); // input for given output size
74 size_t inSize
= 0); // output for given input size
77 size_t &out
); // minimum progress chunks
86 bool mInitFlag
; // allows easy reuse
90 class FEEDExpContext
: public BlockCryptor
{
92 FEEDExpContext(AppleCSPSession
&session
) :
93 BlockCryptor(session
),
100 /* called by CSPFullPluginSession */
101 void init(const Context
&context
, bool encoding
= true);
103 /* called by BlockCryptor */
105 const void *plainText
, // length implied (one block)
108 size_t &cipherTextLen
, // in/out, throws on overflow
111 const void *cipherText
, // length implied (one cipher block)
113 size_t &plainTextLen
, // in/out, throws on overflow
117 feeFEEDExp mFeeFeedExp
;
120 bool mInitFlag
; // allows easy reuse
121 }; /* FEEDExpContext */
123 } /* namespace CryptKit */
125 #endif /* _FEE_ASYMMETRIC_CONTEXT_H_ */
126 #endif /* CRYPTKIT_CSP_ENABLE */