CryptoSys API Library Manual

SHA3_Reset

Resets the context.

VBA/VB6 Syntax

Public Declare Function SHA3_Reset Lib "diCryptoSys.dll" (ByVal hContext As Long) As Long

nRet = SHA3_Reset(hContext)

C/C++ Syntax

long __stdcall SHA3_Reset(long hContext);

Parameters

hContext
[in] handle to the SHA-3 context.

Returns (VBA/C)

If successful, the return value is 0; otherwise it returns a non-zero error code.

.NET Equivalent

Sha3.Reset Method

Remarks

Destroys the existing context. The results of any part-messages added to the context will be lost.

Example

This trivial example creates a context handle for SHA-3-384, gets the output length in bytes (expecting 48), and then destroys it.

Dim nRet As Long
Dim nLen As Long
Dim hContext As Long

hContext = SHA3_Init(384)
Debug.Print "SHA3_Init returns 0x" & Hex(hContext)
Debug.Assert hContext <> 0
nLen = SHA3_LengthInBytes(hContext)
Debug.Print "SHA3_LengthInBytes=" & nLen

' Destroy the context
nRet = SHA3_Reset(hContext)
Debug.Print "SHA3_Reset returns " & nRet

' Now we have an invalid context handle
nLen = SHA3_LengthInBytes(hContext)
Debug.Print "SHA3_LengthInBytes returns " & nLen
Debug.Print apiErrorLookup(nLen)
SHA3_Init returns 0x3485BE53
SHA3_LengthInBytes=48
SHA3_Reset returns 0
SHA3_LengthInBytes returns -64
Invalid context handle (INVALID_HANDLE_ERROR)

See Also

SHA3_Init

[Contents] [Index]

[PREV: SHA3_LengthInBytes...]   [Contents]   [Index]   
   [NEXT: TDEA_B64Mode...]

Copyright © 2001-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-01-07T07:42:00Z.