Change in openvpn[master]: Allow to use OpenSSL's SIPHASH implementation when available
A message that is not in the archive (sent off-list or not yet received): gerrit.1677175662000.I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0@gerrit.openvpn.net
Attention is currently required from: flichtenheld.
Hello flichtenheld,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
to look at the new patch set (#14).
Change subject: Allow to use OpenSSL's SIPHASH implementation when available
......................................................................
Allow to use OpenSSL's SIPHASH implementation when available
OpenSSL library is currently slower than the reference implementation (about 1.5x to 2x depending of the compiler).
The OpenSSL API for using the SIPHASH MAC is different enough from using normal HMAC or Digest that we already implement that combining them into one API does not make sense.
SIPHASH is only available on OpenSSL 3.1 and later. We still check for support on 3.0 and later as the whole API to allow using the SIPHASH alrady exists in OpenSSL 3.0. Some of the later OpenSSL 3.0.x might get support for it. Theoretically, a provider can be loaded in OpenSSL 3.0 that implements SIPHASH.
With OpenSSL's implementation being slower, we currently only use it to check that our reference implementation and the OpenSSL implementation yield the same result in unit tests
---
M CMakeLists.txt
M src/openvpn/Makefile.am
M src/openvpn/siphash.h
A src/openvpn/siphash_openssl.c
M src/openvpn/siphash_reference.c
M tests/unit_tests/openvpn/Makefile.am
M tests/unit_tests/openvpn/test_crypto.c
7 files changed, 270 insertions(+), 11 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/31/31/14
CMakeLists.txt +7 -0
@@ -562,6 +562,9 @@ src/openvpn/shaper.h src/openvpn/sig.c src/openvpn/sig.h + src/openvpn/siphash.h + src/openvpn/siphash_openssl.c + src/openvpn/siphash_reference.c src/openvpn/socket.c src/openvpn/socket.h src/openvpn/socket_util.c
@@ -780,8 +783,12 @@ src/openvpn/packet_id.c src/openvpn/mtu.c src/openvpn/mss.c + src/openvpn/siphash_reference.c + src/openvpn/siphash_openssl.c ) + target_compile_definitions(test_crypto PRIVATE PREFER_OPENSSL_SIPHASH) + target_sources(test_ssl PRIVATE tests/unit_tests/openvpn/mock_management.c tests/unit_tests/openvpn/mock_ssl_dependencies.c
src/openvpn/Makefile.am +2 -0
@@ -128,6 +128,8 @@ session_id.c session_id.h \ shaper.c shaper.h \ sig.c sig.h \ + siphash_reference.c siphash.h \ + siphash_openssl.c \ socket.c socket.h \ socket_util.c socket_util.h \ socks.c socks.h \
src/openvpn/siphash.h +47 -4
60 lines not on this page · raw message
src/openvpn/siphash_openssl.c new file +150 -0
150 lines not on this page · raw message
src/openvpn/siphash_reference.c +2 -2
@@ -100,8 +100,8 @@* outlen: length of the output in bytes, must be 8 or 16 */ int -siphash (const void *in,const size_t inlen,const void *k,uint8_t *out, -const size_t outlen) +siphash_reference (const void *in,const size_t inlen,const void *k, +uint8_t *out,const size_t outlen) {const unsigned char *ni = (const unsigned char *)in;const unsigned char *kk = (const unsigned char *)k;
tests/unit_tests/openvpn/Makefile.am +4 -1
@@ -84,7 +84,9 @@ $(top_srcdir)/src/openvpn/platform.c \ $(top_srcdir)/src/openvpn/mtu.c \ $(top_srcdir)/src/openvpn/win32-util.c \ - $(top_srcdir)/src/openvpn/mss.c + $(top_srcdir)/src/openvpn/mss.c \ + $(top_srcdir)/src/openvpn/siphash_openssl.c \ + $(top_srcdir)/src/openvpn/siphash_reference.c dhcp_testdriver_CFLAGS = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@ -DDHCP_UNIT_TEST dhcp_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
@@ -97,6 +99,7 @@ ssl_testdriver_CFLAGS = \ -I$(top_srcdir)/include -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpn \ + -DPREFER_OPENSSL_SIPHASH \ @TEST_CFLAGS@ ssl_testdriver_LDFLAGS = @TEST_LDFLAGS@ $(OPTIONAL_CRYPTO_LIBS) ssl_testdriver_SOURCES = test_ssl.c \
tests/unit_tests/openvpn/test_crypto.c +58 -4
86 lines not on this page · raw message
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 14
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: flichtenheld.
Hello flichtenheld,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
to look at the new patch set (#17).
Change subject: Allow to use OpenSSL's SIPHASH implementation when available
......................................................................
Allow to use OpenSSL's SIPHASH implementation when available
OpenSSL library is currently slower than the reference implementation (about 1.5x to 2x depending of the compiler).
The OpenSSL API for using the SIPHASH MAC is different enough from using normal HMAC or Digest that we already implement that combining them into one API does not make sense.
SIPHASH is only available on OpenSSL 3.1 and later. We still check for support on 3.0 and later as the whole API to allow using the SIPHASH alrady exists in OpenSSL 3.0. Some of the later OpenSSL 3.0.x might get support for it. Theoretically, a provider can be loaded in OpenSSL 3.0 that implements SIPHASH.
With OpenSSL's implementation being slower, we currently only use it to check that our reference implementation and the OpenSSL implementation yield the same result in unit tests
---
M CMakeLists.txt
M src/openvpn/Makefile.am
M src/openvpn/siphash.h
A src/openvpn/siphash_openssl.c
M src/openvpn/siphash_reference.c
M tests/unit_tests/openvpn/Makefile.am
M tests/unit_tests/openvpn/test_crypto.c
7 files changed, 282 insertions(+), 11 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/31/31/17
CMakeLists.txt +7 -0
@@ -562,6 +562,9 @@ src/openvpn/shaper.h src/openvpn/sig.c src/openvpn/sig.h + src/openvpn/siphash.h + src/openvpn/siphash_openssl.c + src/openvpn/siphash_reference.c src/openvpn/socket.c src/openvpn/socket.h src/openvpn/socket_util.c
@@ -780,8 +783,12 @@ src/openvpn/packet_id.c src/openvpn/mtu.c src/openvpn/mss.c + src/openvpn/siphash_reference.c + src/openvpn/siphash_openssl.c ) + target_compile_definitions(test_crypto PRIVATE PREFER_OPENSSL_SIPHASH) + target_sources(test_ssl PRIVATE tests/unit_tests/openvpn/mock_management.c tests/unit_tests/openvpn/mock_ssl_dependencies.c
src/openvpn/Makefile.am +2 -0
@@ -128,6 +128,8 @@ session_id.c session_id.h \ shaper.c shaper.h \ sig.c sig.h \ + siphash_reference.c siphash.h \ + siphash_openssl.c \ socket.c socket.h \ socket_util.c socket_util.h \ socks.c socks.h \
src/openvpn/siphash.h +59 -4
72 lines not on this page · raw message
src/openvpn/siphash_openssl.c new file +150 -0
150 lines not on this page · raw message
src/openvpn/siphash_reference.c +2 -2
@@ -100,8 +100,8 @@* outlen: length of the output in bytes, must be 8 or 16 */ int -siphash (const void *in,const size_t inlen,const void *k,uint8_t *out, -const size_t outlen) +siphash_reference (const void *in,const size_t inlen,const void *k, +uint8_t *out,const size_t outlen) {const unsigned char *ni = (const unsigned char *)in;const unsigned char *kk = (const unsigned char *)k;
tests/unit_tests/openvpn/Makefile.am +4 -1
@@ -84,7 +84,9 @@ $(top_srcdir)/src/openvpn/platform.c \ $(top_srcdir)/src/openvpn/mtu.c \ $(top_srcdir)/src/openvpn/win32-util.c \ - $(top_srcdir)/src/openvpn/mss.c + $(top_srcdir)/src/openvpn/mss.c \ + $(top_srcdir)/src/openvpn/siphash_openssl.c \ + $(top_srcdir)/src/openvpn/siphash_reference.c dhcp_testdriver_CFLAGS = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@ -DDHCP_UNIT_TEST dhcp_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
@@ -97,6 +99,7 @@ ssl_testdriver_CFLAGS = \ -I$(top_srcdir)/include -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpn \ + -DPREFER_OPENSSL_SIPHASH \ @TEST_CFLAGS@ ssl_testdriver_LDFLAGS = @TEST_LDFLAGS@ $(OPTIONAL_CRYPTO_LIBS) ssl_testdriver_SOURCES = test_ssl.c \
tests/unit_tests/openvpn/test_crypto.c +58 -4
86 lines not on this page · raw message
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 17
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: plaisthos.
flichtenheld has posted comments on this change by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/31?usp=email )
Change subject: Allow to use OpenSSL's SIPHASH implementation when available
......................................................................
Patch Set 17: Code-Review-2
(3 comments)
File src/openvpn/siphash_openssl.c:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/82eb4c8f_745f931e?usp=email :
PS17, Line 27: #include "config-msvc.h"
This shows how old this patch is: config-msvc is gone for years, please remove the reference.
http://gerrit.openvpn.net/c/openvpn/+/31/comment/c865d631_0d7e7379?usp=email :
PS17, Line 32: #include "siphash.h"
these includes could move below the enable check
File tests/unit_tests/openvpn/test_crypto.c:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/507c0a42_1dbfd977?usp=email :
PS17, Line 960: cmocka_unit_test_prestate_setup_teardown(crypto_test_epoch_edge,
Removes this test. Conflict resolution error?
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 17
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
Gerrit-Comment-Date: Fri, 17 Jul 2026 14:56:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: plaisthos.
flichtenheld has posted comments on this change by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/31?usp=email )
Change subject: Allow to use OpenSSL's SIPHASH implementation when available
......................................................................
Patch Set 17:
(1 comment)
File src/openvpn/siphash.h:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/78464d95_63bffb70?usp=email :
PS17, Line 74: if (siphash_cryptolib_available(ctx) && false)
&& false
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 17
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
Gerrit-Comment-Date: Fri, 17 Jul 2026 15:16:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: flichtenheld.
plaisthos has posted comments on this change by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/31?usp=email )
Change subject: Allow to use OpenSSL's SIPHASH implementation when available
......................................................................
Patch Set 17:
(4 comments)
File src/openvpn/siphash.h:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/688ba2b3_578a30d1?usp=email :
PS17, Line 74: if (siphash_cryptolib_available(ctx) && false)
Quoted 1 line
&& false
Acknowledged
File src/openvpn/siphash_openssl.c:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/0d436523_940cec29?usp=email :
PS17, Line 27: #include "config-msvc.h"
Quoted 1 line
This shows how old this patch is: config-msvc is gone for years, please remove the reference.
Done
http://gerrit.openvpn.net/c/openvpn/+/31/comment/c5d23503_7391547a?usp=email :
PS17, Line 32: #include "siphash.h"
Quoted 1 line
these includes could move below the enable check
I trimmed the includes to just siphash.h and added crypto_backend.h in the OpenSSL path.
File tests/unit_tests/openvpn/test_crypto.c:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/d94e0796_6dd8a399?usp=email :
PS17, Line 960: cmocka_unit_test_prestate_setup_teardown(crypto_test_epoch_edge,
Quoted 1 line
Removes this test. […]
Acknowledged
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 17
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]>
Gerrit-Comment-Date: Wed, 22 Jul 2026 10:24:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: flichtenheld <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: flichtenheld.
Hello flichtenheld,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
to look at the new patch set (#18).
Change subject: Allow to use OpenSSL's SIPHASH implementation when available
......................................................................
Allow to use OpenSSL's SIPHASH implementation when available
OpenSSL library is currently slower than the reference implementation (about 1.5x to 2x depending of the compiler).
The OpenSSL API for using the SIPHASH MAC is different enough from using normal HMAC or Digest that we already implement that combining them into one API does not make sense.
SIPHASH is only available on OpenSSL 3.1 and later. We still check for support on 3.0 and later as the whole API to allow using the SIPHASH alrady exists in OpenSSL 3.0. Some of the later OpenSSL 3.0.x might get support for it. Theoretically, a provider can be loaded in OpenSSL 3.0 that implements SIPHASH.
With OpenSSL's implementation being slower, we currently only use it to check that our reference implementation and the OpenSSL implementation yield the same result in unit tests
---
M CMakeLists.txt
M src/openvpn/Makefile.am
M src/openvpn/siphash.h
A src/openvpn/siphash_openssl.c
M src/openvpn/siphash_reference.c
M tests/unit_tests/openvpn/Makefile.am
M tests/unit_tests/openvpn/test_crypto.c
7 files changed, 277 insertions(+), 8 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/31/31/18
CMakeLists.txt +7 -0
@@ -572,6 +572,9 @@ src/openvpn/shaper.h src/openvpn/sig.c src/openvpn/sig.h + src/openvpn/siphash.h + src/openvpn/siphash_openssl.c + src/openvpn/siphash_reference.c src/openvpn/socket.c src/openvpn/socket.h src/openvpn/socket_util.c
@@ -792,8 +795,12 @@ src/openvpn/packet_id.c src/openvpn/mtu.c src/openvpn/mss.c + src/openvpn/siphash_reference.c + src/openvpn/siphash_openssl.c ) + target_compile_definitions(test_crypto PRIVATE PREFER_OPENSSL_SIPHASH) + target_sources(test_ssl PRIVATE tests/unit_tests/openvpn/mock_management.c tests/unit_tests/openvpn/mock_ssl_dependencies.c
src/openvpn/Makefile.am +2 -0
@@ -128,6 +128,8 @@ session_id.c session_id.h \ shaper.c shaper.h \ sig.c sig.h \ + siphash_reference.c siphash.h \ + siphash_openssl.c \ socket.c socket.h \ socket_util.c socket_util.h \ socks.c socks.h \
src/openvpn/siphash.h +59 -4
72 lines not on this page · raw message
src/openvpn/siphash_openssl.c new file +145 -0
145 lines not on this page · raw message
src/openvpn/siphash_reference.c +2 -2
@@ -100,8 +100,8 @@* outlen: length of the output in bytes, must be 8 or 16 */ int -siphash (const void *in,const size_t inlen,const void *k,uint8_t *out, -const size_t outlen) +siphash_reference (const void *in,const size_t inlen,const void *k, +uint8_t *out,const size_t outlen) {const unsigned char *ni = (const unsigned char *)in;const unsigned char *kk = (const unsigned char *)k;
tests/unit_tests/openvpn/Makefile.am +4 -1
@@ -84,7 +84,9 @@ $(top_srcdir)/src/openvpn/platform.c \ $(top_srcdir)/src/openvpn/mtu.c \ $(top_srcdir)/src/openvpn/win32-util.c \ - $(top_srcdir)/src/openvpn/mss.c + $(top_srcdir)/src/openvpn/mss.c \ + $(top_srcdir)/src/openvpn/siphash_openssl.c \ + $(top_srcdir)/src/openvpn/siphash_reference.c dhcp_testdriver_CFLAGS = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@ -DDHCP_UNIT_TEST dhcp_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
@@ -97,6 +99,7 @@ ssl_testdriver_CFLAGS = \ -I$(top_srcdir)/include -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpn \ + -DPREFER_OPENSSL_SIPHASH \ @TEST_CFLAGS@ ssl_testdriver_LDFLAGS = @TEST_LDFLAGS@ $(OPTIONAL_CRYPTO_LIBS) ssl_testdriver_SOURCES = test_ssl.c \
tests/unit_tests/openvpn/test_crypto.c +58 -1
83 lines not on this page · raw message
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 18
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: plaisthos.
flichtenheld has posted comments on this change by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/31?usp=email )
Change subject: Allow to use OpenSSL's SIPHASH implementation when available
......................................................................
Patch Set 20: Code-Review-1
(1 comment)
File tests/unit_tests/openvpn/test_crypto.c:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/53a360eb_afdbef74?usp=email :
PS20, Line 935: const char *message = "Look behind you, a Three-Headed Monkey!";
All this test data is duplicated, could be shared between the two tests
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 20
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
Gerrit-Comment-Date: Fri, 24 Jul 2026 10:47:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: plaisthos.
flichtenheld has posted comments on this change by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/31?usp=email )
Change subject: Allow to use OpenSSL's SIPHASH implementation when available
......................................................................
Patch Set 20:
(1 comment)
File src/openvpn/siphash_openssl.c:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/2c678f38_a0049ba5?usp=email :
PS20, Line 82: ALLOC_OBJ(sip, struct siphash_context);
Strictly speaking this requires buffer.h
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 20
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
Gerrit-Comment-Date: Fri, 24 Jul 2026 10:50:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: flichtenheld.
plaisthos has posted comments on this change by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/31?usp=email )
Change subject: Allow to use OpenSSL's SIPHASH implementation when available
......................................................................
Patch Set 20:
(2 comments)
File src/openvpn/siphash_openssl.c:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/757021fb_e8295323?usp=email :
PS20, Line 82: ALLOC_OBJ(sip, struct siphash_context);
Quoted 1 line
Strictly speaking this requires buffer. […]
Done
File tests/unit_tests/openvpn/test_crypto.c:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/436475ab_bd3ca198?usp=email :
PS20, Line 935: const char *message = "Look behind you, a Three-Headed Monkey!";
Quoted 1 line
All this test data is duplicated, could be shared between the two tests
Done
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 20
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]>
Gerrit-Comment-Date: Fri, 24 Jul 2026 11:01:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: flichtenheld <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Attention is currently required from: plaisthos.
flichtenheld has posted comments on this change by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/31?usp=email )
Change subject: Allow to use OpenSSL's SIPHASH implementation when available
......................................................................
Patch Set 20: Code-Review-2
(1 comment)
Patchset:
PS20:
Let's discuss this carefully. That is lot of code we never intend anyone to use in the forseeable future...
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 20
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
Gerrit-Comment-Date: Fri, 24 Jul 2026 12:42:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
[Openvpn-devel] [L] Change in openvpn[master]: Use OpenSSL's SIPHASH implementation to double check our implementation
In reply to a message not in the archiveAttention is currently required from: plaisthos.
Hello flichtenheld,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
to look at the new patch set (#21).
Change subject: Use OpenSSL's SIPHASH implementation to double check our implementation
......................................................................
Use OpenSSL's SIPHASH implementation to double check our implementation
OpenSSL library is currently slower than the reference implementation (about 1.5x to 2x depending of the compiler).
The OpenSSL API for using the SIPHASH MAC is different enough from using normal HMAC or Digest that we already implement that combining them into one API does not make sense.
SIPHASH is only available on OpenSSL 3.1 and later. We still check for support on 3.0 and later as the whole API to allow using the SIPHASH alrady exists in OpenSSL 3.0. Some of the later OpenSSL 3.0.x might get support for it. Theoretically, a provider can be loaded in OpenSSL 3.0 that implements SIPHASH.
With OpenSSL's implementation being slower, we currently only use it to check that our reference implementation and the OpenSSL implementation yield the same result in unit tests
---
M CMakeLists.txt
M src/openvpn/Makefile.am
M src/openvpn/siphash.h
M src/openvpn/siphash_reference.c
M tests/unit_tests/openvpn/Makefile.am
A tests/unit_tests/openvpn/siphash_openssl.c
A tests/unit_tests/openvpn/siphash_openssl.h
M tests/unit_tests/openvpn/test_crypto.c
8 files changed, 283 insertions(+), 7 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/31/31/21
CMakeLists.txt +6 -0
@@ -572,6 +572,8 @@ src/openvpn/shaper.h src/openvpn/sig.c src/openvpn/sig.h + src/openvpn/siphash.h + src/openvpn/siphash_reference.c src/openvpn/socket.c src/openvpn/socket.h src/openvpn/socket_util.c
@@ -784,6 +786,7 @@ ) target_sources(test_crypto PRIVATE + tests/unit_tests/openvpn//siphash_openssl.c src/openvpn/crypto_mbedtls.c src/openvpn/crypto_openssl.c src/openvpn/crypto_epoch.c
@@ -792,8 +795,11 @@ src/openvpn/packet_id.c src/openvpn/mtu.c src/openvpn/mss.c + src/openvpn/siphash_reference.c ) + target_compile_definitions(test_crypto PRIVATE PREFER_OPENSSL_SIPHASH) + target_sources(test_ssl PRIVATE tests/unit_tests/openvpn/mock_management.c tests/unit_tests/openvpn/mock_ssl_dependencies.c
src/openvpn/Makefile.am +1 -0
@@ -128,6 +128,7 @@ session_id.c session_id.h \ shaper.c shaper.h \ sig.c sig.h \ + siphash_reference.c siphash.h \ socket.c socket.h \ socket_util.c socket_util.h \ socks.c socks.h \
src/openvpn/siphash.h +18 -4
@@ -18,12 +18,26 @@#ifndef SIPHASH_H #define SIPHASH_H -#include <inttypes.h> +#include <stdint.h> +#include <stdio.h> +#include <stdbool.h> /* siphash always uses 128-bit keys */ #define SIPHASH_KEY_SIZE 16 -int siphash (const void *in,size_t inlen,const void *k,uint8_t *out, -size_t outlen); +/** +* Calculates SIPHASH using the reference implementation +*/ +int +siphash_reference (const void *in,size_t inlen,const void *k, +uint8_t *out,size_t outlen); -#endif + +static inline int +siphash (const void *in,size_t inlen,const void *k, +uint8_t *out,size_t outlen) +{ +return siphash_reference (in, inlen, k, out, outlen); +} + +#endif /* ifndef SIPHASH_H */
src/openvpn/siphash_reference.c +1 -1
@@ -100,7 +100,7 @@* outlen: length of the output in bytes, must be 8 or 16 */ int -siphash (const void *in,const size_t inlen,const void *k,uint8_t *out, +siphash_reference (const void *in,const size_t inlen,const void *k,uint8_t *out,const size_t outlen) {const unsigned char *ni = (const unsigned char *)in;
tests/unit_tests/openvpn/Makefile.am +4 -1
@@ -73,6 +73,7 @@ crypto_testdriver_LDFLAGS = @TEST_LDFLAGS@ crypto_testdriver_SOURCES = test_crypto.c \ mock_msg.c mock_msg.h test_common.h \ + siphash_openssl.c siphash_openssl.h \ $(top_srcdir)/src/openvpn/buffer.c \ $(top_srcdir)/src/openvpn/crypto.c \ $(top_srcdir)/src/openvpn/crypto_mbedtls.c \
@@ -84,7 +85,8 @@ $(top_srcdir)/src/openvpn/platform.c \ $(top_srcdir)/src/openvpn/mtu.c \ $(top_srcdir)/src/openvpn/win32-util.c \ - $(top_srcdir)/src/openvpn/mss.c + $(top_srcdir)/src/openvpn/mss.c \ + $(top_srcdir)/src/openvpn/siphash_reference.c dhcp_testdriver_CFLAGS = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@ -DDHCP_UNIT_TEST dhcp_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
@@ -97,6 +99,7 @@ ssl_testdriver_CFLAGS = \ -I$(top_srcdir)/include -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpn \ + -DPREFER_OPENSSL_SIPHASH \ @TEST_CFLAGS@ ssl_testdriver_LDFLAGS = @TEST_LDFLAGS@ $(OPTIONAL_CRYPTO_LIBS) ssl_testdriver_SOURCES = test_ssl.c \
tests/unit_tests/openvpn/siphash_openssl.c new file +144 -0
144 lines not on this page · raw message
tests/unit_tests/openvpn/siphash_openssl.h new file +60 -0
61 lines not on this page · raw message
tests/unit_tests/openvpn/test_crypto.c +49 -1
74 lines not on this page · raw message
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 21
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
[Openvpn-devel] [L] Change in openvpn[master]: Use OpenSSL's SIPHASH implementation to double check our implementation
In reply to a message not in the archiveAttention is currently required from: plaisthos.
Hello flichtenheld,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
to look at the new patch set (#25).
Change subject: Use OpenSSL's SIPHASH implementation to double check our implementation
......................................................................
Use OpenSSL's SIPHASH implementation to double check our implementation
OpenSSL library is currently slower than the reference implementation (about 1.5x to 2x depending of the compiler).
The OpenSSL API for using the SIPHASH MAC is different enough from using normal HMAC or Digest that we already implement that combining them into one API does not make sense.
SIPHASH is only available on OpenSSL 3.1 and later. We still check for support on 3.0 and later as the whole API to allow using the SIPHASH alrady exists in OpenSSL 3.0. Some of the later OpenSSL 3.0.x might get support for it. Theoretically, a provider can be loaded in OpenSSL 3.0 that implements SIPHASH.
With OpenSSL's implementation being slower, we currently only use it to check that our reference implementation and the OpenSSL implementation yield the same result in unit tests
---
M CMakeLists.txt
M src/openvpn/Makefile.am
M src/openvpn/siphash.h
M src/openvpn/siphash_reference.c
M tests/unit_tests/openvpn/Makefile.am
A tests/unit_tests/openvpn/siphash_openssl.c
A tests/unit_tests/openvpn/siphash_openssl.h
M tests/unit_tests/openvpn/test_crypto.c
8 files changed, 304 insertions(+), 8 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/31/31/25
CMakeLists.txt +6 -0
@@ -572,6 +572,8 @@ src/openvpn/shaper.h src/openvpn/sig.c src/openvpn/sig.h + src/openvpn/siphash.h + src/openvpn/siphash_reference.c src/openvpn/socket.c src/openvpn/socket.h src/openvpn/socket_util.c
@@ -784,6 +786,7 @@ ) target_sources(test_crypto PRIVATE + tests/unit_tests/openvpn//siphash_openssl.c src/openvpn/crypto_mbedtls.c src/openvpn/crypto_openssl.c src/openvpn/crypto_epoch.c
@@ -792,8 +795,11 @@ src/openvpn/packet_id.c src/openvpn/mtu.c src/openvpn/mss.c + src/openvpn/siphash_reference.c ) + target_compile_definitions(test_crypto PRIVATE PREFER_OPENSSL_SIPHASH) + target_sources(test_ssl PRIVATE tests/unit_tests/openvpn/mock_management.c tests/unit_tests/openvpn/mock_ssl_dependencies.c
src/openvpn/Makefile.am +1 -0
@@ -128,6 +128,7 @@ session_id.c session_id.h \ shaper.c shaper.h \ sig.c sig.h \ + siphash_reference.c siphash.h \ socket.c socket.h \ socket_util.c socket_util.h \ socks.c socks.h \
src/openvpn/siphash.h +18 -4
@@ -18,12 +18,26 @@#ifndef SIPHASH_H #define SIPHASH_H -#include <inttypes.h> +#include <stdint.h> +#include <stdio.h> +#include <stdbool.h> /* siphash always uses 128-bit keys */ #define SIPHASH_KEY_SIZE 16 -int siphash (const void *in,size_t inlen,const void *k,uint8_t *out, -size_t outlen); +/** +* Calculates SIPHASH using the reference implementation +*/ +int +siphash_reference (const void *in,size_t inlen,const void *k, +uint8_t *out,size_t outlen); -#endif + +static inline int +siphash (const void *in,size_t inlen,const void *k, +uint8_t *out,size_t outlen) +{ +return siphash_reference (in, inlen, k, out, outlen); +} + +#endif /* ifndef SIPHASH_H */
src/openvpn/siphash_reference.c +2 -2
@@ -100,8 +100,8 @@* outlen: length of the output in bytes, must be 8 or 16 */ int -siphash (const void *in,const size_t inlen,const void *k,uint8_t *out, -const size_t outlen) +siphash_reference (const void *in,const size_t inlen,const void *k,uint8_t *out, +const size_t outlen) {const unsigned char *ni = (const unsigned char *)in;const unsigned char *kk = (const unsigned char *)k;
tests/unit_tests/openvpn/Makefile.am +4 -1
@@ -73,6 +73,7 @@ crypto_testdriver_LDFLAGS = @TEST_LDFLAGS@ crypto_testdriver_SOURCES = test_crypto.c \ mock_msg.c mock_msg.h test_common.h \ + siphash_openssl.c siphash_openssl.h \ $(top_srcdir)/src/openvpn/buffer.c \ $(top_srcdir)/src/openvpn/crypto.c \ $(top_srcdir)/src/openvpn/crypto_mbedtls.c \
@@ -84,7 +85,8 @@ $(top_srcdir)/src/openvpn/platform.c \ $(top_srcdir)/src/openvpn/mtu.c \ $(top_srcdir)/src/openvpn/win32-util.c \ - $(top_srcdir)/src/openvpn/mss.c + $(top_srcdir)/src/openvpn/mss.c \ + $(top_srcdir)/src/openvpn/siphash_reference.c dhcp_testdriver_CFLAGS = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@ -DDHCP_UNIT_TEST dhcp_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
@@ -97,6 +99,7 @@ ssl_testdriver_CFLAGS = \ -I$(top_srcdir)/include -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpn \ + -DPREFER_OPENSSL_SIPHASH \ @TEST_CFLAGS@ ssl_testdriver_LDFLAGS = @TEST_LDFLAGS@ $(OPTIONAL_CRYPTO_LIBS) ssl_testdriver_SOURCES = test_ssl.c \
tests/unit_tests/openvpn/siphash_openssl.c new file +144 -0
144 lines not on this page · raw message
tests/unit_tests/openvpn/siphash_openssl.h new file +60 -0
61 lines not on this page · raw message
tests/unit_tests/openvpn/test_crypto.c +69 -1
94 lines not on this page · raw message
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 25
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
[Openvpn-devel] [L] Change in openvpn[master]: Use OpenSSL's SIPHASH implementation to double check our implementation
In reply to a message not in the archiveAttention is currently required from: plaisthos.
Hello flichtenheld,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
to look at the new patch set (#26).
Change subject: Use OpenSSL's SIPHASH implementation to double check our implementation
......................................................................
Use OpenSSL's SIPHASH implementation to double check our implementation
OpenSSL library is currently slower than the reference implementation (about 1.5x to 2x depending of the compiler).
The OpenSSL API for using the SIPHASH MAC is different enough from using normal HMAC or Digest that we already implement that combining them into one API does not make sense.
SIPHASH is only available on OpenSSL 3.1 and later. We still check for support on 3.0 and later as the whole API to allow using the SIPHASH alrady exists in OpenSSL 3.0. Some of the later OpenSSL 3.0.x might get support for it. Theoretically, a provider can be loaded in OpenSSL 3.0 that implements SIPHASH.
With OpenSSL's implementation being slower, we currently only use it to check that our reference implementation and the OpenSSL implementation yield the same result in unit tests
---
M CMakeLists.txt
M src/openvpn/Makefile.am
M src/openvpn/siphash.h
M src/openvpn/siphash_reference.c
M tests/unit_tests/openvpn/Makefile.am
A tests/unit_tests/openvpn/siphash_openssl.c
A tests/unit_tests/openvpn/siphash_openssl.h
M tests/unit_tests/openvpn/test_crypto.c
8 files changed, 304 insertions(+), 8 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/31/31/26
CMakeLists.txt +6 -0
@@ -572,6 +572,8 @@ src/openvpn/shaper.h src/openvpn/sig.c src/openvpn/sig.h + src/openvpn/siphash.h + src/openvpn/siphash_reference.c src/openvpn/socket.c src/openvpn/socket.h src/openvpn/socket_util.c
@@ -784,6 +786,7 @@ ) target_sources(test_crypto PRIVATE + tests/unit_tests/openvpn//siphash_openssl.c src/openvpn/crypto_mbedtls.c src/openvpn/crypto_openssl.c src/openvpn/crypto_epoch.c
@@ -792,8 +795,11 @@ src/openvpn/packet_id.c src/openvpn/mtu.c src/openvpn/mss.c + src/openvpn/siphash_reference.c ) + target_compile_definitions(test_crypto PRIVATE PREFER_OPENSSL_SIPHASH) + target_sources(test_ssl PRIVATE tests/unit_tests/openvpn/mock_management.c tests/unit_tests/openvpn/mock_ssl_dependencies.c
src/openvpn/Makefile.am +1 -0
@@ -128,6 +128,7 @@ session_id.c session_id.h \ shaper.c shaper.h \ sig.c sig.h \ + siphash_reference.c siphash.h \ socket.c socket.h \ socket_util.c socket_util.h \ socks.c socks.h \
src/openvpn/siphash.h +18 -4
@@ -18,12 +18,26 @@#ifndef SIPHASH_H #define SIPHASH_H -#include <inttypes.h> +#include <stdint.h> +#include <stdio.h> +#include <stdbool.h> /* siphash always uses 128-bit keys */ #define SIPHASH_KEY_SIZE 16 -int siphash (const void *in,size_t inlen,const void *k,uint8_t *out, -size_t outlen); +/** +* Calculates SIPHASH using the reference implementation +*/ +int +siphash_reference (const void *in,size_t inlen,const void *k, +uint8_t *out,size_t outlen); -#endif + +static inline int +siphash (const void *in,size_t inlen,const void *k, +uint8_t *out,size_t outlen) +{ +return siphash_reference (in, inlen, k, out, outlen); +} + +#endif /* ifndef SIPHASH_H */
src/openvpn/siphash_reference.c +2 -2
@@ -100,8 +100,8 @@* outlen: length of the output in bytes, must be 8 or 16 */ int -siphash (const void *in,const size_t inlen,const void *k,uint8_t *out, -const size_t outlen) +siphash_reference (const void *in,const size_t inlen,const void *k,uint8_t *out, +const size_t outlen) {const unsigned char *ni = (const unsigned char *)in;const unsigned char *kk = (const unsigned char *)k;
tests/unit_tests/openvpn/Makefile.am +4 -1
@@ -73,6 +73,7 @@ crypto_testdriver_LDFLAGS = @TEST_LDFLAGS@ crypto_testdriver_SOURCES = test_crypto.c \ mock_msg.c mock_msg.h test_common.h \ + siphash_openssl.c siphash_openssl.h \ $(top_srcdir)/src/openvpn/buffer.c \ $(top_srcdir)/src/openvpn/crypto.c \ $(top_srcdir)/src/openvpn/crypto_mbedtls.c \
@@ -84,7 +85,8 @@ $(top_srcdir)/src/openvpn/platform.c \ $(top_srcdir)/src/openvpn/mtu.c \ $(top_srcdir)/src/openvpn/win32-util.c \ - $(top_srcdir)/src/openvpn/mss.c + $(top_srcdir)/src/openvpn/mss.c \ + $(top_srcdir)/src/openvpn/siphash_reference.c dhcp_testdriver_CFLAGS = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@ -DDHCP_UNIT_TEST dhcp_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
@@ -97,6 +99,7 @@ ssl_testdriver_CFLAGS = \ -I$(top_srcdir)/include -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpn \ + -DPREFER_OPENSSL_SIPHASH \ @TEST_CFLAGS@ ssl_testdriver_LDFLAGS = @TEST_LDFLAGS@ $(OPTIONAL_CRYPTO_LIBS) ssl_testdriver_SOURCES = test_ssl.c \
tests/unit_tests/openvpn/siphash_openssl.c new file +144 -0
144 lines not on this page · raw message
tests/unit_tests/openvpn/siphash_openssl.h new file +60 -0
61 lines not on this page · raw message
tests/unit_tests/openvpn/test_crypto.c +69 -1
94 lines not on this page · raw message
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 26
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
[Openvpn-devel] [L] Change in openvpn[master]: Use OpenSSL's SIPHASH implementation to double check our implementation
In reply to a message not in the archiveAttention is currently required from: plaisthos.
Hello flichtenheld,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
to look at the new patch set (#27).
Change subject: Use OpenSSL's SIPHASH implementation to double check our implementation
......................................................................
Use OpenSSL's SIPHASH implementation to double check our implementation
OpenSSL library is currently slower than the reference implementation (about 1.5x to 2x depending of the compiler).
The OpenSSL API for using the SIPHASH MAC is different enough from using normal HMAC or Digest that we already implement that combining them into one API does not make sense.
SIPHASH is only available on OpenSSL 3.1 and later. We still check for support on 3.0 and later as the whole API to allow using the SIPHASH alrady exists in OpenSSL 3.0. Some of the later OpenSSL 3.0.x might get support for it. Theoretically, a provider can be loaded in OpenSSL 3.0 that implements SIPHASH.
With OpenSSL's implementation being slower, we currently only use it to check that our reference implementation and the OpenSSL implementation yield the same result in unit tests
---
M CMakeLists.txt
M src/openvpn/Makefile.am
M src/openvpn/siphash.h
M src/openvpn/siphash_reference.c
M tests/unit_tests/openvpn/Makefile.am
A tests/unit_tests/openvpn/siphash_openssl.c
A tests/unit_tests/openvpn/siphash_openssl.h
M tests/unit_tests/openvpn/test_crypto.c
8 files changed, 304 insertions(+), 8 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/31/31/27
CMakeLists.txt +6 -0
@@ -572,6 +572,8 @@ src/openvpn/shaper.h src/openvpn/sig.c src/openvpn/sig.h + src/openvpn/siphash.h + src/openvpn/siphash_reference.c src/openvpn/socket.c src/openvpn/socket.h src/openvpn/socket_util.c
@@ -784,6 +786,7 @@ ) target_sources(test_crypto PRIVATE + tests/unit_tests/openvpn//siphash_openssl.c src/openvpn/crypto_mbedtls.c src/openvpn/crypto_openssl.c src/openvpn/crypto_epoch.c
@@ -792,8 +795,11 @@ src/openvpn/packet_id.c src/openvpn/mtu.c src/openvpn/mss.c + src/openvpn/siphash_reference.c ) + target_compile_definitions(test_crypto PRIVATE PREFER_OPENSSL_SIPHASH) + target_sources(test_ssl PRIVATE tests/unit_tests/openvpn/mock_management.c tests/unit_tests/openvpn/mock_ssl_dependencies.c
src/openvpn/Makefile.am +1 -0
@@ -128,6 +128,7 @@ session_id.c session_id.h \ shaper.c shaper.h \ sig.c sig.h \ + siphash_reference.c siphash.h \ socket.c socket.h \ socket_util.c socket_util.h \ socks.c socks.h \
src/openvpn/siphash.h +18 -4
@@ -18,12 +18,26 @@#ifndef SIPHASH_H #define SIPHASH_H -#include <inttypes.h> +#include <stdint.h> +#include <stdio.h> +#include <stdbool.h> /* siphash always uses 128-bit keys */ #define SIPHASH_KEY_SIZE 16 -int siphash (const void *in,size_t inlen,const void *k,uint8_t *out, -size_t outlen); +/** +* Calculates SIPHASH using the reference implementation +*/ +int +siphash_reference (const void *in,size_t inlen,const void *k, +uint8_t *out,size_t outlen); -#endif + +static inline int +siphash (const void *in,size_t inlen,const void *k, +uint8_t *out,size_t outlen) +{ +return siphash_reference (in, inlen, k, out, outlen); +} + +#endif /* ifndef SIPHASH_H */
src/openvpn/siphash_reference.c +2 -2
@@ -100,8 +100,8 @@* outlen: length of the output in bytes, must be 8 or 16 */ int -siphash (const void *in,const size_t inlen,const void *k,uint8_t *out, -const size_t outlen) +siphash_reference (const void *in,const size_t inlen,const void *k,uint8_t *out, +const size_t outlen) {const unsigned char *ni = (const unsigned char *)in;const unsigned char *kk = (const unsigned char *)k;
tests/unit_tests/openvpn/Makefile.am +4 -1
@@ -73,6 +73,7 @@ crypto_testdriver_LDFLAGS = @TEST_LDFLAGS@ crypto_testdriver_SOURCES = test_crypto.c \ mock_msg.c mock_msg.h test_common.h \ + siphash_openssl.c siphash_openssl.h \ $(top_srcdir)/src/openvpn/buffer.c \ $(top_srcdir)/src/openvpn/crypto.c \ $(top_srcdir)/src/openvpn/crypto_mbedtls.c \
@@ -84,7 +85,8 @@ $(top_srcdir)/src/openvpn/platform.c \ $(top_srcdir)/src/openvpn/mtu.c \ $(top_srcdir)/src/openvpn/win32-util.c \ - $(top_srcdir)/src/openvpn/mss.c + $(top_srcdir)/src/openvpn/mss.c \ + $(top_srcdir)/src/openvpn/siphash_reference.c dhcp_testdriver_CFLAGS = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@ -DDHCP_UNIT_TEST dhcp_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
@@ -97,6 +99,7 @@ ssl_testdriver_CFLAGS = \ -I$(top_srcdir)/include -I$(top_srcdir)/src/compat -I$(top_srcdir)/src/openvpn \ + -DPREFER_OPENSSL_SIPHASH \ @TEST_CFLAGS@ ssl_testdriver_LDFLAGS = @TEST_LDFLAGS@ $(OPTIONAL_CRYPTO_LIBS) ssl_testdriver_SOURCES = test_ssl.c \
tests/unit_tests/openvpn/siphash_openssl.c new file +144 -0
144 lines not on this page · raw message
tests/unit_tests/openvpn/siphash_openssl.h new file +60 -0
61 lines not on this page · raw message
tests/unit_tests/openvpn/test_crypto.c +69 -1
94 lines not on this page · raw message
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 27
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
[Openvpn-devel] [L] Change in openvpn[master]: Use OpenSSL's SIPHASH implementation to double check our implementation
In reply to a message not in the archiveAttention is currently required from: flichtenheld.
plaisthos has posted comments on this change by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/31?usp=email )
Change subject: Use OpenSSL's SIPHASH implementation to double check our implementation
......................................................................
Patch Set 28:
(1 comment)
Patchset:
PS20:
Quoted 1 line
Let's discuss this carefully. […]
I changed the commit to only double our implement (or AWS LC) and also removed the whole context stuff from the previous patch and replaced with a fixed sized array.
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 28
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]>
Gerrit-Comment-Date: Mon, 27 Jul 2026 12:54:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: flichtenheld <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
[Openvpn-devel] [L] Change in openvpn[master]: Use OpenSSL's SIPHASH implementation to double check our implementation
In reply to a message not in the archiveAttention is currently required from: plaisthos.
flichtenheld has posted comments on this change by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/31?usp=email )
Change subject: Use OpenSSL's SIPHASH implementation to double check our implementation
......................................................................
Patch Set 28: Code-Review-1
(5 comments)
Patchset:
PS20:
Quoted 1 line
I changed the commit to only double our implement (or AWS LC) and also removed the whole context stu […]
Acknowledged
File CMakeLists.txt:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/7c17fa3c_8c8925c9?usp=email :
PS28, Line 801: target_compile_definitions(test_crypto PRIVATE PREFER_OPENSSL_SIPHASH)
Does this still do anything?
File tests/unit_tests/openvpn/Makefile.am:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/e3e08277_ebd09952?usp=email :
PS28, Line 102: -DPREFER_OPENSSL_SIPHASH \
Does this still do anything?
File tests/unit_tests/openvpn/siphash_openssl.h:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/3f47a563_e861ae7d?usp=email :
PS28, Line 2: * SipHash reference C implementation
Wrong copyright header
File tests/unit_tests/openvpn/siphash_openssl.c:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/54f0abd7_e9a26545?usp=email :
PS28, Line 35: * implementation, so we only use for unit testing that our impelmentation "use it"
"implementation"
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 28
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
Gerrit-Comment-Date: Thu, 30 Jul 2026 10:08:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: plaisthos <[email protected]>
Comment-In-Reply-To: flichtenheld <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
[Openvpn-devel] [L] Change in openvpn[master]: Use OpenSSL's SIPHASH implementation to double check our implementation
In reply to a message not in the archiveAttention is currently required from: flichtenheld, plaisthos.
Hello flichtenheld,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
to look at the new patch set (#29).
The following approvals got outdated and were removed:
Code-Review-1 by flichtenheld
Change subject: Use OpenSSL's SIPHASH implementation to double check our implementation
......................................................................
Use OpenSSL's SIPHASH implementation to double check our implementation
OpenSSL library is currently slower than the reference implementation (about 1.5x to 2x depending of the compiler).
The OpenSSL API for using the SIPHASH MAC is different enough from using normal HMAC or Digest that we already implement that combining them into one API does not make sense.
SIPHASH is only available on OpenSSL 3.1 and later. We still check for support on 3.0 and later as the whole API to allow using the SIPHASH alrady exists in OpenSSL 3.0. Some of the later OpenSSL 3.0.x might get support for it. Theoretically, a provider can be loaded in OpenSSL 3.0 that implements SIPHASH.
With OpenSSL's implementation being slower, we currently only use it to check that our reference implementation and the OpenSSL implementation yield the same result in unit tests
---
M CMakeLists.txt
M src/openvpn/Makefile.am
M src/openvpn/siphash.h
M src/openvpn/siphash_reference.c
M tests/unit_tests/openvpn/Makefile.am
A tests/unit_tests/openvpn/siphash_openssl.c
A tests/unit_tests/openvpn/siphash_openssl.h
M tests/unit_tests/openvpn/test_crypto.c
8 files changed, 305 insertions(+), 8 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/31/31/29
CMakeLists.txt +4 -0
@@ -572,6 +572,8 @@ src/openvpn/shaper.h src/openvpn/sig.c src/openvpn/sig.h + src/openvpn/siphash.h + src/openvpn/siphash_reference.c src/openvpn/socket.c src/openvpn/socket.h src/openvpn/socket_util.c
@@ -784,6 +786,7 @@ ) target_sources(test_crypto PRIVATE + tests/unit_tests/openvpn/siphash_openssl.c src/openvpn/crypto_mbedtls.c src/openvpn/crypto_openssl.c src/openvpn/crypto_epoch.c
@@ -792,6 +795,7 @@ src/openvpn/packet_id.c src/openvpn/mtu.c src/openvpn/mss.c + src/openvpn/siphash_reference.c ) target_sources(test_ssl PRIVATE
src/openvpn/Makefile.am +1 -0
@@ -128,6 +128,7 @@ session_id.c session_id.h \ shaper.c shaper.h \ sig.c sig.h \ + siphash_reference.c siphash.h \ socket.c socket.h \ socket_util.c socket_util.h \ socks.c socks.h \
src/openvpn/siphash.h +18 -4
@@ -18,12 +18,26 @@#ifndef SIPHASH_H #define SIPHASH_H -#include <inttypes.h> +#include <stdint.h> +#include <stdio.h> +#include <stdbool.h> /* siphash always uses 128-bit keys */ #define SIPHASH_KEY_SIZE 16 -int siphash (const void *in,size_t inlen,const void *k,uint8_t *out, -size_t outlen); +/** +* Calculates SIPHASH using the reference implementation +*/ +int +siphash_reference (const void *in,size_t inlen,const void *k, +uint8_t *out,size_t outlen); -#endif + +static inline int +siphash (const void *in,size_t inlen,const void *k, +uint8_t *out,size_t outlen) +{ +return siphash_reference (in, inlen, k, out, outlen); +} + +#endif /* ifndef SIPHASH_H */
src/openvpn/siphash_reference.c +2 -2
@@ -100,8 +100,8 @@* outlen: length of the output in bytes, must be 8 or 16 */ int -siphash (const void *in,const size_t inlen,const void *k,uint8_t *out, -const size_t outlen) +siphash_reference (const void *in,const size_t inlen,const void *k,uint8_t *out, +const size_t outlen) {const unsigned char *ni = (const unsigned char *)in;const unsigned char *kk = (const unsigned char *)k;
tests/unit_tests/openvpn/Makefile.am +3 -1
@@ -73,6 +73,7 @@ crypto_testdriver_LDFLAGS = @TEST_LDFLAGS@ crypto_testdriver_SOURCES = test_crypto.c \ mock_msg.c mock_msg.h test_common.h \ + siphash_openssl.c siphash_openssl.h \ $(top_srcdir)/src/openvpn/buffer.c \ $(top_srcdir)/src/openvpn/crypto.c \ $(top_srcdir)/src/openvpn/crypto_mbedtls.c \
@@ -84,7 +85,8 @@ $(top_srcdir)/src/openvpn/platform.c \ $(top_srcdir)/src/openvpn/mtu.c \ $(top_srcdir)/src/openvpn/win32-util.c \ - $(top_srcdir)/src/openvpn/mss.c + $(top_srcdir)/src/openvpn/mss.c \ + $(top_srcdir)/src/openvpn/siphash_reference.c dhcp_testdriver_CFLAGS = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@ -DDHCP_UNIT_TEST dhcp_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
tests/unit_tests/openvpn/siphash_openssl.c new file +144 -0
144 lines not on this page · raw message
tests/unit_tests/openvpn/siphash_openssl.h new file +64 -0
65 lines not on this page · raw message
tests/unit_tests/openvpn/test_crypto.c +69 -1
94 lines not on this page · raw message
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 29
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
[Openvpn-devel] [L] Change in openvpn[master]: Use OpenSSL's SIPHASH implementation to double check our implementation
In reply to a message not in the archiveAttention is currently required from: plaisthos.
flichtenheld has posted comments on this change by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/31?usp=email )
Change subject: Use OpenSSL's SIPHASH implementation to double check our implementation
......................................................................
Patch Set 30: Code-Review+2
(4 comments)
File CMakeLists.txt:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/9105e2b1_f784d6bb?usp=email :
PS28, Line 801: target_compile_definitions(test_crypto PRIVATE PREFER_OPENSSL_SIPHASH)
Quoted 1 line
Does this still do anything?
Done
File tests/unit_tests/openvpn/Makefile.am:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/13bc8e15_e9fb0f81?usp=email :
PS28, Line 102: -DPREFER_OPENSSL_SIPHASH \
Quoted 1 line
Does this still do anything?
Done
File tests/unit_tests/openvpn/siphash_openssl.h:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/c2a5f74c_9ec317f0?usp=email :
PS28, Line 2: * SipHash reference C implementation
Quoted 1 line
Wrong copyright header
Done
File tests/unit_tests/openvpn/siphash_openssl.c:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/e652f08a_7890d92e?usp=email :
PS28, Line 35: * implementation, so we only use for unit testing that our impelmentation
Quoted 1 line
"use it" […]
Done
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 30
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
Gerrit-Comment-Date: Thu, 30 Jul 2026 18:23:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: flichtenheld <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
PATCH v30 1/1 Use OpenSSL's SIPHASH implementation to double check our implementation
In reply to a message not in the archiveFrom: Arne Schwabe <[email protected]>
OpenSSL library is currently slower than the reference implementation (about 1.5x to 2x depending of the compiler).
The OpenSSL API for using the SIPHASH MAC is different enough from using normal HMAC or Digest that we already implement that combining them into one API does not make sense.
SIPHASH is only available on OpenSSL 3.1 and later. We still check for support on 3.0 and later as the whole API to allow using the SIPHASH alrady exists in OpenSSL 3.0. Some of the later OpenSSL 3.0.x might get support for it. Theoretically, a provider can be loaded in OpenSSL 3.0 that implements SIPHASH.
With OpenSSL's implementation being slower, we currently only use it to check that our reference implementation and the OpenSSL implementation yield the same result in unit tests
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/31
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/31
This mail reflects revision 30 of this Change.
Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <[email protected]>
CMakeLists.txt +4 -0
@@ -572,6 +572,8 @@ src/openvpn/shaper.h src/openvpn/sig.c src/openvpn/sig.h + src/openvpn/siphash.h + src/openvpn/siphash_reference.c src/openvpn/socket.c src/openvpn/socket.h src/openvpn/socket_util.c
@@ -784,6 +786,7 @@ ) target_sources(test_crypto PRIVATE + tests/unit_tests/openvpn/siphash_openssl.c src/openvpn/crypto_mbedtls.c src/openvpn/crypto_openssl.c src/openvpn/crypto_epoch.c
@@ -792,6 +795,7 @@ src/openvpn/packet_id.c src/openvpn/mtu.c src/openvpn/mss.c + src/openvpn/siphash_reference.c ) target_sources(test_ssl PRIVATE
src/openvpn/Makefile.am +1 -0
@@ -128,6 +128,7 @@ session_id.c session_id.h \ shaper.c shaper.h \ sig.c sig.h \ + siphash_reference.c siphash.h \ socket.c socket.h \ socket_util.c socket_util.h \ socks.c socks.h \
src/openvpn/siphash.h +18 -4
@@ -18,12 +18,26 @@#ifndef SIPHASH_H #define SIPHASH_H -#include <inttypes.h> +#include <stdint.h> +#include <stdio.h> +#include <stdbool.h> /* siphash always uses 128-bit keys */ #define SIPHASH_KEY_SIZE 16 -int siphash (const void *in,size_t inlen,const void *k,uint8_t *out, -size_t outlen); +/** +* Calculates SIPHASH using the reference implementation +*/ +int +siphash_reference (const void *in,size_t inlen,const void *k, +uint8_t *out,size_t outlen); -#endif + +static inline int +siphash (const void *in,size_t inlen,const void *k, +uint8_t *out,size_t outlen) +{ +return siphash_reference (in, inlen, k, out, outlen); +} + +#endif /* ifndef SIPHASH_H */
src/openvpn/siphash_reference.c +2 -2
@@ -100,8 +100,8 @@* outlen: length of the output in bytes, must be 8 or 16 */ int -siphash (const void *in,const size_t inlen,const void *k,uint8_t *out, -const size_t outlen) +siphash_reference (const void *in,const size_t inlen,const void *k,uint8_t *out, +const size_t outlen) {const unsigned char *ni = (const unsigned char *)in;const unsigned char *kk = (const unsigned char *)k;
tests/unit_tests/openvpn/Makefile.am +3 -1
@@ -73,6 +73,7 @@ crypto_testdriver_LDFLAGS = @TEST_LDFLAGS@ crypto_testdriver_SOURCES = test_crypto.c \ mock_msg.c mock_msg.h test_common.h \ + siphash_openssl.c siphash_openssl.h \ $(top_srcdir)/src/openvpn/buffer.c \ $(top_srcdir)/src/openvpn/crypto.c \ $(top_srcdir)/src/openvpn/crypto_mbedtls.c \
@@ -84,7 +85,8 @@ $(top_srcdir)/src/openvpn/platform.c \ $(top_srcdir)/src/openvpn/mtu.c \ $(top_srcdir)/src/openvpn/win32-util.c \ - $(top_srcdir)/src/openvpn/mss.c + $(top_srcdir)/src/openvpn/mss.c \ + $(top_srcdir)/src/openvpn/siphash_reference.c dhcp_testdriver_CFLAGS = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@ -DDHCP_UNIT_TEST dhcp_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
tests/unit_tests/openvpn/siphash_openssl.c new file +144 -0
144 lines not on this page · raw message
tests/unit_tests/openvpn/siphash_openssl.h new file +64 -0
65 lines not on this page · raw message
tests/unit_tests/openvpn/test_crypto.c +69 -1
94 lines not on this page · raw message
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
[Openvpn-devel] [PATCH applied] Re: Use OpenSSL's SIPHASH implementation to double check our implementation
This does not actually *do* anything for "man openvpn" yet - it adds unit test code verifying that the "siphash implementation used in main" (currently only reference) tests correctly against OpenSSL siphash - tested this on Gentoo with OpenSSL 3.5.7
PASS: crypto_testdriver
..
[ RUN ] test_siphash
[ OK ] test_siphash
[ RUN ] test_siphash_openssl
[ OK ] test_siphash_openssl
[==========] crypto tests: 21 test(s) run.
Also tested "make distcheck" (as this adds a few new files and we like to forget to bundle them...)
=================================================
openvpn-2.8_git archives ready for distribution:
openvpn-2.8_git.tar.gz
=================================================
Your patch has been applied to the master branch.
commit f129a7807408b1cb2975e47e99f594c587ba4576
Author: Arne Schwabe Date: Thu Aug 6 17:32:30 2026 +0200
Use OpenSSL's SIPHASH implementation to double check our implementation
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/31
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg38180.html
--
kind regards,
Gert Doering
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
[Openvpn-devel] [L] Change in openvpn[master]: Use OpenSSL's SIPHASH implementation to double check our implementation
In reply to a message not in the archivecron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/31?usp=email )
Change subject: Use OpenSSL's SIPHASH implementation to double check our implementation
......................................................................
Use OpenSSL's SIPHASH implementation to double check our implementation
OpenSSL library is currently slower than the reference implementation (about 1.5x to 2x depending of the compiler).
The OpenSSL API for using the SIPHASH MAC is different enough from using normal HMAC or Digest that we already implement that combining them into one API does not make sense.
SIPHASH is only available on OpenSSL 3.1 and later. We still check for support on 3.0 and later as the whole API to allow using the SIPHASH alrady exists in OpenSSL 3.0. Some of the later OpenSSL 3.0.x might get support for it. Theoretically, a provider can be loaded in OpenSSL 3.0 that implements SIPHASH.
With OpenSSL's implementation being slower, we currently only use it to check that our reference implementation and the OpenSSL implementation yield the same result in unit tests
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/31
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg38180.html
---
M CMakeLists.txt
M src/openvpn/Makefile.am
M src/openvpn/siphash.h
M src/openvpn/siphash_reference.c
M tests/unit_tests/openvpn/Makefile.am
A tests/unit_tests/openvpn/siphash_openssl.c
A tests/unit_tests/openvpn/siphash_openssl.h
M tests/unit_tests/openvpn/test_crypto.c
8 files changed, 305 insertions(+), 8 deletions(-)
CMakeLists.txt +4 -0
@@ -572,6 +572,8 @@ src/openvpn/shaper.h src/openvpn/sig.c src/openvpn/sig.h + src/openvpn/siphash.h + src/openvpn/siphash_reference.c src/openvpn/socket.c src/openvpn/socket.h src/openvpn/socket_util.c
@@ -784,6 +786,7 @@ ) target_sources(test_crypto PRIVATE + tests/unit_tests/openvpn/siphash_openssl.c src/openvpn/crypto_mbedtls.c src/openvpn/crypto_openssl.c src/openvpn/crypto_epoch.c
@@ -792,6 +795,7 @@ src/openvpn/packet_id.c src/openvpn/mtu.c src/openvpn/mss.c + src/openvpn/siphash_reference.c ) target_sources(test_ssl PRIVATE
src/openvpn/Makefile.am +1 -0
@@ -128,6 +128,7 @@ session_id.c session_id.h \ shaper.c shaper.h \ sig.c sig.h \ + siphash_reference.c siphash.h \ socket.c socket.h \ socket_util.c socket_util.h \ socks.c socks.h \
src/openvpn/siphash.h +18 -4
@@ -18,12 +18,26 @@#ifndef SIPHASH_H #define SIPHASH_H -#include <inttypes.h> +#include <stdint.h> +#include <stdio.h> +#include <stdbool.h> /* siphash always uses 128-bit keys */ #define SIPHASH_KEY_SIZE 16 -int siphash (const void *in,size_t inlen,const void *k,uint8_t *out, -size_t outlen); +/** +* Calculates SIPHASH using the reference implementation +*/ +int +siphash_reference (const void *in,size_t inlen,const void *k, +uint8_t *out,size_t outlen); -#endif + +static inline int +siphash (const void *in,size_t inlen,const void *k, +uint8_t *out,size_t outlen) +{ +return siphash_reference (in, inlen, k, out, outlen); +} + +#endif /* ifndef SIPHASH_H */
src/openvpn/siphash_reference.c +2 -2
@@ -100,8 +100,8 @@* outlen: length of the output in bytes, must be 8 or 16 */ int -siphash (const void *in,const size_t inlen,const void *k,uint8_t *out, -const size_t outlen) +siphash_reference (const void *in,const size_t inlen,const void *k,uint8_t *out, +const size_t outlen) {const unsigned char *ni = (const unsigned char *)in;const unsigned char *kk = (const unsigned char *)k;
tests/unit_tests/openvpn/Makefile.am +3 -1
@@ -73,6 +73,7 @@ crypto_testdriver_LDFLAGS = @TEST_LDFLAGS@ crypto_testdriver_SOURCES = test_crypto.c \ mock_msg.c mock_msg.h test_common.h \ + siphash_openssl.c siphash_openssl.h \ $(top_srcdir)/src/openvpn/buffer.c \ $(top_srcdir)/src/openvpn/crypto.c \ $(top_srcdir)/src/openvpn/crypto_mbedtls.c \
@@ -84,7 +85,8 @@ $(top_srcdir)/src/openvpn/platform.c \ $(top_srcdir)/src/openvpn/mtu.c \ $(top_srcdir)/src/openvpn/win32-util.c \ - $(top_srcdir)/src/openvpn/mss.c + $(top_srcdir)/src/openvpn/mss.c \ + $(top_srcdir)/src/openvpn/siphash_reference.c dhcp_testdriver_CFLAGS = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@ -DDHCP_UNIT_TEST dhcp_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
tests/unit_tests/openvpn/siphash_openssl.c new file +144 -0
144 lines not on this page · raw message
tests/unit_tests/openvpn/siphash_openssl.h new file +64 -0
65 lines not on this page · raw message
tests/unit_tests/openvpn/test_crypto.c +69 -1
94 lines not on this page · raw message
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 31
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
[Openvpn-devel] [L] Change in openvpn[master]: Use OpenSSL's SIPHASH implementation to double check our implementation
In reply to a message not in the archivecron2 has uploaded a new patch set (#31) to the change originally created by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/31?usp=email )
The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld
Change subject: Use OpenSSL's SIPHASH implementation to double check our implementation
......................................................................
Use OpenSSL's SIPHASH implementation to double check our implementation
OpenSSL library is currently slower than the reference implementation (about 1.5x to 2x depending of the compiler).
The OpenSSL API for using the SIPHASH MAC is different enough from using normal HMAC or Digest that we already implement that combining them into one API does not make sense.
SIPHASH is only available on OpenSSL 3.1 and later. We still check for support on 3.0 and later as the whole API to allow using the SIPHASH alrady exists in OpenSSL 3.0. Some of the later OpenSSL 3.0.x might get support for it. Theoretically, a provider can be loaded in OpenSSL 3.0 that implements SIPHASH.
With OpenSSL's implementation being slower, we currently only use it to check that our reference implementation and the OpenSSL implementation yield the same result in unit tests
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/31
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg38180.html
---
M CMakeLists.txt
M src/openvpn/Makefile.am
M src/openvpn/siphash.h
M src/openvpn/siphash_reference.c
M tests/unit_tests/openvpn/Makefile.am
A tests/unit_tests/openvpn/siphash_openssl.c
A tests/unit_tests/openvpn/siphash_openssl.h
M tests/unit_tests/openvpn/test_crypto.c
8 files changed, 305 insertions(+), 8 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/31/31/31
CMakeLists.txt +4 -0
@@ -572,6 +572,8 @@ src/openvpn/shaper.h src/openvpn/sig.c src/openvpn/sig.h + src/openvpn/siphash.h + src/openvpn/siphash_reference.c src/openvpn/socket.c src/openvpn/socket.h src/openvpn/socket_util.c
@@ -784,6 +786,7 @@ ) target_sources(test_crypto PRIVATE + tests/unit_tests/openvpn/siphash_openssl.c src/openvpn/crypto_mbedtls.c src/openvpn/crypto_openssl.c src/openvpn/crypto_epoch.c
@@ -792,6 +795,7 @@ src/openvpn/packet_id.c src/openvpn/mtu.c src/openvpn/mss.c + src/openvpn/siphash_reference.c ) target_sources(test_ssl PRIVATE
src/openvpn/Makefile.am +1 -0
@@ -128,6 +128,7 @@ session_id.c session_id.h \ shaper.c shaper.h \ sig.c sig.h \ + siphash_reference.c siphash.h \ socket.c socket.h \ socket_util.c socket_util.h \ socks.c socks.h \
src/openvpn/siphash.h +18 -4
@@ -18,12 +18,26 @@#ifndef SIPHASH_H #define SIPHASH_H -#include <inttypes.h> +#include <stdint.h> +#include <stdio.h> +#include <stdbool.h> /* siphash always uses 128-bit keys */ #define SIPHASH_KEY_SIZE 16 -int siphash (const void *in,size_t inlen,const void *k,uint8_t *out, -size_t outlen); +/** +* Calculates SIPHASH using the reference implementation +*/ +int +siphash_reference (const void *in,size_t inlen,const void *k, +uint8_t *out,size_t outlen); -#endif + +static inline int +siphash (const void *in,size_t inlen,const void *k, +uint8_t *out,size_t outlen) +{ +return siphash_reference (in, inlen, k, out, outlen); +} + +#endif /* ifndef SIPHASH_H */
src/openvpn/siphash_reference.c +2 -2
@@ -100,8 +100,8 @@* outlen: length of the output in bytes, must be 8 or 16 */ int -siphash (const void *in,const size_t inlen,const void *k,uint8_t *out, -const size_t outlen) +siphash_reference (const void *in,const size_t inlen,const void *k,uint8_t *out, +const size_t outlen) {const unsigned char *ni = (const unsigned char *)in;const unsigned char *kk = (const unsigned char *)k;
tests/unit_tests/openvpn/Makefile.am +3 -1
@@ -73,6 +73,7 @@ crypto_testdriver_LDFLAGS = @TEST_LDFLAGS@ crypto_testdriver_SOURCES = test_crypto.c \ mock_msg.c mock_msg.h test_common.h \ + siphash_openssl.c siphash_openssl.h \ $(top_srcdir)/src/openvpn/buffer.c \ $(top_srcdir)/src/openvpn/crypto.c \ $(top_srcdir)/src/openvpn/crypto_mbedtls.c \
@@ -84,7 +85,8 @@ $(top_srcdir)/src/openvpn/platform.c \ $(top_srcdir)/src/openvpn/mtu.c \ $(top_srcdir)/src/openvpn/win32-util.c \ - $(top_srcdir)/src/openvpn/mss.c + $(top_srcdir)/src/openvpn/mss.c \ + $(top_srcdir)/src/openvpn/siphash_reference.c dhcp_testdriver_CFLAGS = -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat @TEST_CFLAGS@ -DDHCP_UNIT_TEST dhcp_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(top_srcdir)/src/openvpn
tests/unit_tests/openvpn/siphash_openssl.c new file +144 -0
144 lines not on this page · raw message
tests/unit_tests/openvpn/siphash_openssl.h new file +64 -0
65 lines not on this page · raw message
tests/unit_tests/openvpn/test_crypto.c +69 -1
94 lines not on this page · raw message
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 31
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
[Openvpn-devel] [L] Change in openvpn[master]: Use OpenSSL's SIPHASH implementation to double check our implementation
In reply to a message not in the archiveplaisthos has posted comments on this change by plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/31?usp=email )
Change subject: Use OpenSSL's SIPHASH implementation to double check our implementation
......................................................................
Patch Set 31:
(4 comments)
File CMakeLists.txt:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/d73fbd06_86c1cfda?usp=email :
PS28, Line 801: target_compile_definitions(test_crypto PRIVATE PREFER_OPENSSL_SIPHASH)
Quoted 1 line
Does this still do anything?
Done. Removed
File tests/unit_tests/openvpn/Makefile.am:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/e41f1e6b_00a12cee?usp=email :
PS28, Line 102: -DPREFER_OPENSSL_SIPHASH \
Quoted 1 line
Does this still do anything?
Acknowledged. Removed.
File tests/unit_tests/openvpn/siphash_openssl.h:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/0c92809c_403132bd?usp=email :
PS28, Line 2: * SipHash reference C implementation
Quoted 1 line
Wrong copyright header
Done
File tests/unit_tests/openvpn/siphash_openssl.c:
http://gerrit.openvpn.net/c/openvpn/+/31/comment/ec1e29bf_2fa77d39?usp=email :
PS28, Line 35: * implementation, so we only use for unit testing that our impelmentation
Quoted 1 line
"use it" […]
Done
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/31?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I09aa27caa1a3aab0d1be6118b26d54a1c1bf7aa0
Gerrit-Change-Number: 31
Gerrit-PatchSet: 31
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Comment-Date: Sat, 08 Aug 2026 12:59:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: flichtenheld <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel