\r
This function performs Hash digest on a data buffer of the specified size.\r
It can be called multiple times to compute the digest of long or discontinuous data streams.\r
- Hash context should be already correctly intialized by HashInit(), and should not be finalized\r
+ Hash context should be already correctly initialized by HashInit(), and should not be finalized\r
by HashFinal(). Behavior with invalid context is undefined.\r
\r
If HashContext is NULL, then return FALSE.\r
//\r
Instance->HashContext = HashCtx;\r
Instance->HashInfoContext = HashInfo;\r
+ Instance->Updated = FALSE;\r
\r
return EFI_SUCCESS;\r
}\r
return EFI_OUT_OF_RESOURCES;\r
}\r
\r
+ Instance->Updated = TRUE;\r
+\r
return EFI_SUCCESS;\r
}\r
\r
// Consistency Check\r
//\r
Instance = HASH2_INSTANCE_DATA_FROM_THIS(This);\r
- if ((Instance->HashContext == NULL) || (Instance->HashInfoContext == NULL)) {\r
+ if ((Instance->HashContext == NULL) || (Instance->HashInfoContext == NULL) ||\r
+ (!Instance->Updated)) {\r
return EFI_NOT_READY;\r
}\r
HashInfo = Instance->HashInfoContext;\r
FreePool (HashCtx);\r
Instance->HashInfoContext = NULL;\r
Instance->HashContext = NULL;\r
+ Instance->Updated = FALSE;\r
\r
if (!Ret) {\r
return EFI_OUT_OF_RESOURCES;\r