aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorSharlatan Hellseher <sharlatanus@gmail.com>2024-09-09 12:40:44 +0100
committerSharlatan Hellseher <sharlatanus@gmail.com>2024-09-09 21:05:19 +0100
commitb4137cf2f33dab056076f25ab7686138c9f8a6b2 (patch)
tree807e17c020622091487d69673c2aa27b150bfd3a /gnu/packages
parent9fdf5961b2b2a115a7d8b2747c6b74dd8d2b17a5 (diff)
downloadguix-b4137cf2f33dab056076f25ab7686138c9f8a6b2.tar
guix-b4137cf2f33dab056076f25ab7686138c9f8a6b2.tar.gz
gnu: Add go-github-com-decred-dcrd-dcrec-secp256k1-v4.
* gnu/packages/golang-crypto.scm (go-github-com-decred-dcrd-dcrec-secp256k1-v4): New variable. Change-Id: Ibf57a9970c702bf95625e4145cf9630b0cb4d16c
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/golang-crypto.scm61
1 files changed, 61 insertions, 0 deletions
diff --git a/gnu/packages/golang-crypto.scm b/gnu/packages/golang-crypto.scm
index 35c84ea573..0d68e4b216 100644
--- a/gnu/packages/golang-crypto.scm
+++ b/gnu/packages/golang-crypto.scm
@@ -594,6 +594,67 @@ one-time authenticator as specified in
and AVX acceleration and zero allocations.")
(license license:isc)))
+(define-public go-github-com-decred-dcrd-dcrec-secp256k1-v4
+ (package
+ (name "go-github-com-decred-dcrd-dcrec-secp256k1-v4")
+ (version "4.3.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/decred/dcrd")
+ (commit (go-version->git-ref
+ ;; XXX: While waiting on consensus:
+ ;; - https://issues.guix.gnu.org/52362
+ ;; - https://issues.guix.gnu.org/63001
+ ;; - https://issues.guix.gnu.org/63647
+ ;; - https://issues.guix.gnu.org/69827
+ (string-append "dcrec/secp256k1/v" version)))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "19yqrrspm6n1x7wa1chqj0j95bc5w02ygddr06ajzf6x7i7q09q5"))
+ (modules '((guix build utils)))
+ (snippet
+ #~(begin
+ ;; Submodules with their own go.mod files and packed as separated
+ ;; packages. Delete any intersecting ones to prevent "Permission
+ ;; denied" when they are in use as inputs.
+ (for-each delete-file-recursively (list "crypto/blake256"))))))
+ (build-system go-build-system)
+ (arguments
+ (list
+ ;; It needs to be github.com/decred/dcrd/dcrec/secp256k1/v4
+ #:import-path "github.com/decred/dcrd/dcrec/secp256k1"
+ #:unpack-path "github.com/decred/dcrd"
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'install 'adjust-import-path
+ (lambda* (#:key import-path #:allow-other-keys)
+ (let* ((origin (string-append #$output "/src/" import-path) )
+ (tmp (string-append #$output "/src/" "_tmp"))
+ (import-path (string-append origin "/v4")))
+ (format #t "Adjusting paths: ~a~%~a~%~a~%" origin tmp import-path)
+ (mkdir tmp)
+ (copy-recursively origin tmp)
+ (delete-file-recursively origin)
+ (mkdir-p import-path)
+ (rename-file tmp import-path)))))))
+ (propagated-inputs
+ (list go-github-com-decred-dcrd-crypto-blake256))
+ (home-page "https://github.com/decred/dcrd")
+ (synopsis "Optimized secp256k1 elliptic curve operations")
+ (description
+ "This package provides an optimized pure Go implementation of elliptic
+curve cryptography operations over the secp256k1 curve as well as data
+structures and functions for working with public and private secp256k1 keys as
+cpecified in the @url{https://www.secg.org/sec2-v2.pdf} standard.
+
+In addition, sub packages are provided to produce, verify, parse, and
+serialize ECDSA signatures and EC-Schnorr-DCRv0 (a custom Schnorr-based
+signature scheme specific to Decred) signatures. See the README.md files in
+the relevant sub packages for more details about those aspects.")
+ (license license:isc)))
+
(define-public go-github-com-dgryski-go-farm
(package
(name "go-github-com-dgryski-go-farm")