gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-scheme] 01/08: WIP new construct + analyse


From: gnunet
Subject: [gnunet-scheme] 01/08: WIP new construct + analyse
Date: Thu, 09 Feb 2023 15:47:58 +0100

This is an automated email from the git hooks/post-receive script.

maxime-devos pushed a commit to branch master
in repository gnunet-scheme.

commit 918c2fac18355c2fe30d7c2e064f27af76e1bf36
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Tue Jan 10 01:52:11 2023 +0100

    WIP new construct + analyse
---
 gnu/gnunet/fs/network.scm | 36 +++++++++++++++++++++++++++++++++---
 gnu/gnunet/fs/struct.scm  |  2 +-
 2 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/gnu/gnunet/fs/network.scm b/gnu/gnunet/fs/network.scm
index 8de63c0..904a47e 100644
--- a/gnu/gnunet/fs/network.scm
+++ b/gnu/gnunet/fs/network.scm
@@ -1,6 +1,6 @@
 ;#!r6rs
 ;; This file is part of Scheme-GNUnet
-;; Copyright © 2022 GNUnet e.V.
+;; Copyright © 2022, 2023 GNUnet e.V.
 ;;
 ;; Scheme-GNUnet is free software: you can redistribute it and/or modify it
 ;; under the terms of the GNU Affero General Public License as published
@@ -19,13 +19,15 @@
 
 ;; TODO: untested
 (define-library (gnu gnunet fs network)
-  (export construct-request-loc-signature analyse-request-loc-signature)
+  (export construct-request-loc-signature analyse-request-loc-signature
+         construct-response-loc-signature analyse-response-loc-signature)
   (import (only (rnrs base) define values)
          (only (guile) begin define*)
          (only (gnu extractor enum) value->index symbol-value)
          (only (gnu gnunet message protocols) message-type)
          (only (gnu gnunet fs struct)
-               /content-hash-key /:msg:fs:request-loc-signature)
+               /content-hash-key /:msg:fs:request-loc-signature
+               /:msg:fs:response-loc-signature)
          (only (gnu gnunet fs uri)
                content-hash-key-key ;; TODO rename
                content-hash-key-query
@@ -72,4 +74,32 @@ message @var{message}."
       (values (r% file-length)
              (make-content-hash-key/share (s% content-hash-key))
              (r% expiration-time)
+             (r% purpose)))
+
+    (define*
+      (construct-response-loc-signature expiration-time signature peer
+                                       #:key (purpose %purpose-peer-placement))
+      "Create a new @code{/:msg:fs:response-loc-signature} message, for an 
EdDSA signature
+@var{signature} (as a readable @code{/eddsa-signature} bytevector slice) by 
@var{peer}
+(as a readable @code{/peer-identity} bytevector slice), expiring at 
@var{expiration-time}
+(TODO type)."
+      (construct
+       /:msg:fs:response-loc-signature
+       (=>! (header size) (%sizeof))
+       (=>! (header type)
+           (value->index
+            (symbol-value message-type msg:fs:response-loc-signature)))
+       (=>! (purpose) purpose)
+       (=>! (expiration-time) expiration-time)
+       (=>slice! (signature) signature)
+       (=>slice! (peer) peer)))
+
+    (define-analyser analyse-response-loc-signature
+      /:msg:fs:response-loc-signature
+      "Return the expiration time (TODO type), signature (as a slice of the 
message),
+peer identity (as a slice of the message) and the signature purpose 
corresponding to
+the @code{/:msg:fs:response-loc-signature} message."
+      (values (r% expiration-time)
+             (s% signature)
+             (s% peer)
              (r% purpose)))))
diff --git a/gnu/gnunet/fs/struct.scm b/gnu/gnunet/fs/struct.scm
index 12e9874..e9f550b 100644
--- a/gnu/gnunet/fs/struct.scm
+++ b/gnu/gnunet/fs/struct.scm
@@ -1,5 +1,5 @@
 ;; This file is part of Scheme-GNUnet.
-;; Copyright © 2003--2012, 2022 GNUnet e.V.
+;; Copyright © 2003--2012, 2022--2023 GNUnet e.V.
 ;;
 ;; Scheme-GNUnet is free software: you can redistribute it and/or modify it
 ;; under the terms of the GNU Affero General Public License as published

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]