Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
netfarm
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hayley Patton
netfarm
Commits
fef764d7
Commit
fef764d7
authored
Apr 07, 2020
by
Hayley Patton
🐢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure everything puts out simple arrays, pipe binary renderer directly to Ironclad
parent
545019d4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
+15
-5
Code/Codecs/codecs.lisp
Code/Codecs/codecs.lisp
+8
-2
Code/Crypto/hash.lisp
Code/Crypto/hash.lisp
+6
-2
Code/Scripts/Script-machine/assemble.lisp
Code/Scripts/Script-machine/assemble.lisp
+1
-1
No files found.
Code/Codecs/codecs.lisp
View file @
fef764d7
...
...
@@ -40,14 +40,20 @@
:external-format
*encoding*
)))
(
define-codec
base64-data
#'
bytes->base64
#'
base64->bytes
)
#'
bytes->base64
(
lambda
(
string
)
(
let*
((
bytes*
(
base64->bytes
string
))
(
length
(
length
bytes*
)))
(
coerce
(
subseq
bytes*
0
length
)
'
(
vector
(
unsigned-byte
8
))))))
(
define-codec
ref
(
lambda
(
reference
)
(
check-type
reference
reference
)
(
bytes->base64
(
reference-hash
reference
)))
(
lambda
(
string
)
(
make-instance
'reference
:hash
(
base64->bytes
string
))))
(
make-instance
'reference
:hash
(
coerce
(
subseq
(
base64->bytes
string
)
0
32
)
'
(
vector
(
unsigned-byte
8
))))))
(
defun
find-codec
(
name
type
)
(
let
((
codec-definition
(
gethash
name
*codecs*
)))
...
...
Code/Crypto/hash.lisp
View file @
fef764d7
...
...
@@ -9,8 +9,12 @@
'
(
vector
(
unsigned-byte
8
)))))
(
defun
base-hash-object
(
object
&key
(
emit-signatures
t
))
(
hash-bytes
(
binary-render-object
object
:emit-signatures
emit-signatures
:emit-computed-values
nil
)))
(
let
((
digest
(
make-digest
:sha256
)))
(
binary-render-object
object
:emit-signatures
emit-signatures
:emit-computed-values
nil
:function
(
lambda
(
vector
)
(
update-digest
digest
vector
)))
(
produce-digest
digest
)))
(
defgeneric
hash-object
(
object
)
(
:documentation
"Generate a hash for an object, including its signatures but not computed values."
)
...
...
Code/Scripts/Script-machine/assemble.lisp
View file @
fef764d7
...
...
@@ -29,4 +29,4 @@
(
coerce
(
loop
for
instruction
in
code
append
(
assemble-instruction
instruction
))
'
vector
))
'
(
vector
(
unsigned-byte
8
))
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment