]> Cypherpunks repositories - keks.git/commitdiff
Explicitly check type of the root element
authorSergey Matveev <stargrave@stargrave.org>
Sat, 28 Jun 2025 09:16:37 +0000 (12:16 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 28 Jun 2025 09:18:22 +0000 (12:18 +0300)
spec/schema/cmds
spec/schema/tcl
tcl/schemas/encrypted.tcl
tcl/schemas/kem-balloon-blake2b-hkdf.tcl
tcl/schemas/kem-gost3410-hkdf.tcl
tcl/schemas/kem-pbkdf2.tcl
tcl/schemas/kem-with-encap.tcl
tcl/schemas/prehash.tcl
tcl/schemas/pub.tcl
tcl/schemas/signed.tcl

index f5f6574a026c614de41900e64eb5b529cbfc8080d85e9b30163270237605c0ca..02850941d5bbb72215c08d4fe73e00e0470fe505d069c35882fcf4d8b4a4a800 100644 (file)
@@ -86,6 +86,7 @@ For example let's check "our" structure, described in CDDL as:
 Corresponding schema can be:
 
     {"our": [
+        ["T", "M"],
         [".", "a"],
         ["E"],
         ["T", "S"],
index 1eb0c2ee31543def19ca9d927c77f07355b08ff7af2f0355f2e341134dc90599..885d1ece671817d9686dbe39916e583b881554e285f592509295999591e88943 100644 (file)
@@ -8,6 +8,7 @@ Example with "our" structure (from [schema/cmds]) can be written as:
     ai {{field . {str} >0}}
     fpr {{field . {bin} len=32}}
     our {
+        {field . {map}}
         {field a {with ai}}
         {field v {bin str}}
         {field fpr {with fpr}}
@@ -37,7 +38,7 @@ an encoded map with "cmds*" commands for "s*" schemas.
 
 "field" command helps creation of commands related to the field.
 
-    {field N {T} [optional] [!exists] [{of type T}] [{of S}]
+    {field N {T ...} [optional] [!exists] [{of type T}] [{of S}]
         [>n] [<n] [len=n] [=v] [prec=p] [utc]}
 
 "N" required argument is the name of the field to consider. Either it is
index 4fae3b71c231284511eb9c623c8a7cf3a6210a440d7183a039e43886850990cb..a92e1893e7f1f66c7987c5d8928d23ac149d1a63b0c3aee3acd98f0fd3c1b13b 100644 (file)
@@ -1,4 +1,5 @@
 encrypted {
+    {field . {map}}
     {field dem {with dem}}
     {field kem {list} {of kem} >0}
     {field id {hexlet} optional}
@@ -14,6 +15,7 @@ dem {
 }
 
 kem {
+    {field . {map}}
     {field a {str} >0}
     {field cek {bin} >0}
 }
index 287b13700681cdef207f53c0725f62989a69e53aa902a02a328244821651cbf9..4e9ce08de76ccc5409c86a89667a94c6cc968bf26024b33499263bddbb514ca3 100644 (file)
@@ -1,10 +1,12 @@
 balloon-cost {
+    {field . {map}}
     {field s {int} >0} {# space cost}
     {field t {int} >0} {# time cost}
     {field p {int} >0} {# parallel cost}
 }
 
 kem-balloon-blake2b-hkdf {
+    {field . {map}}
     {field a {str} =balloon-blake2b-hkdf}
     {field cek {bin} >0} {# wrapped CEK}
     {field salt {bin} >0}
index 8cce4ece5af7cbed73f9cebd1cef2b76bd31bdff6790ab86365ce54ba24f69fc..e68a721f53e8d8f82b662b16ff99cfe381dc2a4b1c3bea66c1a56da1799e6b12 100644 (file)
@@ -1,4 +1,5 @@
 kem-gost3410-hkdf {
+    {field . {map}}
     {field a {str} =gost3410-hkdf}
     {field cek {bin} >0} {# wrapped CEK}
     {field ukm {bin} len=16} {# additional keying material}
index bf8392f97bc1744973fb3d3720d38e47c6d4349daf0a88591d83ec08ae87c872..fee50e7e32be6a7a6cdd9a6bbecdf7fe8f8581a7dfc167f0b053121807dff1ec 100644 (file)
@@ -1,4 +1,5 @@
 kem-pbkdf2 {
+    {field . {map}}
     {field a {str} =pbkdf2}
     {field cek {bin} >0} {# wrapped CEK}
     {field hash {str} >0} {# hash algorithm identifier}
index 0d43e0cab69c60be671857f8587f73c091a101635002271103643e0637649e57..0db2b689eb418b2657268c340f8733c4cfce0be3969837ce430018bd469ca8f1 100644 (file)
@@ -1,4 +1,5 @@
 kem-with-encap {
+    {field . {map}}
     {field a {str} >0} {# sntrup761-x25519-hkdf-blake2b}
                        {# mceliece6960119-x25519-hkdf-shake256}
     {field cek {bin} >0} {# wrapped CEK}
index 312b92cb4f2b28beada5b0d9da2cead9124aa5774077c838d2dbd65009f743e0..279cb56523159f9a6e8113712aa4c01d07e5b7327593c18bc09d6223e02a6908 100644 (file)
@@ -1,4 +1,5 @@
 prehash {
+    {field . {map}}
     {field t {str} =prehash}
     {field algos {set} >0} {# set of hash algorithm identifiers}
 }
index 827e640775cf67226a3b2d8d0fb8914528a894872e303d0c0019bb9308676a5c..6e1c0ef47aad0ea0cd83ea181881f1a38bffa8f4e9c0219b1a330241f4903b99 100644 (file)
@@ -1,4 +1,5 @@
 pub {
+    {field . {map}}
     {field load {with load}}
     {field sigs {list} {of sig} >0 optional}
     {field pubs {list} {of pub} >0 optional}
@@ -17,6 +18,7 @@ av {
 }
 
 sig {
+    {field . {map}}
     {field tbs {with pub-sig-tbs}}
     {field sign {with av}}
 }
index ce17fab9ba5e37dd76341219392f8d1b4aecb3200619b5d8a88cd1b7848cd64c..3ff6548b30fafd553900e34dcb49b0865ea318817cbf9de2c5eb937c3dc70f9d 100644 (file)
@@ -2,6 +2,7 @@ schema-include av.tcl
 schema-include fpr.tcl
 
 signed {
+    {field . {map}}
     {field load {with load}}
     {field sigs {list} {of sig} >0 optional}
     {field pubs {list} {of type map} >0 optional}
@@ -14,6 +15,7 @@ load {
 }
 
 sig {
+    {field . {map}}
     {field tbs {with tbs}}
     {field sign {with av}}
 }