RSA Security 5.2.2 Projection Television User Manual


 
Secret Sharing
310 RSA BSAFE Crypto-C Developers Guide
Step 4: Update
Call B_DecryptUpdate once for each of the shares you are using to reconstruct the
secret. You can use any number of shares from the threshold number to the total
number of shares.
Each call to
B_DecryptUpdate produces no output, so pass NULL_PTRs. The input is a
share. This call does not need a random algorithm, so pass a
NULL_PTR. It is also quick,
so it is reasonable to pass a properly cast
NULL_PTR for the surrender context:
Step 5: Final
Finalize the process with B_DecryptFinal. There will be output now. This function
does not need a random algorithm, so pass a
NULL_PTR there. It is a quick call, so it is
reasonable to pass a
NULL_PTR for the surrender context:
if ((status = B_DecryptInit
(secretReconstructer, (B_KEY_OBJ)NULL_PTR,
(B_ALGORITHM_CHOOSER)NULL_PTR,
(A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;
unsigned int outputLenUpdate;
for (count = 0; count < (int)secretSharingParams.threshold; ++count) {
if ((status = B_DecryptUpdate
(secretReconstructer, NULL_PTR, &outputLenUpdate,
0, secretShare[count], secretShareLen[count],
(B_ALGORITHM_OBJ)NULL_PTR,
(A_SURRENDER_CTX *)NULL_PTR)) != 0)
break;
}
if (status != 0)
break;