[Openvpn-devel] [S] Change in openvpn[master]: Add aws-lc siphash implementation

"plaisthos \(Code Review\) via Openvpn-devel" <[email protected]>
Newsgroups net.sourceforge.lists.openvpn-devel
Message-ID <80a81576cc9d45e45a9006b5d366d2b93d5514ac-EmailReplacePatchSet-HTML@gerrit.openvpn.net>
Attention is currently required from: flichtenheld, plaisthos.

Hello flichtenheld, 

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1572?usp=email

to look at the new patch set (#10).

The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld

The change is no longer submittable: Code-Review and checks~ChecksSubmitRule are unsatisfied now.


Change subject: Add aws-lc siphash implementation
......................................................................

Add aws-lc siphash implementation

AWS-LC has a siphash implementation that is just a simple function call
that also performs the same/better than the reference implementation that
it looks to be based on. AWS-lc variant seems to have come from boringssl
according to the Google copyright.

Change-Id: I05e20f8c82494e4abf96fe1e3a73e1c7b9101af6
Signed-off-by: Arne Schwabe <[email protected]>
---
M src/openvpn/siphash_openssl.c
1 file changed, 42 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/72/1572/10

diff --git a/src/openvpn/siphash_openssl.c b/src/openvpn/siphash_openssl.c
index 214b3f4..8bf8bd3 100644
--- a/src/openvpn/siphash_openssl.c
+++ b/src/openvpn/siphash_openssl.c
@@ -113,7 +113,49 @@
     EVP_MAC_free(sip->mac);
     free(sip_context);
 }
+#elif defined(OPENSSL_IS_AWSLC)
+#include <openssl/siphash.h>
+#include <string.h>
+#include "error.h"
+/*
+ *  Computes a SipHash value
+ * in: pointer to input data (read-only)
+ *  inlen: input data length in bytes (any size_t value)
+ * k: pointer to the key data (read-only), must be 16 bytes
+ * out: pointer to output data (write-only), outlen bytes must be allocated
+ *  outlen: length of the output in bytes, must be 8 or 16
+ */
+int
+siphash_cryptolib(void *sip_context, const void *in, const size_t inlen,
+                  const void *k, uint8_t *out, const size_t outlen)
+{
+    ASSERT(outlen == sizeof(uint64_t));
+    uint64_t sipout = SIPHASH_24(k, in, inlen);
 
+    memcpy(out, &sipout, sizeof(uint64_t));
+    return 0;
+}
+
+void *
+siphash_cryptolib_init(size_t hash_size)
+{
+    /* This library only supports 64 bit */
+    ASSERT(hash_size == sizeof(uint64_t));
+    /* AWS LC does not need a context */
+    return NULL;
+}
+
+bool
+siphash_cryptolib_available(void *sip_context)
+{
+    return true;
+}
+
+void
+siphash_cryptolib_uninit(void *sip_context)
+{
+    /* The context is already NULL */
+}
 #else
 /* for now, we only have one implementation of SIPHASH in a libray, so put the
  * dummy functions also here */
@@ -140,6 +182,4 @@
 siphash_cryptolib_uninit(void *sip_context)
 {
 }
-
-
 #endif /* if defined(ENABLE_CRYPTO_OPENSSL) && OPENSSL_VERSION_NUMBER >= 0x30000000L */

-- 
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1572?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: I05e20f8c82494e4abf96fe1e3a73e1c7b9101af6
Gerrit-Change-Number: 1572
Gerrit-PatchSet: 10
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.