Browse Source

Move current project to v0.2 inprep for converting to C

master
Jacob Still 1 year ago
parent
commit
4036bba39e
Signed by: jcstill GPG Key ID: 9FA6C3681688446C
  1. 1
      .gitignore
  2. 42
      testing/v0.1/Makefile
  3. 27
      testing/v0.1/README.md
  4. 41
      testing/v0.2/Makefile
  5. 29
      testing/v0.2/README.md
  6. 3
      testing/v0.2/coordinate.h
  7. 0
      testing/v0.2/main.cpp

1
.gitignore

@ -38,3 +38,4 @@
.vscode
ccint.cpp
dbpbe.com
!Makefile

42
testing/v0.1/Makefile

@ -0,0 +1,42 @@
# Compiler Specific:
COMP=g++
CFLAG=-c
WFLAG=-Wall
OFLAG=-o
testnum=0
# Program Specific:
SOURCES= main.cpp \
coordinate.cpp
OBJECTS=$(SOURCES:.cpp=.o)
HEADERS=$(SOURCES:.cpp=.h)
EXECUTABLE=DBPBE
# Start of Make:
Start: clean $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(COMP) $(OBJECTS) $(OFLAG) $@ $(WFLAG)
.cpp.o:
$(COMP) -D mode=$(testnum) $(CFLAG) $< $(OFLAG) $@ $(WFLAG)
# Cleanup Routines:
clean:
rm -f $(OBJECTS) $(EXECUTABLE)
clean-o:
rm -f $(OBJECTS)
clean-b:
rm -f $(EXECUTABLE)
clean-tar:
rm -f $(EXECUTABLE).tar
show-tar:
tar -tvf $(EXECUTABLE).tar
tar:
tar -cf $(EXECUTABLE).tar *.cpp *.h

27
testing/v0.1/README.md

@ -0,0 +1,27 @@
# DBPBE
DBPBE (Distance Between Points Based Encryption)
This project is a proof of concept as of now
## Compiling
there are a bunch of testing things that i have built into the main cpp file:
- mode 01 = testing for datatype casting
- mode 02 = testing for datatype casting 2.0
- mode 03 = testing for conversions
- mode 04 = testing string inputs
- mode 05 = testing string inputs into list
- mode 06 = testing string inputs into list with massive data sets
- mode 07 = testing key generation based on rand
- mode 08 = testing key generation based on rand
- mode 09 = testing converting char to distances
- mode 10 = testing converting string to distances
- mode 11 = testing converting to and from distances (buggy)
to compile:
```shell
$ make testnum=<MODENUMBER>
```

41
testing/v0.2/Makefile

@ -0,0 +1,41 @@
# Compiler Specific:
COMP=g++
CFLAG=-c
WFLAG=-Wall
OFLAG=-o
testnum=0
# Program Specific:
SOURCES= main.cpp
OBJECTS=$(SOURCES:.cpp=.o)
HEADERS=$(SOURCES:.cpp=.h)
EXECUTABLE=DBPBE
# Start of Make:
Start: clean $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(COMP) $(OBJECTS) $(OFLAG) $@ $(WFLAG)
.cpp.o:
$(COMP) -D mode=$(testnum) $(CFLAG) $< $(OFLAG) $@ $(WFLAG)
# Cleanup Routines:
clean:
rm -f $(OBJECTS) $(EXECUTABLE)
clean-o:
rm -f $(OBJECTS)
clean-b:
rm -f $(EXECUTABLE)
clean-tar:
rm -f $(EXECUTABLE).tar
show-tar:
tar -tvf $(EXECUTABLE).tar
tar:
tar -cf $(EXECUTABLE).tar *.cpp *.h

29
testing/v0.2/README.md

@ -0,0 +1,29 @@
# DBPBE
DBPBE (Distance Between Points Based Encryption)
This project is a proof of concept as of now
See the documentation [here](https://dbpbe.com)
## Compiling
there are a bunch of testing things that i have built into the main cpp file:
- mode 01 = testing for datatype casting
- mode 02 = testing for datatype casting 2.0
- mode 03 = testing for conversions
- mode 04 = testing for conversions 2.0
- mode 05 = testing string inputs
- mode 06 = testing string inputs into list
- mode 07 = testing key generation based on passphrase
- mode 08 = testing key generation based on rand
- mode 09 = testing converting char to distances
- mode 10 = testing converting string to distances
- mode 11 = testing converting to and from distances with chars
- mode 12 = testing converting to and from distances with strings
to compile:
```shell
$ make testnum=<MODENUMBER>
```

3
coordinate.h → testing/v0.2/coordinate.h

@ -193,6 +193,7 @@ void coordinate::genkeypoint(){
* *
* NOTE: *
* Need to call srand(time(NULL)) once at beginning of program *
* !TODO: Add Hash functionality to this as well??? *
* *
* !TODO: Issue #6 *
* fix datatypes completely *
@ -316,7 +317,7 @@ void coordinate::genkeypoint(const char input[], int size){
convert += (unsigned int)((uint8_t)(hash[i]));
convert %= 255;
}
// !IMMEDIATE: Issue #(not reported)
// !IMMEDIATE: Issue #9
// need to fix this as it is the same code as an edge case where a distance is 0 can occur
x = (long long)(((unsigned int)(convert) * (unsigned int)(16785407)) * 5) % 4294967295;
bool positivex = (bool)(((unsigned int)(2097593) % (((unsigned int)(convert) % (unsigned int)(43)) + (unsigned int)(1)) * (unsigned int)(convert) * (unsigned int)(16785407)) % 2);

0
main.cpp → testing/v0.2/main.cpp

Loading…
Cancel
Save