#pragma once #include #include #ifndef HEADER_OBJECT_GUID_LEN #define HEADER_OBJECT_GUID_LEN 16 #endif #ifndef SM4ENC_BLOCK_SIZE #define SM4ENC_BLOCK_SIZE 16 #endif int get_srcfile_name(char* pname, uint32_t ulen, const char* pfilename); int get_srcfile_format(char* pformat, uint32_t ulen, const char* pfilename); int get_srcfile_hash(char* phash, uint32_t ulen, const char* pfilename); uint32_t get_srcfile_size(const char* pfilename); int get_encrytion_filename(char* strbuffer, uint32_t ulen, bool bencname, const char* strprefix, uint32_t uprefixlen, const char* pfilename); int get_decrytion_filename(char* strbuffer, uint32_t ulen, const char* strprefix, uint32_t uprefixlen, const char* pfilename); int SM4EncECBMode(unsigned char key[16], unsigned char *input, int length, unsigned char *output, int *output_len); int SM4DecECBMode(unsigned char key[16], unsigned char *input, int length, unsigned char *output, int *output_len); int GenerateSM4Key(unsigned char* pkey, uint32_t ukeysize, unsigned char* phash, uint32_t uhashlen, uint32_t ufilesize); int get_file_json_infos_from_rvc_header(char** pstrjson, uint32_t* ujsonlen, char* pheader, uint32_t udatalen); int get_file_json_infos_from_file(char** pstrjson, uint32_t* ujsonlen, const char* pfilename, FILE* pFile); int get_file_hashstring(char* pbuffer, uint32_t ubuflen, const char* pfilename);