serialisation format. It is aimed to be lightweight in terms of CPU,
memory, storage and codec implementation size usage. It supports wide
range of data types, making it able to transparently replace JSON.
+KEKS/Schema is a schema definition format for describing data structures
+validation steps.
+KEKS/CM is a set of schemas and formats related to cryptographic tasks
+like signing, hashing and encryption.
+
+This repository contains implementations of KEKS codec on C99, Go,
+Python3 and Tcl (only encoder) languages. Implementation of KEKS/Schema
+on Tcl. Implementations of KEKS/CM and related utilities on C and Go.
+
+Home page: http://www.keks.cypherpunks.su/
-ckeks is C99 implementation of the KEKS codec.
-Look at doc/ for more information.
+CKEKS is C99 implementation of the KEKS codec, KEKS/Schema validator and
+part of KEKS/CM. Look at doc/ for more information.
-// ckeks -- C KEKS encoder implementation
+// CKEKS -- C99 KEKS encoder implementation
// Copyright (C) 2024-2025 Sergey Matveev <stargrave@stargrave.org>
//
// This program is free software: you can redistribute it and/or modify
\input texinfo
-@settitle ckeks
+@settitle CKEKS
@copying
Copyright @copyright{} 2024-2025 @email{stargrave@@stargrave.org, Sergey Matveev}
@end copying
@node Top
-@top ckeks
+@top CKEKS
C99 implementation of the @url{http://www.keks.cypherpunks.su, KEKS}
codec.
@item No TAI64NA support.
@end itemize
-ckeks is
+CKEKS is
@url{https://www.gnu.org/philosophy/pragmatic.html, copylefted}
@url{https://www.gnu.org/philosophy/free-sw.html, free software}
licenced under @url{https://www.gnu.org/licenses/lgpl-3.0.html, GNU LGPLv3}.
-// ckeks -- C KEKS encoder implementation
+// CKEKS -- C99 KEKS encoder implementation
// Copyright (C) 2024-2025 Sergey Matveev <stargrave@stargrave.org>
//
// This program is free software: you can redistribute it and/or modify
-// ckeks -- C KEKS encoder implementation
+// CKEKS -- C99 KEKS encoder implementation
// Copyright (C) 2024-2025 Sergey Matveev <stargrave@stargrave.org>
//
// This program is free software: you can redistribute it and/or modify
-// ckeks -- C KEKS encoder implementation
+// CKEKS -- C99 KEKS encoder implementation
// Copyright (C) 2024-2025 Sergey Matveev <stargrave@stargrave.org>
//
// This program is free software: you can redistribute it and/or modify
-// ckeks -- C KEKS encoder implementation
+// CKEKS -- C99 KEKS encoder implementation
// Copyright (C) 2024-2025 Sergey Matveev <stargrave@stargrave.org>
//
// This program is free software: you can redistribute it and/or modify
-// ckeks -- C KEKS encoder implementation
+// CKEKS -- C99 KEKS encoder implementation
// Copyright (C) 2024-2025 Sergey Matveev <stargrave@stargrave.org>
//
// This program is free software: you can redistribute it and/or modify
-// ckeks -- C KEKS encoder implementation
+// CKEKS -- C99 KEKS encoder implementation
// Copyright (C) 2024-2025 Sergey Matveev <stargrave@stargrave.org>
//
// This program is free software: you can redistribute it and/or modify
-GoKEKS is Go implementation of the KEKS codec.
+GoKEKS is Go implementation of the KEKS codec, KEKS/Schema validator and
+KEKS/CM.
No FLOAT* support. They are stored/decoded just as a raw value.
+++ /dev/null
-* Sergey Mayorov for his valuable consultation and suggestions
@unnumbered Cryptographic messages
Here are some suggested formats for use with cryptographic messages.
-They are written in @ref{TclSchemas, Tcl schemas} format.
+They are written in @ref{SchemaTcl, KEKS/Schema} format.
@include cm/prv.texi
@include cm/signed.texi
--- /dev/null
+Are not there any satisfiable codecs?
+
+@multitable @columnfractions .30 .05 .05 .05 .05 .05
+
+@headitem @tab Schemaless @tab Simple @tab Deterministic @tab Streamable @tab Compact
+
+@item ASN.1 @url{https://en.wikipedia.org/wiki/Distinguished_Encoding_Rules#DER_encoding, DER} @tab
+ N @tab @strong{N} @tab Y @tab N @tab N
+@item ASN.1 @url{https://en.wikipedia.org/wiki/Distinguished_Encoding_Rules#CER_encoding, CER} @tab
+ N @tab @strong{N} @tab Y @tab Y @tab N
+@item @url{https://datatracker.ietf.org/doc/html/rfc1014, XDR} @tab
+ N @tab Y @tab N @tab N @tab N
+@item @url{https://www.JSON.org/json-en.html, JSON} @tab
+ Y @tab N @tab N @tab Y @tab N
+@item @url{https://bsonspec.org/, BSON} @tab
+ Y @tab Y @tab N @tab N @tab N
+@item @url{https://msgpack.org/, MessagePack} @tab
+ Y @tab Y @tab N @tab N @tab Y
+@item @url{https://datatracker.ietf.org/doc/html/rfc8949, CBOR} @tab
+ Y @tab N @tab N @tab Y @tab Y
+@item @url{https://datatracker.ietf.org/doc/html/draft-mcnally-deterministic-cbor-11, dCBOR} @tab
+ Y @tab @strong{N} @tab Y @tab N @tab Y
+@item @url{http://cr.yp.to/proto/netstrings.txt, Netstrings} @tab
+ Y @tab Y @tab Y @tab N @tab ~
+@item @url{https://wiki.theory.org/BitTorrentSpecification#Bencoding, Bencode} @tab
+ Y @tab Y @tab Y @tab Y @tab ~
+@item @url{https://en.wikipedia.org/wiki/Canonical_S-expressions, Canonical S-expression} @tab
+ Y @tab Y @tab Y @tab Y @tab ~
+@item KEKS @tab
+ Y @tab Y @tab Y @tab Y @tab Y
+
+@end multitable
+
+@multitable @columnfractions .20 .05 .05 .05 .05 .05 .05 .05 .05
+
+@headitem @tab Big str @tab Bin str @tab Human str @tab Ints @tab Bigints @tab Lists @tab Structures @tab Datetime
+
+@item ASN.1 DER @tab
+ Y @tab Y @tab Y @tab Y @tab Y @tab Y @tab Y @tab Y
+@item ASN.1 CER @tab
+ Y @tab Y @tab Y @tab Y @tab Y @tab Y @tab Y @tab Y
+@item XDR @tab
+ N @tab Y @tab Y @tab Y @tab N @tab Y @tab Y @tab N
+@item JSON @tab
+ Y @tab N @tab Y @tab Y @tab Y @tab Y @tab Y @tab N
+@item BSON @tab
+ N @tab Y @tab Y @tab Y @tab N @tab Y @tab Y @tab Y
+@item MessagePack @tab
+ N @tab Y @tab Y @tab Y @tab N @tab Y @tab Y @tab N
+@item CBOR @tab
+ Y @tab Y @tab Y @tab Y @tab N @tab Y @tab Y @tab N
+@item dCBOR @tab
+ Y @tab Y @tab Y @tab Y @tab N @tab Y @tab Y @tab N
+@item Netstrings @tab
+ Y @tab Y @tab N @tab N @tab N @tab N @tab N @tab N
+@item Bencode @tab
+ Y @tab Y @tab N @tab Y @tab Y @tab Y @tab Y @tab N
+@item CSExp @tab
+ Y @tab Y @tab N @tab N @tab N @tab Y @tab N @tab N
+@item KEKS @tab
+ Y @tab Y @tab Y @tab Y @tab Y @tab Y @tab Y @tab Y
+
+@end multitable
+
+Note about CBOR:
+
+@itemize
+@item Hardly you will find wide range of CBOR libraries supporting
+strict validation of deterministically encoded CBOR structures.
+@item Tagged string/integer can not be taken as a viable first-class
+bigint/datetime data support, because many decoders do not support tags
+and won't be able to interpret/validate them.
+@end itemize
constrained and high data volume applications.
@end itemize
-Are not there any satisfiable codecs?
-
-@multitable @columnfractions .30 .05 .05 .05 .05 .05
-
-@headitem @tab Schemaless @tab Simple @tab Deterministic @tab Streamable @tab Compact
-
-@item ASN.1 @url{https://en.wikipedia.org/wiki/Distinguished_Encoding_Rules#DER_encoding, DER} @tab
- N @tab @strong{N} @tab Y @tab N @tab N
-@item ASN.1 @url{https://en.wikipedia.org/wiki/Distinguished_Encoding_Rules#CER_encoding, CER} @tab
- N @tab @strong{N} @tab Y @tab Y @tab N
-@item @url{https://datatracker.ietf.org/doc/html/rfc1014, XDR} @tab
- N @tab Y @tab N @tab N @tab N
-@item @url{https://www.JSON.org/json-en.html, JSON} @tab
- Y @tab N @tab N @tab Y @tab N
-@item @url{https://bsonspec.org/, BSON} @tab
- Y @tab Y @tab N @tab N @tab N
-@item @url{https://msgpack.org/, MessagePack} @tab
- Y @tab Y @tab N @tab N @tab Y
-@item @url{https://datatracker.ietf.org/doc/html/rfc8949, CBOR} @tab
- Y @tab N @tab N @tab Y @tab Y
-@item @url{https://datatracker.ietf.org/doc/html/draft-mcnally-deterministic-cbor-11, dCBOR} @tab
- Y @tab @strong{N} @tab Y @tab N @tab Y
-@item @url{http://cr.yp.to/proto/netstrings.txt, Netstrings} @tab
- Y @tab Y @tab Y @tab N @tab ~
-@item @url{https://wiki.theory.org/BitTorrentSpecification#Bencoding, Bencode} @tab
- Y @tab Y @tab Y @tab Y @tab ~
-@item @url{https://en.wikipedia.org/wiki/Canonical_S-expressions, Canonical S-expression} @tab
- Y @tab Y @tab Y @tab Y @tab ~
-@item KEKS @tab
- Y @tab Y @tab Y @tab Y @tab Y
-
-@end multitable
-
-@multitable @columnfractions .20 .05 .05 .05 .05 .05 .05 .05 .05
-
-@headitem @tab Big str @tab Bin str @tab Human str @tab Ints @tab Bigints @tab Lists @tab Structures @tab Datetime
-
-@item ASN.1 DER @tab
- Y @tab Y @tab Y @tab Y @tab Y @tab Y @tab Y @tab Y
-@item ASN.1 CER @tab
- Y @tab Y @tab Y @tab Y @tab Y @tab Y @tab Y @tab Y
-@item XDR @tab
- N @tab Y @tab Y @tab Y @tab N @tab Y @tab Y @tab N
-@item JSON @tab
- Y @tab N @tab Y @tab Y @tab Y @tab Y @tab Y @tab N
-@item BSON @tab
- N @tab Y @tab Y @tab Y @tab N @tab Y @tab Y @tab Y
-@item MessagePack @tab
- N @tab Y @tab Y @tab Y @tab N @tab Y @tab Y @tab N
-@item CBOR @tab
- Y @tab Y @tab Y @tab Y @tab N @tab Y @tab Y @tab N
-@item dCBOR @tab
- Y @tab Y @tab Y @tab Y @tab N @tab Y @tab Y @tab N
-@item Netstrings @tab
- Y @tab Y @tab N @tab N @tab N @tab N @tab N @tab N
-@item Bencode @tab
- Y @tab Y @tab N @tab Y @tab Y @tab Y @tab Y @tab N
-@item CSExp @tab
- Y @tab Y @tab N @tab N @tab N @tab Y @tab N @tab N
-@item KEKS @tab
- Y @tab Y @tab Y @tab Y @tab Y @tab Y @tab Y @tab Y
-
-@end multitable
-
-Note about CBOR:
-
-@itemize
-@item Hardly you will find wide range of CBOR libraries supporting
-strict validation of deterministically encoded CBOR structures.
-@item Tagged string/integer can not be taken as a viable first-class
-bigint/datetime data support, because many decoders do not support tags
-and won't be able to interpret/validate them.
-@end itemize
+@include comparison.texi
@insertcopying
@include encoding/index.texi
@include schema/index.texi
@include cm/index.texi
+@include thanks.texi
@node Concepts Index
@unnumbered Concepts Index
-@node Schemas
-@cindex Schemas
+@node Schema
+@cindex schema
@cindex structure validation
-@cindex data schemas
+@cindex data schema
@nodedescription Structure validation against schemas
-@unnumbered Data schemas
+@unnumbered Schemas
Although KEKS can be decoded without any schema definition/specification,
data structures are likely to be checked against some kind of the schema.
-@node TclSchemas
-@cindex Tcl schemas
+@node SchemaTcl
+@cindex Tcl schema
+@cindex KEKS/Schema
@nodedescription Tcl-written schemas
-@section Tcl schemas
+@section Tcl schema
Validation commands are pretty low-level and are inconvenient to write
by hand, at least because of huge quantity of TAKEs.
@command{tcl/schema-marshal} utility gives ability to convert much more
-nicer schemas written on Tcl language to the KEKS-encoded commands.
+nicer schemas written on Tcl language to the KEKS-encoded commands. We
+call that Tcl-written schemas KEKS/Schema.
Example with "our" structure can be written as:
@code{>n} and @code{<n} arguments allow checking of the integer value or
the lengths. @code{>0} assures that either list/map or strings are not
empty. @code{len=n} checks the exact length. @code{=v} checks that given
-element has specified value.
+element has specified string/binary value (use @code{len=} for integers).
@code{prec=p} issues TIMEPREC command, but instead of specifying the raw
integer values, you choose one of: s, ms, us, ns, ps, fs, as. @code{utc}
@code{of s} argument issues checking of EACH element of the list or map
against the specified schema, or against specified type if @code{s} is a
known type.
+
+@code{schema-include filename.tcl} command used instead of @code{field}
+allows inclusion of the specified file with the path relative to given
+schema file.
--- /dev/null
+@node Thanks
+@cindex thanks
+@unnumbered Thanks
+
+@itemize
+
+@item Sergey Mayorov for his valuable consultation and suggestions.
+@item Anton Rudenko for the initial unittests of the Python and Go codec
+ implementation.
+
+@end itemize