summaryrefslogtreecommitdiff
path: root/src/eris.lisp
diff options
context:
space:
mode:
authorPiotr Szarmanski2022-11-20 21:47:23 +0100
committerPiotr Szarmanski2022-11-20 21:47:23 +0100
commit618ee634557122b3b3c5012405603b28c0001d13 (patch)
treedf84a7dab310a90ca24ff63267ceb123fcdd2428 /src/eris.lisp
parent4dc0b96bd101f34092a3ff5cd5864fc8fe7830c1 (diff)
Fix some compilation warnings
Diffstat (limited to 'src/eris.lisp')
-rw-r--r--src/eris.lisp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/eris.lisp b/src/eris.lisp
index ed4a05e..91200a1 100644
--- a/src/eris.lisp
+++ b/src/eris.lisp
@@ -70,7 +70,7 @@ object, using the bytes from the OCTETS vector from at START."
(make-instance 'reference-pair :key key :reference reference)))
(defun encrypt-internal-block (input reference nonce)
- (declare (type octet-vector input secret reference))
+ (declare (type octet-vector input reference))
(let ((key (make-array 32 :element-type 'octet)))
(ironclad:digest-sequence :blake2/256 input :digest key)
;; NOT the IETF chacha. Need to fix this by patching ironclad. Maybe.
@@ -109,10 +109,13 @@ a (simple-array (unsigned-byte 8)) object."
(setf (aref cap 1) (level read-capability))
(reference-pair-to-octets (reference-pair read-capability) cap 2)))
-(-> octets-to-read-capability ((octet-vector 66)) read-capability)
+(-> octets-to-read-capability ((octet-vector 66)) (values read-capability &optional))
(defun octets-to-read-capability (octets)
"Convert the standard binary representation for ERIS read capabilities into a
-read-capability object. Returns the read-capability."
+read-capability object. Returns the read-capability.
+
+An ERIS:VERSION-MISMATCH condition may be signaled if the corresponding
+versioning bytes are not supported by eris-cl."
(declare (type (octet-vector 66) octets))
(let ((capability (make-instance 'read-capability)))
(setf (block-size capability)
@@ -134,7 +137,7 @@ read-capability object. Returns the read-capability."
"urn:eris:"
(bytes-to-base32-unpadded (read-capability-to-octets capability))))
-(-> urn-to-read-capability (string) read-capability)
+(-> urn-to-read-capability (string) (values read-capability &optional))
(defun urn-to-read-capability (urn)
"Convert a urn:eris URN string into a read-capability object."
(declare (type string urn))
@@ -146,7 +149,7 @@ read-capability object. Returns the read-capability."
(declare (type (octet-vector 32) reference))
(concatenate 'string "urn:blake2b:" (bytes-to-base32-unpadded reference)))
-(-> block-urn-to-reference (string) (octet-vector 32))
+(-> block-urn-to-reference (string) (values (octet-vector 32) &optional))
(defun block-urn-to-reference (urn)
"Convert a urn:blake2b URN string into a 32-byte block reference vector."
(declare (type string urn))
@@ -220,6 +223,7 @@ guarantee that a reference is only output once."))
(eris-create-tree reference-vector block-size output-function :hash-output hash-output)))
(defmethod eris-encode ((input stream) block-size output-function &key (secret null-secret) hash-output)
+ "This method does not handle any IO related conditions."
(declare (type block-size block-size)
(type function output-function)
(type (octet-vector 32) secret))
@@ -236,8 +240,7 @@ guarantee that a reference is only output once."))
(defun eris-create-tree (reference-vector block-size output-function &key hash-output)
(declare (type block-size block-size)
- (type function output-function)
- (type (octet-vector 32) secret))
+ (type function output-function))
(loop with block-keys = (/ block-size 64)
with level = 0
with reference-vector-l = (make-array 16 :adjustable t :fill-pointer 0)