RSA Security Projection Television 5.2.2 Instrukcja Użytkownika Strona 181

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 376
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 180
Chapter 5 Non-Cryptographic Operations 159
Message Digests
Table 5-1 Code Sample: DigestDataSavedState()
int DigestDataSavedState (ITEM *stateInfo, B_INFO_TYPE digestAI,
ITEM *dataToDigest)
{
int status = 0;
B_ALGORITHM_OBJ digestObj = NULL;
ITEM newStateInfo = {NULL, 0}, bsfStateInfo = {NULL, 0};
do {
if ((status = B_CreateAlgorithmObject (&digestObj)) != 0)
break;
if ((status = B_SetAlgorithmState (digestObj, digestAI, stateInfo,
DIGEST_CHOOSER)) != 0)
break;
if ((status = B_DigestUpdate (digestObj, dataToDigest->data,
dataToDigest->len, NULL)) != 0)
break;
if ((status = B_GetAlgorithmState (&bsfStateInfo, digestObj)) != 0)
break;
/* Make a copy of the information pointed to by bsfStateInfo for local
use, since the info pointed to by bsfStateInfo could be changed or
reclaimed by the Crypto-C library during subsequent calls. */
newStateInfo.len = bsfStateInfo.len;
newStateInfo.data = T_malloc (newStateInfo.len);
if (newStateInfo.data == NULL) {
status = RSA_DEMO_E_ALLOC;
break;
}
Przeglądanie stron 180
1 2 ... 176 177 178 179 180 181 182 183 184 185 186 ... 375 376

Komentarze do niniejszej Instrukcji

Brak uwag