iota.lib.cpp
IOTA C++ Library
Functions
IOTA::Crypto::Signing Namespace Reference

Functions

std::vector< uint8_t > key (const std::vector< uint8_t > &seedBytes, uint32_t index=0, uint32_t security=2)
 
std::vector< uint8_t > digests (const std::vector< uint8_t > &keyBytes)
 
std::vector< uint8_t > address (const std::vector< uint8_t > &digests)
 
std::vector< uint8_t > digest (const std::vector< int8_t > &normalizedBundleFragment, const std::vector< uint8_t > &signatureFragment)
 
Types::Trits signatureFragment (const std::vector< int8_t > &normalizedBundleFragment, const Types::Trits &keyFragment)
 
std::vector< Types::Trytes > signInputs (const Models::Seed &seed, const std::vector< Models::Address > &inputs, Models::Bundle &bundle, const std::vector< Types::Trytes > &signatureFragments)
 
bool validateSignatures (const Models::Address &expectedAddress, const std::vector< Types::Trytes > &signatureFragments, const Types::Trytes &bundleHash)
 

Detailed Description

Signing related functions.

Function Documentation

◆ address()

std::vector<uint8_t> IOTA::Crypto::Signing::address ( const std::vector< uint8_t > &  digests)

Compute address from digests.

Parameters
digestsThe digests.
Returns
The address.

◆ digest()

std::vector<uint8_t> IOTA::Crypto::Signing::digest ( const std::vector< int8_t > &  normalizedBundleFragment,
const std::vector< uint8_t > &  signatureFragment 
)

Compute hash x normalizedBundleFragment[i] for each fragment in the signature.

Parameters
normalizedBundleFragmentThe bundle fragment.
signatureFragmentThe signature fragment.
Returns
The digest.

◆ digests()

std::vector<uint8_t> IOTA::Crypto::Signing::digests ( const std::vector< uint8_t > &  keyBytes)

Compute digests from key.

Parameters
keyBytesThe key in bytes.
Returns
The digests.

◆ key()

std::vector<uint8_t> IOTA::Crypto::Signing::key ( const std::vector< uint8_t > &  seedBytes,
uint32_t  index = 0,
uint32_t  security = 2 
)

Derive a private key from a seed.

Parameters
seedBytesSeed in bytes to be used for address generation.
indexThe index to start the generation from.
securityThe security to use for address generation.
Returns
The key as bytes.

◆ signatureFragment()

Types::Trits IOTA::Crypto::Signing::signatureFragment ( const std::vector< int8_t > &  normalizedBundleFragment,
const Types::Trits &  keyFragment 
)

Compute signature from bundle fragment and key fragment.

Parameters
normalizedBundleFragmentThe bundle fragment.
keyFragmentThe key fragment.
Returns
The signature fragment.

◆ validateSignatures()

bool IOTA::Crypto::Signing::validateSignatures ( const Models::Address expectedAddress,
const std::vector< Types::Trytes > &  signatureFragments,
const Types::Trytes &  bundleHash 
)

Validate signature fragments.

Parameters
expectedAddressThe expected address.
signatureFragmentsThe signature fragments.
bundleHashThe bundle hash.
Returns
whether signature fragment are valid or not.