Skip to content

Commit b9ead7d

Browse files
Moved header files from dedicated include dir back into src/ (nevermind this idea; CMake packs the ed25519.h in shared builds into the nice output include dir just fine on its own).
Modified CHANGELOG accordingly. Copy license.txt into CMake build output dir on package. Added "ORLP_" prefix to ed25519.h header guard macro to prevent potential name clashes.
1 parent 11ccdd0 commit b9ead7d

21 files changed

Lines changed: 50 additions & 49 deletions

CHANGELOG

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
Raphael Beck, the 8th of October, 2020
1+
Raphael Beck, the 9th of October, 2020
22

33
---
44

55
As per the Zlib license used by this project, here are the changes
6-
that I've applied, in order or importance/relevance:
6+
that I've applied, in order of importance/relevance:
77

8-
* Moved header files into dedicated include directory.
98
* Added “ORLP_” prefix to declspec macro (to prevent possible collisions with other libraries making use of the same name).
109
* Added CMakeLists.txt and build.sh for easy packaging and inclusion into other projects.
1110
* Deleted .dll files inside repo.
11+
* Adapted readme.md accordingly.
12+
* Added this CHANGELOG file.

CMakeLists.txt

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,14 @@ if (${ORLP_ED25519_DLL})
2121
add_compile_definitions("ORLP_ED25519_DLL=1")
2222
endif ()
2323

24-
set(ORLP_ED25519_INCLUDE_DIR
25-
${CMAKE_CURRENT_LIST_DIR}/include
26-
)
27-
2824
set(ORLP_ED25519_SRC
29-
${CMAKE_CURRENT_LIST_DIR}/include/orlp-ed25519/precomp_data.h
30-
${CMAKE_CURRENT_LIST_DIR}/include/orlp-ed25519/fixedint.h
31-
${CMAKE_CURRENT_LIST_DIR}/include/orlp-ed25519/ed25519.h
32-
${CMAKE_CURRENT_LIST_DIR}/include/orlp-ed25519/sha512.h
33-
${CMAKE_CURRENT_LIST_DIR}/include/orlp-ed25519/ge.h
34-
${CMAKE_CURRENT_LIST_DIR}/include/orlp-ed25519/fe.h
35-
${CMAKE_CURRENT_LIST_DIR}/include/orlp-ed25519/sc.h
25+
${CMAKE_CURRENT_LIST_DIR}/src/precomp_data.h
26+
${CMAKE_CURRENT_LIST_DIR}/src/fixedint.h
27+
${CMAKE_CURRENT_LIST_DIR}/src/ed25519.h
28+
${CMAKE_CURRENT_LIST_DIR}/src/sha512.h
29+
${CMAKE_CURRENT_LIST_DIR}/src/ge.h
30+
${CMAKE_CURRENT_LIST_DIR}/src/fe.h
31+
${CMAKE_CURRENT_LIST_DIR}/src/sc.h
3632
${CMAKE_CURRENT_LIST_DIR}/src/ge.c
3733
${CMAKE_CURRENT_LIST_DIR}/src/fe.c
3834
${CMAKE_CURRENT_LIST_DIR}/src/sc.c
@@ -72,7 +68,12 @@ if (${ORLP_ED25519_PACKAGE})
7268

7369
add_custom_command(TARGET ${PROJECT_NAME}
7470
POST_BUILD COMMAND ${CMAKE_COMMAND}
75-
-E copy_directory ${CMAKE_CURRENT_LIST_DIR}/include "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/include"
71+
-E copy ${CMAKE_CURRENT_LIST_DIR}/src/ed25519.h "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/include/orlp-ed25519/ed25519.h"
72+
)
73+
74+
add_custom_command(TARGET ${PROJECT_NAME}
75+
POST_BUILD COMMAND ${CMAKE_COMMAND}
76+
-E copy ${CMAKE_CURRENT_LIST_DIR}/license.txt "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/license.txt"
7677
)
7778

7879
string(TOLOWER "${PROJECT_NAME}-${ORLP_ED25519_VERSION_STRING}-${CMAKE_SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}.tar.gz" ${PROJECT_NAME}_OUTPUT_ARCHIVE_FILENAME)
@@ -83,4 +84,4 @@ if (${ORLP_ED25519_PACKAGE})
8384
)
8485
endif ()
8586

86-
target_include_directories(${PROJECT_NAME} PUBLIC ${ORLP_ED25519_INCLUDE_DIR})
87+
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR}/src)

readme.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ Usage
3737

3838
Simply add all .c and .h files in the `src/` folder to your project and include
3939
`ed25519.h` in any file you want to use the API. If you prefer to use a shared
40-
library, only copy `ed25519.h` and define `ED25519_DLL` before importing. A
41-
windows DLL is pre-built.
40+
library, only copy `ed25519.h` and define `ORLP_ED25519_DLL` before importing.
4241

4342
There are no defined types for seeds, private keys, public keys, shared secrets
4443
or signatures. Instead simple `unsigned char` buffers are used with the

src/add_scalar.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#include "../include/orlp-ed25519/ed25519.h"
2-
#include "../include/orlp-ed25519/ge.h"
3-
#include "../include/orlp-ed25519/sc.h"
4-
#include "../include/orlp-ed25519/sha512.h"
1+
#include "ed25519.h"
2+
#include "ge.h"
3+
#include "sc.h"
4+
#include "sha512.h"
55

66

77
/* see http://crypto.stackexchange.com/a/6215/4697 */
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef ED25519_H
2-
#define ED25519_H
1+
#ifndef ORLP_ED25519_H
2+
#define ORLP_ED25519_H
33

44
#include <stddef.h>
55

@@ -35,4 +35,4 @@ void ORLP_ED25519_DECLSPEC ed25519_key_convert_ref10_to_orlp(const unsigned char
3535
}
3636
#endif
3737

38-
#endif
38+
#endif // ORLP_ED25519_H

src/fe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "../include/orlp-ed25519/fixedint.h"
2-
#include "../include/orlp-ed25519/fe.h"
1+
#include "fixedint.h"
2+
#include "fe.h"
33

44

55
/*
File renamed without changes.

src/ge.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "../include/orlp-ed25519/ge.h"
2-
#include "../include/orlp-ed25519/precomp_data.h"
1+
#include "ge.h"
2+
#include "precomp_data.h"
33

44

55
/*
File renamed without changes.

0 commit comments

Comments
 (0)