Skip to content

Commit 0e8fb16

Browse files
authored
Merge branch 'develop' into server_definitions2
2 parents 034198e + b13370a commit 0e8fb16

25 files changed

+5203
-5312
lines changed

.clang-format

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,8 @@ Language: JavaScript
100100
---
101101
Language: Json
102102
IndentWidth: 2
103+
---
104+
Language: Proto
105+
BasedOnStyle: Google
106+
ColumnLimit: 0
107+
IndentWidth: 2

.github/actions/build-test/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ runs:
7575
echo 'Verifying presence of instrumentation.'
7676
./rippled --version | grep libvoidstar
7777
- name: Test the binary
78-
if: ${{ inputs.build_only == 'true' }}
78+
if: ${{ inputs.build_only == 'false' }}
7979
shell: bash
8080
working-directory: ${{ inputs.build_dir }}/${{ inputs.os == 'windows' && inputs.build_type || '' }}
8181
run: |

.github/workflows/build-test.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,19 @@ jobs:
8888
runs-on: ${{ matrix.architecture.runner }}
8989
container: ${{ inputs.os == 'linux' && format('ghcr.io/xrplf/ci/{0}-{1}:{2}-{3}', matrix.os.distro_name, matrix.os.distro_version, matrix.os.compiler_name, matrix.os.compiler_version) || null }}
9090
steps:
91+
- name: Check strategy matrix
92+
run: |
93+
echo 'Operating system distro name: ${{ matrix.os.distro_name }}'
94+
echo 'Operating system distro version: ${{ matrix.os.distro_version }}'
95+
echo 'Operating system compiler name: ${{ matrix.os.compiler_name }}'
96+
echo 'Operating system compiler version: ${{ matrix.os.compiler_version }}'
97+
echo 'Architecture platform: ${{ matrix.architecture.platform }}'
98+
echo 'Architecture runner: ${{ toJson(matrix.architecture.runner) }}'
99+
echo 'Build type: ${{ matrix.build_type }}'
100+
echo 'Build only: ${{ matrix.build_only }}'
101+
echo 'CMake arguments: ${{ matrix.cmake_args }}'
102+
echo 'CMake target: ${{ matrix.cmake_target }}'
103+
echo 'Config name: ${{ matrix.config_name }}'
91104
- name: Clean workspace (MacOS)
92105
if: ${{ inputs.os == 'macos' }}
93106
run: |

cmake/RippledCompiler.cmake

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@ set(CMAKE_CXX_EXTENSIONS OFF)
1616
target_compile_definitions (common
1717
INTERFACE
1818
$<$<CONFIG:Debug>:DEBUG _DEBUG>
19-
$<$<AND:$<BOOL:${profile}>,$<NOT:$<BOOL:${assert}>>>:NDEBUG>)
20-
# ^^^^ NOTE: CMAKE release builds already have NDEBUG
21-
# defined, so no need to add it explicitly except for
22-
# this special case of (profile ON) and (assert OFF)
23-
# -- presumably this is because we don't want profile
24-
# builds asserting unless asserts were specifically
25-
# requested
19+
#[===[
20+
NOTE: CMAKE release builds already have NDEBUG defined, so no need to add it
21+
explicitly except for the special case of (profile ON) and (assert OFF).
22+
Presumably this is because we don't want profile builds asserting unless
23+
asserts were specifically requested.
24+
]===]
25+
$<$<AND:$<BOOL:${profile}>,$<NOT:$<BOOL:${assert}>>>:NDEBUG>
26+
# TODO: Remove once we have migrated functions from OpenSSL 1.x to 3.x.
27+
OPENSSL_SUPPRESS_DEPRECATED
28+
)
2629

2730
if (MSVC)
2831
# remove existing exception flag since we set it to -EHa

conanfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Xrpl(ConanFile):
2727
'grpc/1.50.1',
2828
'libarchive/3.8.1',
2929
'nudb/2.0.9',
30-
'openssl/1.1.1w',
30+
'openssl/3.5.2',
3131
'soci/4.0.3',
3232
'zlib/1.3.1',
3333
]
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
---
22
DisableFormat: true
3-
SortIncludes: false
3+
SortIncludes: Never

