RSA Security Projection Television 5.2.2 Manual de usuario Pagina 52

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 376
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 51
Multiple Updates
30 RSA BSAFE Crypto-C Developers Guide
places them into the given buffer, and sets a flag indicating whether the bytes
returned are the last ones in the file or not. Assume also that the subroutine
AppendDataToFile
appends output data to a file. Finally, assume we have already
called
B_CreateAlgorithmObject, B_SetAlgorithmInfo, and B_EncryptInit:
#define UPDATE_SIZE 64
#define UPDATE_OUTPUT_SIZE (UPDATE_SIZE + 16)
FILE *inputFile = (FILE *)NULL_PTR;
FILE *outputFile = (FILE *)NULL_PTR;
unsigned char dataToEncrypt[UPDATE_SIZE];
unsigned char blockOfEncryptedData[UPDATE_OUTPUT_SIZE];
unsigned int dataToEncryptLen, totalBytesSoFar;
unsigned int outputLenUpdate, outputLenFinal;
unsigned int sizeToUpdate = UPDATE_SIZE;
int endFlag, status;
do {
totalBytesSoFar = 0;
while ((status = GetDataFromFile
(inputFile, sizeToUpdate, dataToEncrypt,
&dataToEncryptLen, &endFlag)) == 0) {
printf ("dataToEncryptLen = %i \n", dataToEncryptLen);
PrintBuf (dataToEncrypt, dataToEncryptLen);
if ((status = B_EncryptUpdate
(encryptionObject, blockOfEncryptedData,
&outputLenUpdate, UPDATE_OUTPUT_SIZE, dataToEncrypt,
dataToEncryptLen, (B_ALGORITHM_OBJ)NULL_PTR,
(A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;
/* Save the encrypted data. */
if ((status = AppendDataToFile
(outputFile, blockOfEncryptedData,
outputLenUpdate)) != 0)
break;
totalBytesSoFar += outputLenUpdate;
if (endFlag == 1)
break;
} /* end while */
Vista de pagina 51
1 2 ... 47 48 49 50 51 52 53 54 55 56 57 ... 375 376

Comentarios a estos manuales

Sin comentarios