Subject: [PATCH go-team 2/6] gnu: Add go-github-com-google-go-tpm.

From: Rodion Goritskov <[email-masked]>
Date: Wed, 1 May 2024 00:42:42 +0400

* gnu/packages/golang-crypto.scm (go-github-com-google-go-tpm-legacy-tpm2): New variable.
* gnu/packages/golang-crypto.scm (go-github-com-google-go-tpm-tpmutil): New variable.

Change-Id: Ib7b640dcb4ea6b87fca1d320f044315620f7e5f3
---
 gnu/packages/golang-crypto.scm | 51 ++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/gnu/packages/golang-crypto.scm b/gnu/packages/golang-crypto.scm
index 53ae308219..584755dc70 100644
--- a/gnu/packages/golang-crypto.scm
+++ b/gnu/packages/golang-crypto.scm
@@ -473,6 +473,57 @@ (define-public go-github-com-golang-jwt-jwt-v5
       #:go go-1.18
       #:import-path "github.com/golang-jwt/jwt/v5"))))
 
+(define-public go-github-com-google-go-tpm-legacy-tpm2
+  (package
+    (name "go-github-com-google-go-tpm-legacy-tpm2")
+    (version "0.9.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/google/go-tpm")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1pv77fmlxrnxasj6fjvzrv9yaf2qb45x1zss3nbsdvzgpwviaiyi"))))
+    (build-system go-build-system)
+    (arguments
+     (list
+      #:unpack-path "github.com/google/go-tpm"
+      #:import-path "github.com/google/go-tpm/legacy/tpm2"))
+    (propagated-inputs (list go-golang-org-x-sys))
+    (home-page "https://github.com/google/go-tpm")
+    (synopsis "Go-TPM Legacy TPM 2.0 library")
+    (description
+     "Legacy TPM 2.0 library for directly communicating with a TPM device.")
+    (license license:asl2.0)))
+
+(define-public go-github-com-google-go-tpm-tpmutil
+  (package
+    (name "go-github-com-google-go-tpm-tpmutil")
+    (version "0.9.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/google/go-tpm")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1pv77fmlxrnxasj6fjvzrv9yaf2qb45x1zss3nbsdvzgpwviaiyi"))))
+    (build-system go-build-system)
+    (arguments
+     (list
+      #:unpack-path "github.com/google/go-tpm"
+      #:import-path "github.com/google/go-tpm/tpmutil"))
+    (propagated-inputs (list go-golang-org-x-sys))
+    (home-page "https://github.com/google/go-tpm")
+    (synopsis "Go-TPM TPM util")
+    (description
+     "Useful utilities for a Go-TPM library
+that communicates directly with a TPM device.")
+    (license license:asl2.0)))
+
 (define-public go-github-com-gxed-hashland-keccakpg
   (let ((commit "d9f6b97f8db22dd1e090fd0bbbe98f09cc7dd0a8")
         (revision "0"))
-- 
2.41.0