7,763
社区成员
发帖
与我相关
我的任务
分享
void sha2_hmac( const unsigned char *key, size_t keylen,
const unsigned char *input, size_t ilen,
unsigned char output[32], int is224 );
public declare Function sha2_hmac Lib ".\sha2.dll"(ByVal key(5) As Byte, ByVal keyLen(5) As Integer, ByVal input(5) as Byte, ByVal intputLen(5), ByVal is224 as Integer)
Public Declare Sub sha2_hmac Lib ".\sha2.dll" (ByVal key As String, ByVal keylen As Long, ByVal inputt As String, ByVal ilen As Long, ByVal output As String, ByVal iss224 As Long)
底下是调用函数
[code=vb]
Dim output(32) As Byte
Dim s1 As String, s2 As String
Dim L1 As Long, L2 As Long
sha2_hmac( s1,l1,s2,l2, output, 0)
[/code]
提示syntax error不知道哪里有问题#ifndef TestDll_H_
#define TestDll_H_
#ifdef MYLIBDLL
#define MYLIBDLL extern "C" _declspec(dllimport)
#else
#define MYLIBDLL extern "C" _declspec(dllexport)
#endif
//MYLIBDLL int Add(int plus1, int plus2);
MYLIBDLL void sha2( const unsigned char *input, size_t ilen,
unsigned char output[32], int is224 );
/**
* \brief Output = SHA-256( file contents )
*
* \param path input file name
* \param output SHA-224/256 checksum result
* \param is224 0 = use SHA256, 1 = use SHA224
*
* \return 0 if successful, or POLARSSL_ERR_SHA2_FILE_IO_ERROR
*/
MYLIBDLL int sha2_file( const char *path, unsigned char output[32], int is224 );
MYLIBDLL void sha2_hmac( const unsigned char *key, size_t keylen,const unsigned char *input, size_t ilen,unsigned char output[32], int is224 );
MYLIBDLL int sha2_hmac_file(const unsigned char *key, size_t keylen,const char *path, unsigned char output[32], int is224);
#endif
这是def文件LIBRARY "SHA2DLL"
EXPORTS
sha2_hmac @1
sha2_hmac_file @2
sha2 @3
sha2_file @4
public declare Function sha2_hmac Lib ".\sha2.dll" (ByVal key(0 to 5) As Byte, ByVal keyLen(0 to 5) As Integer, ByVal input(0 TO 5) as Byte, ByVal intputLen(0 to 5), ByVal is224 as Integer) as Variant