2 # Copyright (C) 2009-2016 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
15 PKG_SOURCE_URL
:=https
://download.libsodium.org
/libsodium
/releases \
16 https
://github.com
/jedisct1
/libsodium
/releases
/download
/$(PKG_VERSION
)
17 PKG_HASH
:=b8648f1bb3a54b0251cf4ffa4f0d76ded13977d4fa7517d988f4c902dd8e2f95
19 PKG_FIXUP
:=libtool autoreconf
23 PKG_MAINTAINER
:=Damiano Renfer
<damiano.renfer@gmail.com
>
26 include $(INCLUDE_DIR
)/package.mk
28 define Package
/libsodium
31 TITLE
:=P
(ortable|ackageable
) NaCl-based crypto library
32 URL
:=https
://github.com
/jedisct1
/libsodium
33 MAINTAINER
:=Damiano Renfer
<damiano.renfer@gmail.com
>
36 define Package
/libsodium
/description
37 NaCl
(pronounced
"salt") is a new easy-to-use high-speed software library for network communication
, encryption
, decryption
, signatures
, etc.
38 NaCl
's goal is to provide all of the core operations needed to build higher-level cryptographic tools.
39 Sodium is a portable, cross-compilable, installable, packageable fork of NaCl (based on the latest released upstream version nacl-20110221), with a compatible API.
40 The design choices, particularly in regard to the Curve25519 Diffie-Hellman function, emphasize security (whereas NIST curves emphasize "performance" at the cost of security), and "magic constants" in NaCl/Sodium have clear rationales.
41 The same cannot be said of NIST curves, where the specific origins of certain constants are not described by the standards.
42 And despite the emphasis on higher security, primitives are faster across-the-board than most implementations of the NIST standards.
45 define Package/libsodium/config
47 depends on PACKAGE_libsodium
48 config LIBSODIUM_MINIMAL
49 bool "Compile only what is required for the high-level API (no aes128ctr), should be fine in most cases."
56 $(if $(CONFIG_LIBSODIUM_MINIMAL),--enable-minimal=yes,--enable-minimal=no)
58 define Build/InstallDev
59 $(INSTALL_DIR) $(1)/usr/include/sodium
60 $(CP) $(PKG_INSTALL_DIR)/usr/include/sodium.h $(1)/usr/include
61 $(CP) $(PKG_INSTALL_DIR)/usr/include/sodium/*.h $(1)/usr/include/sodium
62 $(INSTALL_DIR) $(1)/usr/lib
63 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsodium.{a,so*} $(1)/usr/lib
64 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
65 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libsodium.pc $(1)/usr/lib/pkgconfig/
68 define Package/libsodium/install
69 $(INSTALL_DIR) $(1)/usr/lib
70 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsodium.so.* $(1)/usr/lib/
73 $(eval $(call BuildPackage,libsodium))