git: 9bcaea9b3c9d - main - security/libaegis: Add libaegis 0.1.23

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Sun, 15 Sep 2024 20:15:34 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9bcaea9b3c9dc1651db7d3c9a143182608a72ee3

commit 9bcaea9b3c9dc1651db7d3c9a143182608a72ee3
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2024-09-15 19:08:04 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2024-09-15 20:09:33 +0000

    security/libaegis: Add libaegis 0.1.23
    
    libaegis is a portable C implementations of the AEGIS family of high-performance
    authenticated ciphers (AEGIS-128L, AEGIS-128X2, AEGIS-128X4, AEGIS-256,
    AEGIS-256X2, AEGIS-256X4), with runtime CPU detection.
    
    Features:
    - AEGIS-128L with 16 and 32 bytes tags (software, AES-NI, ARM Crypto)
    - AEGIS-128X2 with 16 and 32 bytes tags (software, VAES + AVX2, AES-NI, ARM
      Crypto)
    - AEGIS-128X4 with 16 and 32 bytes tags (software, AVX512, VAES + AVX2, AES-NI,
      ARM Crypto)
    - AEGIS-256 with 16 and 32 bytes tags (software, AES-NI, ARM Crypto)
    - AEGIS-256X2 with 16 and 32 bytes tags (software, VAES + AVX2, AES-NI, ARM
      Crypto)
    - AEGIS-256X4 with 16 and 32 bytes tags (software, AVX512, VAES + AVX2, AES-NI,
      ARM Crypto)
    - All variants of AEGIS-MAC, supporting incremental updates.
    - Encryption and decryption with attached and detached tags
    - Incremental encryption and decryption.
    - Unauthenticated encryption and decryption (not recommended - only implemented
      for specific protocols)
    - Deterministic pseudorandom stream generation.
---
 security/Makefile                            |  1 +
 security/libaegis/Makefile                   | 17 ++++++++++++++
 security/libaegis/distinfo                   |  3 +++
 security/libaegis/files/patch-CMakeLists.txt | 34 ++++++++++++++++++++++++++++
 security/libaegis/pkg-descr                  | 21 +++++++++++++++++
 security/libaegis/pkg-plist                  | 12 ++++++++++
 6 files changed, 88 insertions(+)

diff --git a/security/Makefile b/security/Makefile
index fbd341f75c23..888955587526 100644
--- a/security/Makefile
+++ b/security/Makefile
@@ -281,6 +281,7 @@
     SUBDIR += lasso
     SUBDIR += lastpass-cli
     SUBDIR += lego
+    SUBDIR += libaegis
     SUBDIR += libargon2
     SUBDIR += libassuan
     SUBDIR += libcaes
diff --git a/security/libaegis/Makefile b/security/libaegis/Makefile
new file mode 100644
index 000000000000..87390a3d68e1
--- /dev/null
+++ b/security/libaegis/Makefile
@@ -0,0 +1,17 @@
+PORTNAME=	libaegis
+PORTVERSION=	0.1.23
+CATEGORIES=	security
+
+MAINTAINER=	sunpoet@FreeBSD.org
+COMMENT=	Portable C implementations of the AEGIS family
+WWW=		https://github.com/jedisct1/libaegis
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+USES=		cmake
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	jedisct1
+
+.include <bsd.port.mk>
diff --git a/security/libaegis/distinfo b/security/libaegis/distinfo
new file mode 100644
index 000000000000..edd6cf6f127b
--- /dev/null
+++ b/security/libaegis/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1726080913
+SHA256 (jedisct1-libaegis-0.1.23_GH0.tar.gz) = fb819a40de5455dab0756fbe0878ece782e7f49e6105349caca75801644f3b8c
+SIZE (jedisct1-libaegis-0.1.23_GH0.tar.gz) = 350838
diff --git a/security/libaegis/files/patch-CMakeLists.txt b/security/libaegis/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..ab85e050aff6
--- /dev/null
+++ b/security/libaegis/files/patch-CMakeLists.txt
@@ -0,0 +1,34 @@
+--- CMakeLists.txt.orig	2024-06-10 09:34:37 UTC
++++ CMakeLists.txt
+@@ -13,8 +13,9 @@ file(GLOB HEADER_FILES "src/include/*.h")
+ file(GLOB SOURCE_FILES "src/aegis128l/*.c" "src/aegis128x2/*.c" "src/aegis128x4/*.c" "src/aegis256/*.c" "src/aegis256x2/*.c" "src/aegis256x4/*.c" "src/common/*.c")
+ file(GLOB HEADER_FILES "src/include/*.h")
+ 
+-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})
+ 
+@@ -22,11 +23,19 @@ target_include_directories("${PROJECT_NAME}"
+                            PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
+                                   $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
+ 
++target_sources("${PROJECT_NAME}_static" PRIVATE ${SOURCE_FILES})
++
++target_include_directories("${PROJECT_NAME}_static"
++                           PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
++                                  $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
++
++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/libaegis/pkg-descr b/security/libaegis/pkg-descr
new file mode 100644
index 000000000000..6772942ab411
--- /dev/null
+++ b/security/libaegis/pkg-descr
@@ -0,0 +1,21 @@
+libaegis is a portable C implementations of the AEGIS family of high-performance
+authenticated ciphers (AEGIS-128L, AEGIS-128X2, AEGIS-128X4, AEGIS-256,
+AEGIS-256X2, AEGIS-256X4), with runtime CPU detection.
+
+Features:
+- AEGIS-128L with 16 and 32 bytes tags (software, AES-NI, ARM Crypto)
+- AEGIS-128X2 with 16 and 32 bytes tags (software, VAES + AVX2, AES-NI, ARM
+  Crypto)
+- AEGIS-128X4 with 16 and 32 bytes tags (software, AVX512, VAES + AVX2, AES-NI,
+  ARM Crypto)
+- AEGIS-256 with 16 and 32 bytes tags (software, AES-NI, ARM Crypto)
+- AEGIS-256X2 with 16 and 32 bytes tags (software, VAES + AVX2, AES-NI, ARM
+  Crypto)
+- AEGIS-256X4 with 16 and 32 bytes tags (software, AVX512, VAES + AVX2, AES-NI,
+  ARM Crypto)
+- All variants of AEGIS-MAC, supporting incremental updates.
+- Encryption and decryption with attached and detached tags
+- Incremental encryption and decryption.
+- Unauthenticated encryption and decryption (not recommended - only implemented
+  for specific protocols)
+- Deterministic pseudorandom stream generation.
diff --git a/security/libaegis/pkg-plist b/security/libaegis/pkg-plist
new file mode 100644
index 000000000000..9dfddbf52f9b
--- /dev/null
+++ b/security/libaegis/pkg-plist
@@ -0,0 +1,12 @@
+include/aegis.h
+include/aegis128l.h
+include/aegis128x2.h
+include/aegis128x4.h
+include/aegis256.h
+include/aegis256x2.h
+include/aegis256x4.h
+lib/libaegis.a
+lib/libaegis.so
+share/cmake/aegis/aegis-config.cmake
+share/cmake/aegis/aegis-targets-%%CMAKE_BUILD_TYPE%%.cmake
+share/cmake/aegis/aegis-targets.cmake