ahchencr.c revision 40f53fa8d9c6a4fc38c0014495e7a42b08f52481
/* Copyright (C) RSA Data Security, Inc. created 1993, 1996. This is an
unpublished work protected as such under copyright law. This work
contains proprietary, confidential, and trade secret information of
RSA Data Security, Inc. Use, disclosure or reproduction without the
express written authorization of RSA Data Security, Inc. is
prohibited.
*/
/* Define this so that the type of the 'this' pointer in the
virtual functions will be correct for this derived class.
*/
struct AHChooseEncryptDecrypt;
#define THIS_ENCRYPT_DECRYPT struct AHChooseEncryptDecrypt
#include "global.h"
#include "algae.h"
#include "bsafe2.h"
#include "bkey.h"
#include "balg.h"
#include "balgmeth.h"
#include "ahchencr.h"
#include "amencdec.h"
static int InitEncryptDecryptAlga PROTO_LIST
static AHEncryptDecryptVTable V_TABLE = {
};
/* In C++:
AHChooseEncryptDecrypt::AHChooseEncryptDecrypt
(B_AlgorithmInfoType *infoType, POINTER info)
: algaChoice (InitEncryptDecryptAlga)
{
algaChoice.setAlgorithmInfoType (infoType);
algaChoice.setAlgorithmInfo (info);
}
*/
struct B_AlgorithmInfoType *infoType;
{
/* This constructor is being used to do a new */
== (AHChooseEncryptDecrypt *)NULL_PTR)
return (handler);
}
/* Construct base class */
return (handler);
}
void AHChooseEncryptDestructor (handler)
{
/* There is no desructor to call for the base class. */
}
unsigned int *blockLen;
{
int status;
return (ConvertAlgaeError (status));
return (0);
}
/* In C++:
int AHChooseEncryptDecrypt::encryptInit
(B_Key *key, B_ALGORITHM_CHOOSER chooser, A_SURRENDER_CTX *surrenderContext)
{
return (algaChoice.choose (1, key, chooser, surrenderContext));
}
*/
{
return (AlgaChoiceChoose
}
{
return (AlgaChoiceChoose
}
/* In C++:
int AHChooseEncryptDecrypt::encryptUpdate
(unsigned char *partOut, unsigned int *partOutLen,
unsigned int maxPartOutLen, unsigned char *partIn, unsigned int partInLen,
B_Algorithm *randomAlgorithm, A_SURRENDER_CTX *surrenderContext)
{
int status;
if ((status = (*((A_ENCRYPT_DECRYPT_ALGA *)algaChoice.alga ()) ->Update)
(algaChoice.context (), partOut, partOutLen, maxPartOutLen,
partIn, partInLen, surrenderContext)) != 0)
return (ConvertAlgaeError (status));
return (0);
}
*/
unsigned char *partOut;
unsigned int *partOutLen;
unsigned int maxPartOutLen;
unsigned char *partIn;
unsigned int partInLen;
{
int status;
return (ConvertAlgaeError (status));
return (0);
}
unsigned char *partOut;
unsigned int *partOutLen;
unsigned int maxPartOutLen;
unsigned char *partIn;
unsigned int partInLen;
{
int status;
return (ConvertAlgaeError (status));
return (0);
}
unsigned char *partOut;
unsigned int *partOutLen;
unsigned int maxPartOutLen;
{
int status;
maxPartOutLen, surrenderContext)) != 0)
return (ConvertAlgaeError (status));
return (0);
}
unsigned char *partOut;
unsigned int *partOutLen;
unsigned int maxPartOutLen;
{
int status;
maxPartOutLen, surrenderContext)) != 0)
return (ConvertAlgaeError (status));
return (0);
}
/* In C++:
static int InitEncryptDecryptAlga
(AlgaChoice *algaChoice, POINTER keyInfo, POINTER alga,
A_SURRENDER_CTX *surrenderContext)
{
int status;
unsigned int contextSize;
if ((status = (*((A_ENCRYPT_DECRYPT_ALGA *)alga)->Query)
(&contextSize, keyInfo, algaChoice->algorithmInfo ())) != 0)
return (ConvertAlgaeError (status));
if ((status = algaChoice->makeNewContext (contextSize)) != 0)
return (status);
if ((status = (*((A_ENCRYPT_DECRYPT_ALGA *)alga)->Init)
(algaChoice->context (), keyInfo, algaChoice->algorithmInfo (),
surrenderContext)) != 0)
return (ConvertAlgaeError (status));
return (0);
}
*/
static int InitEncryptDecryptAlga
{
int status;
unsigned int contextSize;
return (ConvertAlgaeError (status));
return (status);
surrenderContext)) != 0)
return (ConvertAlgaeError (status));
return (0);
}