MCEL: Merkle-Chaining Event Ledger 1.0.0.0a (A1)
A post-quantum secure block-chain ledger system
domain.h File Reference

MCEL domain support header. More...

#include "mcelcommon.h"

Go to the source code of this file.

Macros

#define MCEL_DOMAIN_HASH_SIZE   32U
 The size of the domain hash in bytes.
#define MCEL_DOMAIN_NAME_STRING   "MCEL-LEDGER"
 The MCEL domain name string used for domain separation.
#define MCEL_DOMAIN_STRING_DEPTH   8U
 The depth of the MCEL domain string array.
#define MCEL_DOMAIN_STRING_WIDTH   17U
 The width of each MCEL domain string.

Typedefs

typedef MCEL_EXPORT_API enum mcel_domain_types mcel_domain_types

Enumerations

enum  mcel_domain_types {
  mcel_domain_none = 0U , mcel_domain_block = 1U , mcel_domain_checkpoint = 2U , mcel_domain_ciphertext = 3U ,
  mcel_domain_node = 4U , mcel_domain_plaintext = 5U , mcel_domain_record = 6U , mcel_domain_anchor = 7U
}
 The MCEL hash domain identifiers used to separate commitment types. More...

Functions

MCEL_EXPORT_API const char * mcel_domain_to_name (mcel_domain_types domain)
 Returns the string representation of the domain types enumeration.
MCEL_EXPORT_API bool mcel_domain_hash_message (uint8_t *output, mcel_domain_types domain, const uint8_t *msg, size_t msglen)
 Compute a 32-byte MCEL domain-separated digest using cSHAKE-256.

Detailed Description

MCEL domain support header.

Enumeration Type Documentation

◆ mcel_domain_types

The MCEL hash domain identifiers used to separate commitment types.

Enumerator
mcel_domain_none 

Domain type is none

mcel_domain_block 

Block commitment domain

mcel_domain_checkpoint 

Checkpoint commitment domain

mcel_domain_ciphertext 

Ciphertext payload commitment domain

mcel_domain_node 

Merkle internal node domain

mcel_domain_plaintext 

Plaintext payload commitment domain

mcel_domain_record 

Record commitment domain

mcel_domain_anchor 

Anchor commitment domain

Function Documentation

◆ mcel_domain_hash_message()

MCEL_EXPORT_API bool mcel_domain_hash_message ( uint8_t * output,
mcel_domain_types domain,
const uint8_t * msg,
size_t msglen )

Compute a 32-byte MCEL domain-separated digest using cSHAKE-256.

Parameters
outputA pointer to the output hash array of size MCEL_BLOCK_HASH_SIZE.
domainThe MCEL domain identifier.
msg[const] A pointer to the message bytes.
msglenThe length of the message in bytes.
Returns
Returns true on success.

◆ mcel_domain_to_name()

MCEL_EXPORT_API const char * mcel_domain_to_name ( mcel_domain_types domain)

Returns the string representation of the domain types enumeration.

Parameters
domainThe domain enumeration member.
Returns
Returns a pointer to the domain name string.