Skip to content

Commit 9923ff5

Browse files
committed
Apply apply-all
1 parent 37126a8 commit 9923ff5

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

prototype.lisp

+4-11
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,7 @@
211211

212212
(defclass document () ((pk :reader pk :initarg :pk)))
213213
(defun make-document (hdk doc salt index)
214-
(make-instance 'document
215-
:pk (blind-public-key (bl hdk)
216-
(pk doc)
217-
(derive-blind-key (bl hdk) salt)
218-
(create-context hdk index))))
214+
(make-instance 'document :pk (apply-all hdk index (pk doc) salt)))
219215

220216
(defclass app ()
221217
((hdk :reader hdk :initarg :hdk)
@@ -242,12 +238,9 @@
242238
(nth-value 2 (fold-hdk app hdk))))
243239
(defun accept-key (app hdk kh index pk-expected)
244240
(let* ((salt (decap (kem (hdk app)) kh (delegate-key-creation app hdk)))
245-
(pk-bl (get-key-info app hdk))
246-
(bk (derive-blind-key (bl (hdk app)) salt))
247-
(ctx (create-context (hdk app) index)))
248-
(let ((pk-blinded (blind-public-key (bl (hdk app)) pk-bl bk ctx)))
249-
(assert (crypto:ec-point-equal pk-expected pk-blinded)))
250-
(append hdk (list kh index))))
241+
(pk (apply-all (hdk app) index (get-key-info app hdk) salt)))
242+
(assert (crypto:ec-point-equal pk-expected pk)))
243+
(append hdk (list kh index)))
251244

252245
(defconstant +hdk-root+ '(0))
253246
(defclass unit ()

0 commit comments

Comments
 (0)