aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpukkamustard <pukkamustard@posteo.net>2020-11-30 08:31:43 +0100
committerpukkamustard <pukkamustard@posteo.net>2020-11-30 08:31:43 +0100
commita4703630efd1710da91d8bf36cf0a98780bf9406 (patch)
treeef2bd6c32ef6fb003a94b78be9ae7a355087993f
parent7f69176d585d7702ca3a7e5a67f2920a52906356 (diff)
update to guile-sodium 0.1.0
-rw-r--r--eris/decode.scm2
-rw-r--r--eris/encode.scm2
-rw-r--r--eris/utils/padding.scm6
-rw-r--r--guix.scm18
-rw-r--r--tests/eris/large.scm2
-rw-r--r--tests/eris/pseudo-random.scm6
6 files changed, 19 insertions, 17 deletions
diff --git a/eris/decode.scm b/eris/decode.scm
index 25b4845..0f8ddaf 100644
--- a/eris/decode.scm
+++ b/eris/decode.scm
@@ -29,7 +29,7 @@
(define (tree-reduce reducer init ref key level block-ref)
(let
;; get block and decrypt
- ((block (crypto-stream-chacha20-ietf-xor (block-ref ref) null-nonce key)))
+ ((block (crypto-stream-chacha20-ietf-xor #:message (block-ref ref) #:nonce null-nonce #:key key)))
(if (= 0 level)
;; if ref-key is at level 0 then the block is a data block, reduce
diff --git a/eris/encode.scm b/eris/encode.scm
index 8078aee..87ed957 100644
--- a/eris/encode.scm
+++ b/eris/encode.scm
@@ -35,7 +35,7 @@
(let* ( ;; key is the hash of the block with convergence-secret
(key (crypto-generichash unencrypted-block #:key convergence-secret #:out-len 32))
;; encrypt the content (using the null-nonce)
- (block (crypto-stream-chacha20-ietf-xor unencrypted-block null-nonce key))
+ (block (crypto-stream-chacha20-ietf-xor #:message unencrypted-block #:nonce null-nonce #:key key))
;; hash to reference the encrypted block. Note that this does not use
;; the convergence secret.
(ref (crypto-generichash block #:out-len 32)))
diff --git a/eris/utils/padding.scm b/eris/utils/padding.scm
index ef91f2c..672784c 100644
--- a/eris/utils/padding.scm
+++ b/eris/utils/padding.scm
@@ -23,10 +23,10 @@
((result)
(if (nil? prev)
;; no previous block - reduce a padded empty bytevector
- (reducer (reducer result (sodium-pad (make-bytevector 0) block-size)))
+ (reducer (reducer result (sodium-pad (make-bytevector 0) #:block-size block-size)))
;; pad the prev block
- (let ((padded (sodium-pad prev block-size)))
+ (let ((padded (sodium-pad prev #:block-size block-size)))
;; padding may result in a bytevector of size 2*block-size
(if (equal? (bytevector-length padded) block-size)
;; no extra block was created
@@ -64,7 +64,7 @@
(reducer result)
;; unpad the last block (prev) and reduce
- (reducer (reducer result (sodium-unpad prev block-size)))))
+ (reducer (reducer result (sodium-unpad prev #:block-size block-size)))))
;; handle input
((result block)
diff --git a/guix.scm b/guix.scm
index 6314f37..1ebbfe0 100644
--- a/guix.scm
+++ b/guix.scm
@@ -22,15 +22,15 @@
(define-public guile-sodium
(package
(name "guile-sodium")
- (version "0.1")
+ (version "0.1.0")
(source
(origin
(method git-fetch)
(uri (git-reference
- (url "https://gitlab.com/openengiadina/guile-sodium")
- (commit "08912f414d76db34f4a12eae47b00e59c81137e5")))
+ (url "https://inqlab.net/git/guile-sodium.git")
+ (commit "1375d8254fb1418432e0823f9130afae0f98152e")))
(file-name (git-file-name name version))
- (sha256 (base32 "1bydnqvch2aica8p52c0ff9da1cg1x1wp4gzc1fwbkc0nw986spw"))))
+ (sha256 (base32 "1y41l9pphhwkklrdqzp65vzbnww1z6s7ggxvgs7k68xlgiy7agbd"))))
(build-system gnu-build-system)
(arguments `())
(native-inputs
@@ -40,11 +40,13 @@
("texinfo" ,texinfo)))
(inputs `(("guile" ,guile-3.0)))
(propagated-inputs `(("libsodium" ,libsodium)))
- (synopsis "Guile bindings to libsodium.)")
+
+ (synopsis "Guile bindings to the libsodium cryptographic library.")
(description
- "This package provides bindings to libsodium which provides core cryptogrpahic primitives needed to build higher-level tools.")
- (home-page
- "https://gitlab.com/openengiadina/guile-sodium")
+ "This package provides Guile bindings to the libsodium cryptographic library
+which provides core cryptographic primitives needed to build higher-level
+tools.")
+ (home-page "https://inqlab.net/git/guile-sodium.git")
(license license:gpl3+)))
(package
diff --git a/tests/eris/large.scm b/tests/eris/large.scm
index 14380a7..9c2e535 100644
--- a/tests/eris/large.scm
+++ b/tests/eris/large.scm
@@ -22,7 +22,7 @@
;; Internal block size of ChaCha20 is 64 bytes, increment by ic-increment every invocation
(ic-increment (/ block-size 64)))
(lambda ()
- (let ((c (crypto-stream-chacha20-ietf-xor-ic message nonce ic key)))
+ (let ((c (crypto-stream-chacha20-ietf-xor-ic #:message message #:nonce nonce #:ic ic #:key key)))
(set! ic (+ ic ic-increment))
c))))
diff --git a/tests/eris/pseudo-random.scm b/tests/eris/pseudo-random.scm
index 6a09b49..6b6205f 100644
--- a/tests/eris/pseudo-random.scm
+++ b/tests/eris/pseudo-random.scm
@@ -20,9 +20,9 @@
(define null-convergence-secret (make-bytevector 32 0))
(define* (pseudo-random-bytevector length #:key (seed "Encoding for Robust Immutable Storage"))
- (crypto-stream-chacha20-ietf length
- null-nonce
- (crypto-generichash (string->utf8 seed) #:out-len 32)))
+ (crypto-stream-chacha20-ietf #:clen length
+ #:nonce null-nonce
+ #:key (crypto-generichash (string->utf8 seed) #:out-len 32)))
(define content-sizes-small
(list 0
1