summaryrefslogtreecommitdiff
path: root/src/eris.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/eris.lisp')
-rw-r--r--src/eris.lisp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/eris.lisp b/src/eris.lisp
index c3bbe5f..b30c6a4 100644
--- a/src/eris.lisp
+++ b/src/eris.lisp
@@ -42,12 +42,10 @@
(replace buf (reference pair) :start1 start)
(replace buf (key pair) :start1 (+ 32 start)))
-(defun octets-to-reference-pair (octets)
- (let ((key (make-array 32 :element-type '(unsigned-byte 8)))
- (reference (make-array 32 :element-type '(unsigned-byte 8))))
- (replace reference octets)
- (replace key octets :start2 32)
- (make-instance 'reference-pair :key key :reference reference)))
+(defun octets-to-reference-pair (octets &optional (start 0))
+ (declare (type (simple-array (unsigned-byte 8)) octets))
+ (make-instance 'reference-pair :key (subseq octets (+ 32 start) (+ 64 start))
+ :reference (subseq octets start (+ 32 start))))
(defun compute-reference (block)
@@ -124,7 +122,7 @@
(setf (level capability)
(aref octets 1))
(setf (reference-pair capability)
- (octets-to-reference-pair (subseq-shared octets 2)))
+ (octets-to-reference-pair octets 2))
capability))
(defun read-capability-to-urn (capability)