From nobody Sun Sep 15 20:15:35 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X6K6b5TRNz5WtBs; Sun, 15 Sep 2024 20:15:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X6K6b4ZBJz42NS; Sun, 15 Sep 2024 20:15:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726431335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6rRQOhmi/YotYGWhC14YzCU3O2ieDqCB42XXpsfMF8Q=; b=IHFkjoLJ8HwXe78APytRxdLePKe0C3S8+lnKrsBr82HL0tQCP8ND1g5zjjHLxNQQ/if3jg nFjN59n5HFKozcvi+XIW9RzP3sjyoP1m3GWVjkza2JXvxubtZhBEY8pc9e8J0dFcIDZOMb 5PbIgeTcttjI67gIYu+Dt+1qMlHmmKRNMBRurxGNU4z+UTw/1HBICcozQuklCybaTuJQLf GQpH8tf8/E+8k2XHtPLnuwk6NAdES2xCsMSszuV3wFIZX9ZM93E1trkRrtwts3dyzRbl3S A6A8NhZSY/Fn7yC9+v50cOB2OVK/SCI/PIelLqrFcWxC40UnwVn3iERZ0x5AdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726431335; a=rsa-sha256; cv=none; b=AWD/YAG/CxxPyVYdR32Dz5J57nYTuISuaPmEGv7ASQoM17OooSyCYWVvFrqdAmOZdBMSg5 x0MlDDeAy3XedKMNbFeOxrZ5VTWGv2NKnNNXKqueYJ89AMqEgbtWGjl1K8Iya9+iXIODS4 zfkn8ekP2TLXsNxHIf9aMckv1TKrtwL4osy79FasO0hoBIs0UAQgqGlqvQoSlU99A4/KeE n0V9L4EJdm2UjIleYMzanSCgm6IB/CQNziXTgu5rCanc9UoPgjbyx+ctsUFgSLVLeOr0QD /VIY4swW0a2eYQu3ezV+lOklbelT15rTGiVbeHO92vXYLuz8lF9/xS4f/HrX7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726431335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6rRQOhmi/YotYGWhC14YzCU3O2ieDqCB42XXpsfMF8Q=; b=k84mgaqwIC6/uzBGa90clucrd4F5w0nlPZcJ3w8z2U0mFGRx/Dyvuh23ZLKL3r4ct2Xphd 54BWlPlimULCIECkx8foAyZLdK+DMk4ebpSjllNBZQ1omTfEYqgSoberqozI6su37Bckho 2Q1hBtRihFzp5a0WiXFe7nTBVqdL5Ohu1vFwUZsGlKA8oc0PTrGQaaw6R2Y5VDOr3oRc3P DFeT89vCePv3rz30ZITVCfEiIUGeL3bPVTtr7wq2AWCb/6moTiKe5j2Nft+luzzQYrhC8s a4Lu48td6wXeSz24uuzSxR79FN9N6zUbWEtRd8IhB8NDSZtWT4u7YYVoZyQtDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X6K6b49ZLzPtW; Sun, 15 Sep 2024 20:15:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48FKFZC6080660; Sun, 15 Sep 2024 20:15:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48FKFZLD080656; Sun, 15 Sep 2024 20:15:35 GMT (envelope-from git) Date: Sun, 15 Sep 2024 20:15:35 GMT Message-Id: <202409152015.48FKFZLD080656@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: 2177ea1bb740 - main - security/libhydrogen: Add libhydrogen 0.0.0.g20240509 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2177ea1bb740c4021d20bb4c2c5bc2dee2581cdb Auto-Submitted: auto-generated The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=2177ea1bb740c4021d20bb4c2c5bc2dee2581cdb commit 2177ea1bb740c4021d20bb4c2c5bc2dee2581cdb Author: Po-Chuan Hsieh AuthorDate: 2024-09-15 19:08:08 +0000 Commit: Po-Chuan Hsieh CommitDate: 2024-09-15 20:09:33 +0000 security/libhydrogen: Add libhydrogen 0.0.0.g20240509 The Hydrogen library is a small, easy-to-use, hard-to-misuse cryptographic library. Features: - Consistent high-level API, inspired by libsodium. Instead of low-level primitives, it exposes simple functions to solve common problems that cryptography can solve. - 100% built using just two cryptographic building blocks: the Curve25519 elliptic curve, and the Gimli permutation. - Small and easy to audit. Implemented as one tiny file for every set of operation, and adding a single .c file to your project is all it takes to use libhydrogen in your project. - The whole code is released under a single, very liberal license (ISC). - Zero dynamic memory allocations and low stack requirements (median: 32 bytes, max: 128 bytes). This makes it usable in constrained environments such as microcontrollers. - Portable: written in standard C99. Supports Linux, *BSD, MacOS, Windows, and the Arduino IDE out of the box. - Can generate cryptographically-secure random numbers, even on Arduino boards. - Attempts to mitigate the implications of accidental misuse, even on systems with an unreliable PRG and/or no clock. --- security/Makefile | 1 + security/libhydrogen/Makefile | 18 +++++++++++++ security/libhydrogen/distinfo | 3 +++ security/libhydrogen/files/patch-CMakeLists.txt | 36 +++++++++++++++++++++++++ security/libhydrogen/pkg-descr | 21 +++++++++++++++ security/libhydrogen/pkg-plist | 6 +++++ 6 files changed, 85 insertions(+) diff --git a/security/Makefile b/security/Makefile index 888955587526..ccd72e742840 100644 --- a/security/Makefile +++ b/security/Makefile @@ -295,6 +295,7 @@ SUBDIR += libgpg-error SUBDIR += libgsasl SUBDIR += libhijack + SUBDIR += libhydrogen SUBDIR += libident SUBDIR += libkleo SUBDIR += libkpass diff --git a/security/libhydrogen/Makefile b/security/libhydrogen/Makefile new file mode 100644 index 000000000000..0a4b7110e4b3 --- /dev/null +++ b/security/libhydrogen/Makefile @@ -0,0 +1,18 @@ +PORTNAME= libhydrogen +PORTVERSION= 0.0.0.g20240509 +CATEGORIES= security + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= Lightweight, secure, easy-to-use crypto library for constrained environments +WWW= https://github.com/jedisct1/libhydrogen + +LICENSE= ISCL +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES= cmake + +USE_GITHUB= yes +GH_ACCOUNT= jedisct1 +GH_TAGNAME= c18e510 + +.include diff --git a/security/libhydrogen/distinfo b/security/libhydrogen/distinfo new file mode 100644 index 000000000000..3db51e90e1f1 --- /dev/null +++ b/security/libhydrogen/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1726080915 +SHA256 (jedisct1-libhydrogen-0.0.0.g20240509-c18e510_GH0.tar.gz) = 44e155d56a45cea83e7d838ad2b0c7757d83bcddff3d80663c510d77e365fc17 +SIZE (jedisct1-libhydrogen-0.0.0.g20240509-c18e510_GH0.tar.gz) = 45819 diff --git a/security/libhydrogen/files/patch-CMakeLists.txt b/security/libhydrogen/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..ea713881a2a4 --- /dev/null +++ b/security/libhydrogen/files/patch-CMakeLists.txt @@ -0,0 +1,36 @@ +--- CMakeLists.txt.orig 2024-05-09 19:42:48 UTC ++++ CMakeLists.txt +@@ -89,8 +89,9 @@ set(compile_options + + # Main library + +-add_library("${PROJECT_NAME}") ++add_library("${PROJECT_NAME}" SHARED) + add_library("${PROJECT_NAME}::${PROJECT_NAME}" ALIAS "${PROJECT_NAME}") ++add_library("${PROJECT_NAME}_static" STATIC) + + target_sources("${PROJECT_NAME}" PRIVATE ${source_files}) + +@@ -100,11 +101,21 @@ target_compile_options("${PROJECT_NAME}" PRIVATE ${com + + target_compile_options("${PROJECT_NAME}" PRIVATE ${compile_options}) + ++target_sources("${PROJECT_NAME}_static" PRIVATE ${source_files}) ++ ++target_include_directories("${PROJECT_NAME}_static" ++ PUBLIC $ ++ $) ++ ++target_compile_options("${PROJECT_NAME}_static" PRIVATE ${compile_options}) ++ ++set_target_properties("${PROJECT_NAME}_static" PROPERTIES OUTPUT_NAME "${PROJECT_NAME}") ++ + # Installation + + set(targets_export_name "${PROJECT_NAME}-targets") + +-install(TARGETS "${PROJECT_NAME}" ++install(TARGETS "${PROJECT_NAME}" "${PROJECT_NAME}_static" + EXPORT "${targets_export_name}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") diff --git a/security/libhydrogen/pkg-descr b/security/libhydrogen/pkg-descr new file mode 100644 index 000000000000..65f344c1b1a6 --- /dev/null +++ b/security/libhydrogen/pkg-descr @@ -0,0 +1,21 @@ +The Hydrogen library is a small, easy-to-use, hard-to-misuse cryptographic +library. + +Features: +- Consistent high-level API, inspired by libsodium. Instead of low-level + primitives, it exposes simple functions to solve common problems that + cryptography can solve. +- 100% built using just two cryptographic building blocks: the Curve25519 + elliptic curve, and the Gimli permutation. +- Small and easy to audit. Implemented as one tiny file for every set of + operation, and adding a single .c file to your project is all it takes to use + libhydrogen in your project. +- The whole code is released under a single, very liberal license (ISC). +- Zero dynamic memory allocations and low stack requirements (median: 32 bytes, + max: 128 bytes). This makes it usable in constrained environments such as + microcontrollers. +- Portable: written in standard C99. Supports Linux, *BSD, MacOS, Windows, and + the Arduino IDE out of the box. +- Can generate cryptographically-secure random numbers, even on Arduino boards. +- Attempts to mitigate the implications of accidental misuse, even on systems + with an unreliable PRG and/or no clock. diff --git a/security/libhydrogen/pkg-plist b/security/libhydrogen/pkg-plist new file mode 100644 index 000000000000..6c6eab7a85ee --- /dev/null +++ b/security/libhydrogen/pkg-plist @@ -0,0 +1,6 @@ +include/hydrogen.h +lib/libhydrogen.a +lib/libhydrogen.so +share/cmake/hydrogen/hydrogen-config.cmake +share/cmake/hydrogen/hydrogen-targets-%%CMAKE_BUILD_TYPE%%.cmake +share/cmake/hydrogen/hydrogen-targets.cmake