From a4b222c0b2ec6e5630eac210b5f7e6f64fecff087cfa9e094117283aa8a8f47b Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Fri, 14 Feb 2025 11:53:29 +0300 Subject: [PATCH] Separate documentation section for CM --- spec/{format => cm}/encrypted.cddl | 0 spec/{format => cm}/encrypted.texi | 2 +- spec/{format => cm}/hashed.cddl | 0 spec/{format => cm}/hashed.texi | 2 +- spec/cm/index.texi | 12 +++ spec/{format => cm}/prv.cddl | 0 spec/{format => cm}/prv.texi | 2 +- spec/{format => cm}/pub-load.cddl | 0 spec/{format => cm}/pub-sig-tbs.cddl | 0 spec/{format => cm}/pub.texi | 4 +- spec/{format => cm}/signed-prehash.cddl | 0 spec/{format => cm}/signed.cddl | 0 spec/{format => cm}/signed.texi | 4 +- spec/format/index.texi | 13 --- spec/format/registry.texi | 108 ------------------------ spec/index.texi | 2 +- 16 files changed, 20 insertions(+), 129 deletions(-) rename spec/{format => cm}/encrypted.cddl (100%) rename spec/{format => cm}/encrypted.texi (99%) rename spec/{format => cm}/hashed.cddl (100%) rename spec/{format => cm}/hashed.texi (99%) create mode 100644 spec/cm/index.texi rename spec/{format => cm}/prv.cddl (100%) rename spec/{format => cm}/prv.texi (97%) rename spec/{format => cm}/pub-load.cddl (100%) rename spec/{format => cm}/pub-sig-tbs.cddl (100%) rename spec/{format => cm}/pub.texi (98%) rename spec/{format => cm}/signed-prehash.cddl (100%) rename spec/{format => cm}/signed.cddl (100%) rename spec/{format => cm}/signed.texi (97%) delete mode 100644 spec/format/index.texi delete mode 100644 spec/format/registry.texi diff --git a/spec/format/encrypted.cddl b/spec/cm/encrypted.cddl similarity index 100% rename from spec/format/encrypted.cddl rename to spec/cm/encrypted.cddl diff --git a/spec/format/encrypted.texi b/spec/cm/encrypted.texi similarity index 99% rename from spec/format/encrypted.texi rename to spec/cm/encrypted.texi index c328a12..6b7c226 100644 --- a/spec/format/encrypted.texi +++ b/spec/cm/encrypted.texi @@ -4,7 +4,7 @@ Stored in a file, it should begin with "cm/encrypted" @ref{Magic, magic}. -@verbatiminclude format/encrypted.cddl +@verbatiminclude cm/encrypted.cddl @code{/ciphertext} contains the ciphertext. It is encrypted with random "content encryption key" (CEK) with an algorithm specified in diff --git a/spec/format/hashed.cddl b/spec/cm/hashed.cddl similarity index 100% rename from spec/format/hashed.cddl rename to spec/cm/hashed.cddl diff --git a/spec/format/hashed.texi b/spec/cm/hashed.texi similarity index 99% rename from spec/format/hashed.texi rename to spec/cm/hashed.texi index e5dcae5..785da1f 100644 --- a/spec/format/hashed.texi +++ b/spec/cm/hashed.texi @@ -5,7 +5,7 @@ Integrity protected container, CMS'es DigestedData analogue. Stored in a file, it should begin with "cm/hashed" @ref{Magic, magic}. -@verbatiminclude format/hashed.cddl +@verbatiminclude cm/hashed.cddl @code{/a} tells what algorithms will be used to hash the data. diff --git a/spec/cm/index.texi b/spec/cm/index.texi new file mode 100644 index 0000000..e00c77f --- /dev/null +++ b/spec/cm/index.texi @@ -0,0 +1,12 @@ +@node CM +@unnumbered Cryptographic messages + +Here are some suggested formats for use with cryptographic messages. +They are written in +@url{https://datatracker.ietf.org/doc/html/rfc8610, CDDL}-like format. + +@include cm/prv.texi +@include cm/signed.texi +@include cm/pub.texi +@include cm/hashed.texi +@include cm/encrypted.texi diff --git a/spec/format/prv.cddl b/spec/cm/prv.cddl similarity index 100% rename from spec/format/prv.cddl rename to spec/cm/prv.cddl diff --git a/spec/format/prv.texi b/spec/cm/prv.texi similarity index 97% rename from spec/format/prv.texi rename to spec/cm/prv.texi index 206acb6..3060a54 100644 --- a/spec/format/prv.texi +++ b/spec/cm/prv.texi @@ -4,7 +4,7 @@ Private key container. -@verbatiminclude format/prv.cddl +@verbatiminclude cm/prv.cddl Stored in a file, it should begin with "cm/prv" @ref{Magic, magic}. diff --git a/spec/format/pub-load.cddl b/spec/cm/pub-load.cddl similarity index 100% rename from spec/format/pub-load.cddl rename to spec/cm/pub-load.cddl diff --git a/spec/format/pub-sig-tbs.cddl b/spec/cm/pub-sig-tbs.cddl similarity index 100% rename from spec/format/pub-sig-tbs.cddl rename to spec/cm/pub-sig-tbs.cddl diff --git a/spec/format/pub.texi b/spec/cm/pub.texi similarity index 98% rename from spec/format/pub.texi rename to spec/cm/pub.texi index 830defb..85e5f17 100644 --- a/spec/format/pub.texi +++ b/spec/cm/pub.texi @@ -12,7 +12,7 @@ Its @code{/load/t} equals to @code{pub}. cm-pub = cm-signed ; with /load/t = "pub", /load/v = cm-pub-load @end verbatim -@verbatiminclude format/pub-load.cddl +@verbatiminclude cm/pub-load.cddl @table @code @@ -54,7 +54,7 @@ It @strong{must} be absent if empty. Values are extension specific. @code{cm-signed}'s @code{sig-tbs} @strong{must} contain additional fields: -@verbatiminclude format/pub-sig-tbs.cddl +@verbatiminclude cm/pub-sig-tbs.cddl @table @code diff --git a/spec/format/signed-prehash.cddl b/spec/cm/signed-prehash.cddl similarity index 100% rename from spec/format/signed-prehash.cddl rename to spec/cm/signed-prehash.cddl diff --git a/spec/format/signed.cddl b/spec/cm/signed.cddl similarity index 100% rename from spec/format/signed.cddl rename to spec/cm/signed.cddl diff --git a/spec/format/signed.texi b/spec/cm/signed.texi similarity index 97% rename from spec/format/signed.texi rename to spec/cm/signed.texi index 3f0fc19..5979a13 100644 --- a/spec/format/signed.texi +++ b/spec/cm/signed.texi @@ -8,7 +8,7 @@ That resembles @url{https://datatracker.ietf.org/doc/html/rfc5652, CMS} Stored in a file, it should begin with "cm/signed" @ref{Magic, magic}, unless it is a @ref{cm-pub, public key}. -@verbatiminclude format/signed.cddl +@verbatiminclude cm/signed.cddl Signature is created by signing the: @@ -26,7 +26,7 @@ following approach: cm-signed-prehash || BLOB(detached-data) || cm-signed @end verbatim -@verbatiminclude format/signed-prehash.cddl +@verbatiminclude cm/signed-prehash.cddl With @code{cm-signed-prehash} you initialise your hashers used during signing process and feed BLOB's contents (not the encoded BLOB itself!) diff --git a/spec/format/index.texi b/spec/format/index.texi deleted file mode 100644 index f41ff74..0000000 --- a/spec/format/index.texi +++ /dev/null @@ -1,13 +0,0 @@ -@node Formats -@unnumbered Formats - -Here are some suggested formats. -They are written in -@url{https://datatracker.ietf.org/doc/html/rfc8610, CDDL}-like format. - -@include format/prv.texi -@include format/signed.texi -@include format/pub.texi -@include format/hashed.texi -@include format/encrypted.texi -@include format/registry.texi diff --git a/spec/format/registry.texi b/spec/format/registry.texi deleted file mode 100644 index 92be7a2..0000000 --- a/spec/format/registry.texi +++ /dev/null @@ -1,108 +0,0 @@ -@node Registry -@cindex Registry -@section AI registry - -There is example registry of known algorithm identifiers. - -@node AI Hashes -@subsection Hashes - -@table @code -@item blake2b, blake2b256 - @code{@ref{cm-pub-ed25519-blake2b}}, - @code{@ref{cm-hashed-blake2b}}, - @code{@ref{cm-signed-ed25519-blake2b}} -@item blake2b-merkle - @code{@ref{cm-hashed-blake2b-merkle}}, - @code{@ref{cm-signed-ed25519ph-blake2b-merkle}} -@item blake3 - @code{@ref{cm-hashed-blake3}} -@item sha2-256, sha2-512 - @code{@ref{cm-hashed-sha2}} -@item shake128, shake256 - @code{@ref{cm-hashed-shake}} -@item shake128-merkle, shake256-merkle - @code{@ref{cm-hashed-shake-merkle}} -@item skein512 - @code{@ref{cm-hashed-skein512}} -@item streebog256, streebog512 - @code{@ref{cm-hashed-gost3411}} -@item streebog256-merkle, streebog512-merkle - @code{@ref{cm-hashed-gost3411-merkle}} -@item xxh3-128 - @code{@ref{cm-hashed-xxh3-128}} -@end table - -@node AI DH -@subsection DH - -@table @code -@item ecdsa-nist256p, ecdsa-nist521p -@item gost3410-256A, gost3410-512C - @code{@ref{cm-pub-gost3410}}, - @code{@ref{cm-prv-gost3410}} -@item x25519 -@item x448 -@end table - -@node AI DEM -@subsection DEM - -@table @code -@item chacha20poly1305 - @code{@ref{cm-encrypted-chacha20poly1305}} -@item kuznechik-ctracpkm-hmac - @code{@ref{cm-encrypted-kuznechik-ctracpkm-hmac}} -@end table - -@node AI KEM -@subsection KEM - -@table @code -@item argon2id-hkdf-blake2b -@item balloon-blake2b-hkdf - @code{@ref{cm-encrypted-balloon-blake2b-hkdf}} -@item gost3410-hkdf-kexp15 - @code{@ref{cm-encrypted-gost3410-hkdf-kexp15}} -@item mceliece6960119-x25519-hkdf-shake256 - @code{@ref{cm-encrypted-mceliece6960119-x25519-hkdf-shake256}} -@item mlkem768-x25519 -@item sntrup761-x25519 -@item sntrup4591761-x25519 - @code{@ref{cm-pub-sntrup4591761-x25519}}, - @code{@ref{cm-prv-sntrup4591761-x25519}} -@item sntrup4591761-x25519-hkdf-blake2b - @code{@ref{cm-encrypted-sntrup4591761-x25519-hkdf-blake2b}} -@item sntrup761-x25519-hkdf-blake2b -@end table - -@node AI Sign -@subsection Signatures - -@table @code -@item ecdsa-nist256p, ecdsa-nist521p -@item ed25519-blake2b - @code{@ref{cm-prv-ed25519-blake2b}}, - @code{@ref{cm-signed-ed25519-blake2b}}, - @code{@ref{cm-pub-ed25519-blake2b}} -@item ed25519ph-blake2b - @code{@ref{cm-signed-ed25519-blake2b}} -@item ed25519ph-blake2b-merkle - @code{@ref{cm-signed-ed25519ph-blake2b-merkle}} -@item ed448 -@item gost3410-256A, gost3410-512C - @code{@ref{cm-pub-gost3410}}, - @code{@ref{cm-prv-gost3410}}, - @code{@ref{cm-signed-gost3410}} -@item gost3410-256A-merkle, gost3410-512C-merkle - @code{@ref{cm-signed-gost3410-merkle}} -@end table - -@node AI Content types -@subsection Content types - -@itemize -@item @ref{cm-pub, @code{pub}} -@item @ref{cm-signed, @code{data}} -@item @ref{cm-prv, @code{prv}} -@end itemize diff --git a/spec/index.texi b/spec/index.texi index 9003ad5..bcdd1d1 100644 --- a/spec/index.texi +++ b/spec/index.texi @@ -132,7 +132,7 @@ and won't be able to interpret/validate them. @include install.texi @include encoding/index.texi @include schema.texi -@include format/index.texi +@include cm/index.texi @node Concepts Index @unnumbered Concepts Index -- 2.50.0