cosmetics
This commit is contained in:
parent
8a1f63b557
commit
ce06064fcf
3 changed files with 20 additions and 15 deletions
20
sha0/sha0.c
20
sha0/sha0.c
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue