Wed Nov 4 20:32:18 2020 UTC ()
Add security/libsecp256k1

This is required for newer versions of finance/electrum.

Optimized C library for ECDSA signatures and secret/public key operations on
curve secp256k1.

This library is intended to be the highest quality publicly available library
for cryptography on the secp256k1 curve. However, the primary focus of its
development has been for usage in the Bitcoin system and usage unlike Bitcoin's
may be less well tested, verified, or suffer from a less well thought out
interface. Correct usage requires some care and consideration that the library
is fit for your application's purpose.

Features:
* secp256k1 ECDSA signing/verification and key generation.
* Additive and multiplicative tweaking of secret/public keys.
* Serialization/parsing of secret keys, public keys, signatures.
* Constant time, constant memory access signing and public key generation.
* Derandomized ECDSA (via RFC6979 or with a caller provided function.)
* Very efficient implementation.
* Suitable for embedded systems.
* Optional module for public key recovery.
* Optional module for ECDH key exchange.

Experimental features have not received enough scrutiny to satisfy the standard
of quality of this library but are made available for testing and review by the
community. The APIs of these features should not be considered stable.


(js)
diff -r0 -r1.1 pkgsrc/security/libsecp256k1/DESCR
diff -r0 -r1.1 pkgsrc/security/libsecp256k1/Makefile
diff -r0 -r1.1 pkgsrc/security/libsecp256k1/PLIST
diff -r0 -r1.1 pkgsrc/security/libsecp256k1/distinfo
diff -r0 -r1.1 pkgsrc/security/libsecp256k1/patches/patch-configure.ac

File Added: pkgsrc/security/libsecp256k1/DESCR
Optimized C library for ECDSA signatures and secret/public key operations on
curve secp256k1.

This library is intended to be the highest quality publicly available library
for cryptography on the secp256k1 curve. However, the primary focus of its
development has been for usage in the Bitcoin system and usage unlike Bitcoin's
may be less well tested, verified, or suffer from a less well thought out
interface. Correct usage requires some care and consideration that the library
is fit for your application's purpose.

Features:
* secp256k1 ECDSA signing/verification and key generation.
* Additive and multiplicative tweaking of secret/public keys.
* Serialization/parsing of secret keys, public keys, signatures.
* Constant time, constant memory access signing and public key generation.
* Derandomized ECDSA (via RFC6979 or with a caller provided function.)
* Very efficient implementation.
* Suitable for embedded systems.
* Optional module for public key recovery.
* Optional module for ECDH key exchange.

Experimental features have not received enough scrutiny to satisfy the standard
of quality of this library but are made available for testing and review by the
community. The APIs of these features should not be considered stable.

File Added: pkgsrc/security/libsecp256k1/Makefile
# $NetBSD: Makefile,v 1.1 2020/11/04 20:32:18 js Exp $

GITHUB_PROJECT=	secp256k1
GITHUB_TAG=	ac05f61fcf639a15b5101131561620303e4bd808
DISTNAME=	libsecp256k1-0.1
CATEGORIES=	security
MASTER_SITES=	${MASTER_SITE_GITHUB:=bitcoin-core/}

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	https://github.com/bitcoin-core/secp256k1/
COMMENT=	Optimized C library for EC operations on curve secp256k1
LICENSE=	mit

WRKSRC=		${WRKDIR}/secp256k1-${GITHUB_TAG}
GNU_CONFIGURE=	yes
USE_TOOLS+=	autoconf automake gmake pkg-config
USE_LIBTOOL=	yes

# Inspired by the configure flags ArchLinux uses
CONFIGURE_ARGS+=	--disable-static
CONFIGURE_ARGS+=	--disable-benchmark
CONFIGURE_ARGS+=	--disable-coverage
CONFIGURE_ARGS+=	--enable-module-ecdh
CONFIGURE_ARGS+=	--enable-module-recovery

PKGCONFIG_OVERRIDE+=	libsecp256k1.pc.in

pre-configure:
	cd ${WRKSRC} && ./autogen.sh

.include "../../mk/bsd.pkg.mk"

File Added: pkgsrc/security/libsecp256k1/PLIST
@comment $NetBSD: PLIST,v 1.1 2020/11/04 20:32:18 js Exp $
include/secp256k1.h
include/secp256k1_ecdh.h
include/secp256k1_preallocated.h
include/secp256k1_recovery.h
lib/libsecp256k1.la
lib/pkgconfig/libsecp256k1.pc

File Added: pkgsrc/security/libsecp256k1/distinfo
$NetBSD: distinfo,v 1.1 2020/11/04 20:32:18 js Exp $

SHA1 (libsecp256k1-0.1-ac05f61fcf639a15b5101131561620303e4bd808.tar.gz) = 2062042945e007c7f1c6b42c2574fb6bb890b6c7
RMD160 (libsecp256k1-0.1-ac05f61fcf639a15b5101131561620303e4bd808.tar.gz) = 6310ebf1c3fb27eae77b3345259d3b96c8520812
SHA512 (libsecp256k1-0.1-ac05f61fcf639a15b5101131561620303e4bd808.tar.gz) = 156ce5638a2bf15c35d20bd21fea3073f5a7374a9279504310ae299c7fd7577bed87047a62e05054e064d29764551fca8835898d0ad50479eebf48694244afe4
Size (libsecp256k1-0.1-ac05f61fcf639a15b5101131561620303e4bd808.tar.gz) = 199733 bytes
SHA1 (patch-configure.ac) = e35317c6db9ad230f2997a1e07127c1dcbbdf50e

File Added: pkgsrc/security/libsecp256k1/patches/patch-configure.ac
$NetBSD: patch-configure.ac,v 1.1 2020/11/04 20:32:18 js Exp $

Don't check for homebrew and MacPorts.

--- configure.ac.orig	2020-10-21 08:00:28.000000000 +0000
+++ configure.ac
@@ -32,39 +32,6 @@ if test x"$ac_cv_prog_cc_c89" = x"no"; t
 fi
 AM_PROG_AS
 
-case $host_os in
-  *darwin*)
-     if  test x$cross_compiling != xyes; then
-       AC_PATH_PROG([BREW],brew,)
-       if test x$BREW != x; then
-         dnl These Homebrew packages may be keg-only, meaning that they won't be found
-         dnl in expected paths because they may conflict with system files. Ask
-         dnl Homebrew where each one is located, then adjust paths accordingly.
-
-         openssl_prefix=`$BREW --prefix openssl 2>/dev/null`
-         gmp_prefix=`$BREW --prefix gmp 2>/dev/null`
-         if test x$openssl_prefix != x; then
-           PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
-           export PKG_CONFIG_PATH
-           CRYPTO_CPPFLAGS="-I$openssl_prefix/include"
-         fi
-         if test x$gmp_prefix != x; then
-           GMP_CPPFLAGS="-I$gmp_prefix/include"
-           GMP_LIBS="-L$gmp_prefix/lib"
-         fi
-       else
-         AC_PATH_PROG([PORT],port,)
-         dnl if homebrew isn't installed and macports is, add the macports default paths
-         dnl as a last resort.
-         if test x$PORT != x; then
-           CPPFLAGS="$CPPFLAGS -isystem /opt/local/include"
-           LDFLAGS="$LDFLAGS -L/opt/local/lib"
-         fi
-       fi
-     fi
-   ;;
-esac
-
 CFLAGS="-W $CFLAGS"
 
 warn_CFLAGS="-std=c89 -pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wundef -Wno-unused-function -Wno-long-long -Wno-overlength-strings"