📄 packet.c
字号:
#include "mycrypt.h"#ifdef PACKETvoid packet_store_header(unsigned char *dst, int section, int subsection, unsigned long length){ _ARGCHK(dst != NULL); /* store version number */ dst[0] = CRYPT&255; dst[1] = (CRYPT>>8)&255; /* store section and subsection */ dst[2] = section & 255; dst[3] = subsection & 255; /* store length */ STORE32L(length, &dst[4]);}int packet_valid_header(unsigned char *src, int section, int subsection){ unsigned long ver; _ARGCHK(src != NULL); /* check version */ ver = ((unsigned long)src[0]) | ((unsigned long)src[1] << 8); if (CRYPT < ver) { return CRYPT_INVALID_PACKET; } /* check section and subsection */ if (section != src[2] || subsection != src[3]) { return CRYPT_INVALID_PACKET; } return CRYPT_OK;}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -