Skip to content

Commit 79d7eac

Browse files
authored
Merge pull request #3 from verisign/v1.1.2
Release - Version 1.1.2
2 parents c34487d + 990236d commit 79d7eac

Some content is hidden

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

51 files changed

+5348
-1099
lines changed

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ patents, visit www.verisign.com/Declarations."
2222

2323
The Clear BSD License
2424

25-
Copyright (c) 2024, VeriSign, Inc.
25+
Copyright (c) 2025, VeriSign, Inc.
2626
All rights reserved.
2727

2828
Redistribution and use in source and binary forms, with or without

README_SCHEMES.md

Lines changed: 16 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,25 @@
22
The following signature schemes are supported by this library:
33

44
## 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
5+
* SLH-DSA-MTL-SHAKE-128S
6+
* SLH-DSA-MTL-SHAKE-128F
7+
* SLH-DSA-MTL-SHAKE-192S
8+
* SLH-DSA-MTL-SHAKE-192F
9+
* SLH-DSA-MTL-SHAKE-256S
10+
* SLH-DSA-MTL-SHAKE-256F
11+
* SLH-DSA-MTL-SHA2-128S
12+
* SLH-DSA-MTL-SHA2-128F
13+
* SLH-DSA-MTL-SHA2-192S
14+
* SLH-DSA-MTL-SHA2-192F
15+
* SLH-DSA-MTL-SHA2-256S
16+
* SLH-DSA-MTL-SHA2-256F
2917

3018
## Definitions
31-
Signature schemes are defined in the example/schemes.h directory.
19+
Signature schemes are defined in the src/mtllib_schemes.h header file.
3220

3321
## Adding new signature schemes
3422
Adding new signature schemes requires these steps
3523
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.
24+
2. Update the src/mtllib_schemes.h to include the new signature scheme identifiers and properties.
25+
3. Update the src/mtllib_util.c if needed to define new hash algorithm schemes.
26+
4. Update the src/mtllib_util.c if needed to define new underlying signature library bindings.

docs.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
doxygen docs/mtl_docs.cfg

examples/Makefile.am

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
srcPath = $(srcdir)/../src
22

33
bin_PROGRAMS = mtlverify mtlsign mtlkeygen
4-
mtlverify_SOURCES = mtlverify.c mtltool_io.c mtl_example_util.c
4+
mtlverify_SOURCES = mtlverify.c mtl_example_util.c
55
mtlverify_LDADD = $(srcPath)/.libs/libmtllib.a -loqs
6-
mtlsign_SOURCES = mtlsign.c mtltool_io.c mtl_example_util.c
6+
mtlsign_SOURCES = mtlsign.c mtl_example_util.c
77
mtlsign_LDADD = $(srcPath)/.libs/libmtllib.a -loqs
8-
mtlkeygen_SOURCES = mtlkeygen.c mtltool_io.c mtl_example_util.c
8+
mtlkeygen_SOURCES = mtlkeygen.c mtl_example_util.c
99
mtlkeygen_LDADD = $(srcPath)/.libs/libmtllib.a -loqs
1010

1111
AM_CFLAGS = -I$(srcPath) $(all_includes)

examples/mtl_example_util.c

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2024, VeriSign, Inc.
2+
Copyright (c) 2025, VeriSign, Inc.
33
All rights reserved.
44
55
Redistribution and use in source and binary forms, with or without
@@ -39,31 +39,7 @@
3939
#include "mtlverify.h"
4040
#include "mtl_example_util.h"
4141

42-
#include <openssl/evp.h>
43-
44-
45-
/*****************************************************************
46-
* Get Underlying Signature
47-
******************************************************************
48-
* @param algo_str, C character string representing the algorithm
49-
* @return ALGORITHM structure element with the properties for
50-
* the specific algorithm, or NULL if not found
51-
*/
52-
ALGORITHM *get_underlying_signature(char *algo_str, ALGORITHM* algos)
53-
{
54-
uint16_t algo_idx = 0;
55-
56-
while (algos[algo_idx].name != NULL) {
57-
if (strcmp(algos[algo_idx].name, (char *)algo_str) == 0) {
58-
return &algos[algo_idx];
59-
}
60-
algo_idx++;
61-
}
62-
63-
return NULL;
64-
}
65-
66-
42+
#include <openssl/evp.h>
6743

6844
/*****************************************************************
6945
* Convert a string to upper case in place
@@ -326,15 +302,13 @@ void mtl_print_message(uint8_t* message, uint32_t message_len, FILE* stream) {
326302
}
327303

328304

329-
void mtl_print_signature_scheme(ALGORITHM* algo, FILE* stream) {
305+
void mtl_print_signature_scheme(MTL_ALGORITHM_PROPS* algo, FILE* stream) {
330306
if(stream != NULL) {
331307
verbose_print_block("MTL Signature Scheme", stream);
332308
verbose_print_string("Scheme", algo->name, stream);
333309
verbose_print_number("Security Param", algo->sec_param, stream);
334-
verbose_print_number("NIST Level", algo->nist_level, stream);
335310
verbose_print_hex("Randomizing", algo->randomize, stream);
336-
verbose_print_hex("Robust", algo->robust, stream);
337-
verbose_print_string("Underlying Sig", algo->oqs_str, stream);
311+
verbose_print_string("Underlying Sig", algo->scheme_str, stream);
338312
verbose_print_number("OID Length", algo->oid_len, stream);
339313
verbose_print_buffer("OID Value", algo->oid, algo->oid_len, stream);
340314
verbose_print_block("", stream);

examples/mtl_example_util.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2024, VeriSign, Inc.
2+
Copyright (c) 2025, VeriSign, Inc.
33
All rights reserved.
44
55
Redistribution and use in source and binary forms, with or without
@@ -35,7 +35,7 @@
3535

3636
#include <stdbool.h>
3737

38-
#include "mtl.h"
38+
#include "mtllib.h"
3939

4040
/* Type definitions */
4141
typedef enum {
@@ -64,26 +64,20 @@ typedef struct ALGORITHM {
6464
} ALGORITHM;
6565

6666
/* Helper macros */
67-
#define PKSEED_INIT(ptr, value, len) {ptr.length=len; memcpy(ptr.seed, value, len);}
68-
#define PKROOT_INIT(ptr, value, len) {ptr.length=len; memcpy(ptr.key, value, len);}
69-
#define SKPRF_INIT(ptr, value, len) {ptr.length=len; memcpy(ptr.data, value, len);}
70-
#define SKPRF_CLEAR(ptr, len) {ptr.length=len; memset(ptr.data, 0, len);}
71-
7267
#define LOG_MESSAGE(msg, buffer) if(buffer!=NULL) {fprintf(buffer,"%s\n", msg);}
7368

7469
#define MTL_MAX_BUFFER_SIZE 65535
7570

7671
/* Function prototypes */
7772
size_t mtl_buffer2bin(uint8_t* input, size_t input_len, uint8_t** output, data_encoding encoding);
7873
void mtl_write_buffer(uint8_t* buffer, size_t buffer_len, FILE* output, data_encoding encoding, bool newline);
79-
ALGORITHM *get_underlying_signature(char *algo_str, ALGORITHM* algos);
8074
char *mtl_str2upper(char *data);
8175
void mtl_print_auth_path(AUTHPATH* auth_path, RANDOMIZER* mtl_rand, uint32_t hash_len, FILE *stream);
8276
void mtl_print_ladder(LADDER* ladder, FILE *stream);
8377
void mtl_print_ladder_signature(uint8_t* sig, size_t sig_len, FILE* stream);
8478
void mtl_print_rung(RUNG* rung, FILE* stream);
8579
void mtl_print_message(uint8_t* message, uint32_t message_len, FILE* stream);
86-
void mtl_print_signature_scheme(ALGORITHM* algo, FILE* stream);
80+
void mtl_print_signature_scheme(MTL_ALGORITHM_PROPS* algo, FILE* stream);
8781
void mtl_print_mtl_buffer(char* label, uint8_t *buffer, uint32_t buffer_length, FILE* stream);
8882

8983
#endif // __MTL_EXAMPLE_UTIL_H__

0 commit comments

Comments
 (0)