external/ed25519-donna/README.md

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
[ed25519](http://ed25519.cr.yp.to/) is an
2-
[Elliptic Curve Digital Signature Algortithm](http://en.wikipedia.org/wiki/Elliptic_Curve_DSA),
3-
developed by [Dan Bernstein](http://cr.yp.to/djb.html),
4-
[Niels Duif](http://www.nielsduif.nl/),
5-
[Tanja Lange](http://hyperelliptic.org/tanja),
6-
[Peter Schwabe](http://www.cryptojedi.org/users/peter/),
1+
[ed25519](http://ed25519.cr.yp.to/) is an
2+
[Elliptic Curve Digital Signature Algortithm](http://en.wikipedia.org/wiki/Elliptic_Curve_DSA),
3+
developed by [Dan Bernstein](http://cr.yp.to/djb.html),
4+
[Niels Duif](http://www.nielsduif.nl/),
5+
[Tanja Lange](http://hyperelliptic.org/tanja),
6+
[Peter Schwabe](http://www.cryptojedi.org/users/peter/),
77
and [Bo-Yin Yang](http://www.iis.sinica.edu.tw/pages/byyang/).
88

9-
This project provides performant, portable 32-bit & 64-bit implementations. All implementations are
9+
This project provides performant, portable 32-bit & 64-bit implementations. All implementations are
1010
of course constant time in regard to secret data.
1111

1212
#### Performance
@@ -52,35 +52,35 @@ are made.
5252

5353
#### Compilation
5454

55-
No configuration is needed **if you are compiling against OpenSSL**.
55+
No configuration is needed **if you are compiling against OpenSSL**.
5656

5757
##### Hash Options
5858

5959
If you are not compiling aginst OpenSSL, you will need a hash function.
6060

61-
To use a simple/**slow** implementation of SHA-512, use `-DED25519_REFHASH` when compiling `ed25519.c`.
61+
To use a simple/**slow** implementation of SHA-512, use `-DED25519_REFHASH` when compiling `ed25519.c`.
6262
This should never be used except to verify the code works when OpenSSL is not available.
6363

64-
To use a custom hash function, use `-DED25519_CUSTOMHASH` when compiling `ed25519.c` and put your
64+
To use a custom hash function, use `-DED25519_CUSTOMHASH` when compiling `ed25519.c` and put your
6565
custom hash implementation in ed25519-hash-custom.h. The hash must have a 512bit digest and implement
6666

67-
struct ed25519_hash_context;
67+
struct ed25519_hash_context;
6868

69-
void ed25519_hash_init(ed25519_hash_context *ctx);
70-
void ed25519_hash_update(ed25519_hash_context *ctx, const uint8_t *in, size_t inlen);
71-
void ed25519_hash_final(ed25519_hash_context *ctx, uint8_t *hash);
72-
void ed25519_hash(uint8_t *hash, const uint8_t *in, size_t inlen);
69+
void ed25519_hash_init(ed25519_hash_context *ctx);
70+
void ed25519_hash_update(ed25519_hash_context *ctx, const uint8_t *in, size_t inlen);
71+
void ed25519_hash_final(ed25519_hash_context *ctx, uint8_t *hash);
72+
void ed25519_hash(uint8_t *hash, const uint8_t *in, size_t inlen);
7373

7474
##### Random Options
7575

7676
If you are not compiling aginst OpenSSL, you will need a random function for batch verification.
7777

78-
To use a custom random function, use `-DED25519_CUSTOMRANDOM` when compiling `ed25519.c` and put your
78+
To use a custom random function, use `-DED25519_CUSTOMRANDOM` when compiling `ed25519.c` and put your
7979
custom hash implementation in ed25519-randombytes-custom.h. The random function must implement:
8080

81-
void ED25519_FN(ed25519_randombytes_unsafe) (void *p, size_t len);
81+
void ED25519_FN(ed25519_randombytes_unsafe) (void *p, size_t len);
8282

83-
Use `-DED25519_TEST` when compiling `ed25519.c` to use a deterministically seeded, non-thread safe CSPRNG
83+
Use `-DED25519_TEST` when compiling `ed25519.c` to use a deterministically seeded, non-thread safe CSPRNG
8484
variant of Bob Jenkins [ISAAC](http://en.wikipedia.org/wiki/ISAAC_%28cipher%29)
8585

8686
##### Minor options
@@ -91,79 +91,80 @@ Use `-DED25519_FORCE_32BIT` to force the use of 32 bit routines even when compil
9191

9292
##### 32-bit
9393

94-
gcc ed25519.c -m32 -O3 -c
94+
gcc ed25519.c -m32 -O3 -c
9595

9696
##### 64-bit
9797

98-
gcc ed25519.c -m64 -O3 -c
98+
gcc ed25519.c -m64 -O3 -c
9999

100100
##### SSE2
101101

102-
gcc ed25519.c -m32 -O3 -c -DED25519_SSE2 -msse2
103-
gcc ed25519.c -m64 -O3 -c -DED25519_SSE2
102+
gcc ed25519.c -m32 -O3 -c -DED25519_SSE2 -msse2
103+
gcc ed25519.c -m64 -O3 -c -DED25519_SSE2
104104

105105
clang and icc are also supported
106106

107+
107108
#### Usage
108109

109110
To use the code, link against `ed25519.o -mbits` and:
110111

111-
#include "ed25519.h"
112+
#include "ed25519.h"
112113

113114
Add `-lssl -lcrypto` when using OpenSSL (Some systems don't need -lcrypto? It might be trial and error).
114115

115116
To generate a private key, simply generate 32 bytes from a secure
116117
cryptographic source:
117118

118-
ed25519_secret_key sk;
119-
randombytes(sk, sizeof(ed25519_secret_key));
119+
ed25519_secret_key sk;
120+
randombytes(sk, sizeof(ed25519_secret_key));
120121

121122
To generate a public key:
122123

123-
ed25519_public_key pk;
124-
ed25519_publickey(sk, pk);
124+
ed25519_public_key pk;
125+
ed25519_publickey(sk, pk);
125126

126127
To sign a message:
127128

128-
ed25519_signature sig;
129-
ed25519_sign(message, message_len, sk, pk, signature);
129+
ed25519_signature sig;
130+
ed25519_sign(message, message_len, sk, pk, signature);
130131

131132
To verify a signature:
132133

133-
int valid = ed25519_sign_open(message, message_len, pk, signature) == 0;
134+
int valid = ed25519_sign_open(message, message_len, pk, signature) == 0;
134135

135136
To batch verify signatures:
136137

137-
const unsigned char *mp[num] = {message1, message2..}
138-
size_t ml[num] = {message_len1, message_len2..}
139-
const unsigned char *pkp[num] = {pk1, pk2..}
140-
const unsigned char *sigp[num] = {signature1, signature2..}
141-
int valid[num]
138+
const unsigned char *mp[num] = {message1, message2..}
139+
size_t ml[num] = {message_len1, message_len2..}
140+
const unsigned char *pkp[num] = {pk1, pk2..}
141+
const unsigned char *sigp[num] = {signature1, signature2..}
142+
int valid[num]
142143

143-
/* valid[i] will be set to 1 if the individual signature was valid, 0 otherwise */
144-
int all_valid = ed25519_sign_open_batch(mp, ml, pkp, sigp, num, valid) == 0;
144+
/* valid[i] will be set to 1 if the individual signature was valid, 0 otherwise */
145+
int all_valid = ed25519_sign_open_batch(mp, ml, pkp, sigp, num, valid) == 0;
145146

146-
**Note**: Batch verification uses `ed25519_randombytes_unsafe`, implemented in
147-
`ed25519-randombytes.h`, to generate random scalars for the verification code.
147+
**Note**: Batch verification uses `ed25519_randombytes_unsafe`, implemented in
148+
`ed25519-randombytes.h`, to generate random scalars for the verification code.
148149
The default implementation now uses OpenSSLs `RAND_bytes`.
149150

150151
Unlike the [SUPERCOP](http://bench.cr.yp.to/supercop.html) version, signatures are
151-
not appended to messages, and there is no need for padding in front of messages.
152-
Additionally, the secret key does not contain a copy of the public key, so it is
152+
not appended to messages, and there is no need for padding in front of messages.
153+
Additionally, the secret key does not contain a copy of the public key, so it is
153154
32 bytes instead of 64 bytes, and the public key must be provided to the signing
154155
function.
155156

156157
##### Curve25519
157158

158-
Curve25519 public keys can be generated thanks to
159-
[Adam Langley](http://www.imperialviolet.org/2013/05/10/fastercurve25519.html)
159+
Curve25519 public keys can be generated thanks to
160+
[Adam Langley](http://www.imperialviolet.org/2013/05/10/fastercurve25519.html)
160161
leveraging Ed25519's precomputed basepoint scalar multiplication.
161162

162-
curved25519_key sk, pk;
163-
randombytes(sk, sizeof(curved25519_key));
164-
curved25519_scalarmult_basepoint(pk, sk);
163+
curved25519_key sk, pk;
164+
randombytes(sk, sizeof(curved25519_key));
165+
curved25519_scalarmult_basepoint(pk, sk);
165166

166-
Note the name is curved25519, a combination of curve and ed25519, to prevent
167+
Note the name is curved25519, a combination of curve and ed25519, to prevent
167168
name clashes. Performance is slightly faster than short message ed25519
168169
signing due to both using the same code for the scalar multiply.
169170

@@ -179,4 +180,4 @@ with extreme values to ensure they function correctly. SSE2 is now supported.
179180

180181
#### Papers
181182

182-
[Available on the Ed25519 website](http://ed25519.cr.yp.to/papers.html)
183+
[Available on the Ed25519 website](http://ed25519.cr.yp.to/papers.html)

0 commit comments

Comments
 (0)