-
Notifications
You must be signed in to change notification settings - Fork 0
/
gluecose-schema.cddl
95 lines (81 loc) · 2.26 KB
/
gluecose-schema.cddl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
start = TestCaseInput / TestCaseOutput
TestCaseInput = {
uuid: text ; unique identifier for the test case
title: text
description: text
key: JWK
alg: COSEAlgo
operation
}
; tag #6.18
operation //= ( "sign1::sign" => Sign1_sign )
operation //= ( "sign1::verify" => Sign1_verify )
;; tag #6.98
; operation //= ( "sign::sign" => TODO )
; operation //= ( "sign::verify" => TODO )
;; tag #6.96
; operation //= ( "encrypt::encrypt" => TODO )
; operation //= ( "encrypt::decrypt" => TODO )
;; tag #6.16
; operation //= ( "encrypt0::encrypt" => TODO )
; operation //= ( "encrypt0::decrypt" => TODO )
;; tag #6.97
; operation //= ( "mac::mac" => TODO )
; operation //= ( "mac::verify" => TODO )
;; tag #6.17
; operation //= ( "mac0::mac" => TODO )
; operation //= ( "mac0::verify" => TODO )
; TODO = "todo"
Sign1_sign = {
payload: HexString
? protectedHeaders: CBORBlob
? unprotectedHeaders: CBORBlob
? external: HexString ; externally supplied data
? detached: bool .default false
tbsHex: CBORBlob ; CBOR encoded Sig_structure
expectedOutput: CBORBlob
fixedOutputLength: uint ; used only for non-deterministic testers
}
Sign1_verify = {
taggedCOSESign1: CBORBlob ; tagged COSE Sign1
? external: HexString ; optional external data
; optional detached payload (only present if payload==nil in taggedCOSESign1)
? detachedPayload: HexString
shouldVerify: bool ; whether a successful validation is expected
}
CBORBlob = {
cborHex: HexString ; base16 encoded byte buffer
? cborDiag: text ; optional string containing the CBOR diagnostic
; representation of cborHex
}
HexString = text .regexp "([a-f0-9]{2})+"
; See https://www.iana.org/assignments/cose/cose.xhtml#algorithms
COSEAlgo /= "ES256"
COSEAlgo /= "ES384"
COSEAlgo /= "ES512"
COSEAlgo /= "PS256"
COSEAlgo /= "PS384"
COSEAlgo /= "PS512"
; COSEAlgo /= TODO
JWK = {
+ text => text
}
TestCaseOutput = {
uuid: text ; unique identifier for the test case
implementation: Implementation
executionTs: text ; RFC3339 date-time
result: Result
}
Result /= "pass"
Result /= "skip"
Result /= "fail"
Implementation = {
name: text
version: text
author: [ + text ]
homepage: text
license: text
sourceLang: [ + text ]
? targetLang: [ + text ]
deterministic: bool
}