Skip to content

Commit 026c97a

Browse files
committed
MTL Library Version 1.0.0
1 parent 3ae9dad commit 026c97a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+12060
-0
lines changed

.gitignore

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Prerequisites
2+
*.d
3+
4+
# Object files
5+
*.o
6+
*.ko
7+
*.obj
8+
*.elf
9+
10+
# Linker output
11+
*.ilk
12+
*.map
13+
*.exp
14+
15+
# Precompiled Headers
16+
*.gch
17+
*.pch
18+
19+
# Libraries
20+
*.lib
21+
*.a
22+
*.la
23+
*.lo
24+
25+
# Shared objects (inc. Windows DLLs)
26+
*.dll
27+
*.so
28+
*.so.*
29+
*.dylib
30+
31+
# Executables
32+
*.exe
33+
*.out
34+
*.app
35+
*.i*86
36+
*.x86_64
37+
*.hex
38+
39+
# Debug files
40+
*.dSYM/
41+
*.su
42+
*.idb
43+
*.pdb
44+
45+
# Kernel Module Compile Results
46+
*.mod*
47+
*.cmd
48+
.tmp_versions/
49+
modules.order
50+
Module.symvers
51+
Mkfile.old
52+
dkms.conf
53+
54+
# Temporary Files
55+
**/*\~
56+
57+
# Project Binaries
58+
**/mtltool
59+
**/mtltest
60+
61+
# Autotools
62+
# http://www.gnu.org/software/automake
63+
64+
Makefile.in
65+
/ar-lib
66+
/mdate-sh
67+
/py-compile
68+
/test-driver
69+
/ylwrap
70+
.deps/
71+
.dirstamp
72+
73+
# http://www.gnu.org/software/autoconf
74+
75+
autom4te.cache
76+
/autoscan.log
77+
/autoscan-*.log
78+
/aclocal.m4
79+
/compile
80+
/config.cache
81+
/config.guess
82+
/config.h.in
83+
/config.log
84+
/config.status
85+
/config.sub
86+
/configure
87+
/configure.scan
88+
/depcomp
89+
/install-sh
90+
/missing
91+
/stamp-h1
92+
93+
# https://www.gnu.org/software/libtool/
94+
95+
/ltmain.sh
96+
97+
# http://www.gnu.org/software/texinfo
98+
99+
/texinfo.tex
100+
101+
# http://www.gnu.org/software/m4/
102+
103+
m4/libtool.m4
104+
m4/ltoptions.m4
105+
m4/ltsugar.m4
106+
m4/ltversion.m4
107+
m4/lt~obsolete.m4
108+
109+
# Generated Makefile
110+
# (meta build system like autotools,
111+
# can automatically generate from config.status script
112+
# (which is called by configure script))
113+
Makefile
114+
115+
116+
# Ignore key files
117+
*.pem
118+
119+
# Ignore examples tem files
120+
examples/tmp/**

LICENSE.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
Verisign has announced public, royalty-free licenses to certain intellectual property
2+
related to MTL mode in furtherance of IETF standardization which helps support the
3+
security, stability and resiliency of the Domain Name System (DNS) and the internet.
4+
For more information about the licenses, see the following IETF IPR declarations or
5+
updates thereto:
6+
7+
* https://datatracker.ietf.org/ipr/6176/
8+
* https://datatracker.ietf.org/ipr/6175/
9+
* https://datatracker.ietf.org/ipr/6174/
10+
* https://datatracker.ietf.org/ipr/6173/
11+
* https://datatracker.ietf.org/ipr/6172/
12+
* https://datatracker.ietf.org/ipr/6171/
13+
* https://datatracker.ietf.org/ipr/6170/
14+
15+
Subject to the licenses referenced above and conditions thereof:
16+
17+
"This product is licensed under patents and/or patent applications owned by VeriSign, Inc.
18+
in furtherance of IETF standardization which helps support the security, stability and
19+
resiliency of the Domain Name System (DNS) and the internet. For more information about the
20+
patents, visit www.verisign.com/Declarations."
21+
22+
23+
The Clear BSD License
24+
25+
Copyright (c) 2023, VeriSign, Inc.
26+
All rights reserved.
27+
28+
Redistribution and use in source and binary forms, with or without
29+
modification, are permitted (subject to the limitations in the disclaimer
30+
below) provided that the following conditions are met:
31+
32+
* Redistributions of source code must retain the above copyright notice,
33+
this list of conditions and the following disclaimer.
34+
35+
* Redistributions in binary form must reproduce the above copyright
36+
notice, this list of conditions and the following disclaimer in the
37+
documentation and/or other materials provided with the distribution.
38+
39+
* Neither the name of the copyright holder nor the names of its
40+
contributors may be used to endorse or promote products derived from this
41+
software without specific prior written permission.
42+
43+
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
44+
THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
45+
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
46+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
47+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
48+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
49+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
50+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
51+
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
52+
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
53+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
54+
POSSIBILITY OF SUCH DAMAGE.

Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SUBDIRS = src test examples
2+
ACLOCAL_AMFLAGS = -I m4

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# MTL
2+
MTL Reference Library Implementation based on [draft-harvey-cfrg-mtl-mode-00](https://datatracker.ietf.org/doc/draft-harvey-cfrg-mtl-mode/)
3+
4+
## Dependencies
5+
* libcrypto from openssl version 3.1.0 or newer (or substitute crypto operations to replace the spx_funcs.c functions)
6+
* liboqs version 0.7.2 or newer (for the examples). To include the liboqs library as a statically linked library change the -loqs to -l:_path_/liboqs.a in the examples/Makefile.am.
7+
* Applications using the MTL Reference Library should also link with the C math library (-lm)
8+
9+
## Configuring the build environment
10+
1. Setup the auto tools: `autoreconf --install`
11+
2. configure the project: `./configure`
12+
3. build the library and tools: `make`
13+
14+
## Running the test application
15+
(After building the library and tools) Run the mtltool test tool in the test directory `test/mtltest`.
16+
Alternatively, `make check` can be run to exercise the mtltest tool.
17+
18+
## Running the example application
19+
(After building the library and tools) run the mtltool application `examples/mtltool` with one of the three supported commands
20+
* `mtltool keygen <key file> <key string>`
21+
* `mtltool sign <key file> <data file> <signature file>`
22+
* `mtltool verify <key file> <data file> <signature file>`
23+
24+
Where key file is the private/public key pair to generate/use, data file is an ascii file for which each line in the file will be signed, and signature file is a binary file that will have one signature for each record signed.
25+
Key string is one of the supported algorithm strings [README_SCHEMES.md](README_SCHEMES.md)
26+
27+
## Randomization
28+
Randomization is defined in the schemes table. It needs to match the underlying signature scheme randomization strategy, which can be a compile time decision for some libraries.
29+
30+
## MTL Tree Sizes
31+
The page and record sizes for MTL mode are defined in the src/mtl_node_set.h file. Larger sizes allows for larger trees but requires more resources. This value can be tailored to support smaller instances if desired. The default values are 1 Megabyte per page with 1024 pages resulting in 1 Gigabyte of hashes in memory. For a 128 bit hash this results in a max of 67,108,864 hashes (~33,554,432 messages signed) and for a 256 bit hash this results in 33,554,432 hashes (~16,777,216 messages signed)
32+
33+
## Open Items
34+
* MTL Provider is tested through the application in the test folder and the example application. These applications are to demonstrate the capability and are not production worthy. Some code paths are not implemented or are not fully tested.
35+
36+
## About MTL Mode
37+
Merkle Tree Ladder (MTL) mode is a technique for using an underlying signature scheme to authenticate an evolving series of messages that can reduce the signature scheme's operational impact. Rather than signing messages individually, MTL mode signs structures called "Merkle tree ladders" that are derived from the messages to be authenticated. Individual messages are then authenticated relative to the ladder using a Merkle tree authentication path and the ladder is authenticated using the public key of the underlying signature scheme. The size and computational cost of the underlying signatures are thereby amortized across multiple messages, reducing the scheme's operational impact. The reduction can be particularly beneficial when MTL mode is applied to a post-quantum signature scheme that has a large signature size or computational cost. Like other Merkle tree techniques, MTL mode's security is based only on cryptographic hash functions, so the mode is quantum-safe based on the quantum-resistance of its cryptographic hash functions.
38+
39+
MTL mode is described in more detail in this paper co-authored by Verisign researchers: Fregly, A., Harvey, J., Kaliski Jr., B.S., Sheth, S. (2023). Merkle Tree Ladder Mode: Reducing the Size Impact of NIST PQC Signature Algorithms in Practice. In: Rosulek, M. (ed) Topics in Cryptology – CT-RSA 2023. Lecture Notes in Computer Science, vol 13871. Springer, Cham. https://doi.org/10.1007/978-3-031-30872-7_16.
40+
41+
Verisign has announced public, royalty-free licenses to certain intellectual property related to MTL mode in furtherance of IETF standardization which helps support the security, stability and resiliency of the Domain Name System (DNS) and the internet. For more information about the licenses, see the following IETF IPR declarations or updates thereto:
42+
43+
* https://datatracker.ietf.org/ipr/6176/
44+
* https://datatracker.ietf.org/ipr/6175/
45+
* https://datatracker.ietf.org/ipr/6174/
46+
* https://datatracker.ietf.org/ipr/6173/
47+
* https://datatracker.ietf.org/ipr/6172/
48+
* https://datatracker.ietf.org/ipr/6171/
49+
* https://datatracker.ietf.org/ipr/6170/
50+
51+
Subject to the licenses referenced above and conditions thereof:
52+
53+
"This product is licensed under patents and/or patent applications owned by VeriSign, Inc. in furtherance of IETF standardization which helps support the security, stability and resiliency of the Domain Name System (DNS) and the internet. For more information about the patents, visit www.verisign.com/Declarations."
54+

README_SCHEMES.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# MTL SCHEMES
2+
The following signature schemes are suported by this library:
3+
4+
## Supported algorithm strings
5+
* SPHINCS+-MTL-SHAKE-128S-SIMPLE
6+
* SPHINCS+-MTL-SHAKE-128S-ROBUST
7+
* SPHINCS+-MTL-SHAKE-128F-SIMPLE
8+
* SPHINCS+-MTL-SHAKE-128F-ROBUST
9+
* SPHINCS+-MTL-SHAKE-192S-SIMPLE
10+
* SPHINCS+-MTL-SHAKE-192S-ROBUST
11+
* SPHINCS+-MTL-SHAKE-192F-SIMPLE
12+
* SPHINCS+-MTL-SHAKE-192F-ROBUST
13+
* SPHINCS+-MTL-SHAKE-256S-SIMPLE
14+
* SPHINCS+-MTL-SHAKE-256S-ROBUST
15+
* SPHINCS+-MTL-SHAKE-256F-SIMPLE
16+
* SPHINCS+-MTL-SHAKE-256F-ROBUST
17+
* SPHINCS+-MTL-SHA2-128S-SIMPLE
18+
* SPHINCS+-MTL-SHA2-128S-ROBUST
19+
* SPHINCS+-MTL-SHA2-128F-SIMPLE
20+
* SPHINCS+-MTL-SHA2-128F-ROBUST
21+
* SPHINCS+-MTL-SHA2-192S-SIMPLE
22+
* SPHINCS+-MTL-SHA2-192S-ROBUST
23+
* SPHINCS+-MTL-SHA2-192F-SIMPLE
24+
* SPHINCS+-MTL-SHA2-192F-ROBUST
25+
* SPHINCS+-MTL-SHA2-256S-SIMPLE
26+
* SPHINCS+-MTL-SHA2-256S-ROBUST
27+
* SPHINCS+-MTL-SHA2-256F-SIMPLE
28+
* SPHINCS+-MTL-SHA2-256F-ROBUST
29+
30+
## Definitions
31+
Signature schemes are defined in the example/schemes.h directory.
32+
33+
## Adding new signature schemes
34+
Adding new signature schemes requires these steps
35+
1. Create the appropriate implementations of the hash_msg, hash_leaf, and hash_int functions.
36+
2. Update the examples/schemes.h to include the new signature scheme identifiers and properties.
37+
3. Update the examples/mtltool.c `// Algorithm Selection` sections to set the algorithm functions.
38+
4. Update the examples/mtltool.h to add any scheme specific #defines
39+
5. Update the examples/mtltool_io.c `// Create the scheme specific parameters` sections to create the appropriate parameters for the new scheme.

configure.ac

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
AM_CFLAGS="-Wall -O0 -g"
2+
3+
AC_INIT([mtllib], [1.0], [jsharvey@verisign.com])
4+
AC_CONFIG_SRCDIR([src])
5+
AC_CONFIG_HEADERS([config.h])
6+
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
7+
AC_CONFIG_MACRO_DIR([m4])
8+
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
9+
AC_ENABLE_SHARED(yes)
10+
LT_INIT
11+
12+
AC_HEADER_STDC
13+
AC_HEADER_DIRENT
14+
AC_CHECK_HEADERS([stdlib.h stdio.h libintl.h locale.h])
15+
AC_SEARCH_LIBS([EVP_MD_CTX_new], [crypto], ,[AC_MSG_ERROR(an acceptable version of libcrypto was not found)])
16+
AC_SEARCH_LIBS([log10], [m] ,[], AC_MSG_ERROR([libdmtx requires libm]))
17+
18+
if test "${CFLAGS+set}" == set; then
19+
dnl Remove this or change this to non-debug default before release
20+
CFLAGS="-fPIC -Wall -Wextra -g -O0"
21+
fi
22+
AC_PROG_CC
23+
dnl AC_PROG_RANLIB
24+
AM_PROG_CC_C_O
25+
AC_CONFIG_FILES([Makefile src/Makefile test/Makefile examples/Makefile])
26+
AC_OUTPUT()

examples/Makefile.am

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
srcPath = $(srcdir)/../src
2+
3+
bin_PROGRAMS = mtltool
4+
mtltool_SOURCES = mtltool.c mtltool_io.c
5+
mtltool_LDADD = $(srcPath)/.libs/libmtllib.a -loqs
6+
7+
AM_CFLAGS = -I$(srcPath) $(all_includes)

0 commit comments

Comments
 (0)