Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build with Windows VisualStudio 2010. #64

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@
*.exe
*.out
*.app
*.sdf
8 changes: 7 additions & 1 deletion Chacha20/chacha20_simple.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ This implementation is intended to be simple, many optimizations can be performe
#include <string.h>
#include "chacha20_simple.h"

#ifdef _WIN32
#define INLINE
#else
#define INLINE inline
#endif

void chacha20_setup(chacha20_ctx *ctx, const uint8_t *key, size_t length, uint8_t nonce[8])
{
const char *constants = (length == 32) ? "expand 32-byte k" : "expand 16-byte k";
Expand Down Expand Up @@ -123,7 +129,7 @@ void chacha20_encrypt(chacha20_ctx *ctx, const uint8_t *in, uint8_t *out, size_t
}
}

void chacha20_decrypt(chacha20_ctx *ctx, const uint8_t *in, uint8_t *out, size_t length)
void INLINE chacha20_decrypt(chacha20_ctx *ctx, const uint8_t *in, uint8_t *out, size_t length)
{
chacha20_encrypt(ctx, in, out, length);
}
10 changes: 10 additions & 0 deletions Configuration.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
#define _manufactuerName "ET Chan" //Manufactuer
#define devicePassword "523-12-643" //Password
#define deviceUUID "62F47751-8F26-46BF-9552-8F4238E67D60" //UUID, for pair verify
#ifdef _WIN32
#define controllerRecordsAddress "PHK_controller" //Where to store the client keys
#else
#define controllerRecordsAddress "/var/PHK_controller" //Where to store the client keys
#endif

//Number of client
/*
Expand All @@ -38,6 +42,12 @@

#include <openssl/sha.h>
#include <stdint.h>

#ifdef WIN32
#include <process.h>
#include <io.h>
#else
#endif
#include <unistd.h>

typedef SHA512_CTX SHACTX;
Expand Down
Loading