cosmetics

This commit is contained in:
sagar 2025-07-14 14:18:44 +00:00
parent 8a1f63b557
commit ce06064fcf
3 changed files with 20 additions and 15 deletions

View file

@ -1,4 +1,10 @@
// Copied from softether's Encrypt.c
// Copied from softether's src/Cedar/Encrypt.c
// define custom types as defined in SoftEther's code
#include "types.h"
// rest is copied as is
/////////////////////////
// SHA0 implementation //
/////////////////////////
@ -34,13 +40,8 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdlib.h>
#include <string.h>
typedef unsigned long long UINT64;
typedef unsigned char UCHAR;
typedef unsigned int UINT;
#define rol(bits, value) (((value) << (bits)) | ((value) >> (32 - (bits))))
typedef struct MY_SHA0_CTX {
@ -144,9 +145,4 @@ const UCHAR* MY_SHA0_hash(const void* data, int len, UCHAR* digest) {
MY_SHA0_update(&ctx, data, len);
memcpy(digest, MY_SHA0_final(&ctx), MY_SHA0_DIGEST_SIZE);
return digest;
}
void Internal_Sha0(unsigned char *dest, const unsigned char *src, const UINT size)
{
MY_SHA0_hash(src, (int)size, dest);
}
}