-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Multisig * Refactoring and documentation * Increment multisig addresses security according to absorbed digests * Move signInputsAndReturn in signing namespace * Include <algorithm> * Merge address and multisig address * Include <cstdint> * Explicit type address ctor * Use a specific release of google test * SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING * Fix silence TR1 * Prevent overriding the parent project's compiler/linker settings on Windows * Set gtest_force_shared_crt before compiling * Add googletest dependency * Pass -Dgtest_force_shared_crt=ON to gtest * Add operator << to print addresses * Operator << to print seed, tag and transaction * Forward flags to gtest * Append silence TR1 to forward flags * Pass address by reference * Alignement test : removing address type * Alignement test : removing kerl * Bring back address type * Bring back kerl * Kerl as a shared_ptr * Include memory * Bring back tests * Bring back all AppVeyor builds
- Loading branch information
1 parent
985e910
commit f054dc9
Showing
20 changed files
with
544 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule googletest
updated
50 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
|
||
#pragma once | ||
|
||
#include <cstdint> | ||
#include <vector> | ||
|
||
extern "C" { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// | ||
// MIT License | ||
// | ||
// Copyright (c) 2017-2018 Thibault Martinez and Simon Ninon | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
// | ||
// | ||
|
||
#pragma once | ||
|
||
#include <iota/models/address.hpp> | ||
|
||
namespace IOTA { | ||
|
||
namespace Crypto { | ||
|
||
/** | ||
* Multi signing related functions. | ||
*/ | ||
namespace MultiSigning { | ||
|
||
/** | ||
* Derive a private key from a seed. | ||
* | ||
* @param seedBytes Seed in bytes to be used for address generation. | ||
* @param index The index to start the generation from. | ||
* @param security The security to use for address generation. | ||
* | ||
* @return The key as bytes. | ||
*/ | ||
std::vector<uint8_t> key(const std::vector<uint8_t>& seedBytes, uint32_t index, uint32_t security); | ||
|
||
/** | ||
* Compute digests from key. | ||
* | ||
* @param keyBytes The key in bytes. | ||
* | ||
* @return The digests. | ||
*/ | ||
std::vector<uint8_t> digests(const std::vector<uint8_t>& keyBytes); | ||
|
||
/** | ||
* Adds the cosigner signatures to the corresponding bundle transaction | ||
* | ||
* @param bundleToSign Bundle to be signed. | ||
* @param inputAddress Input address. | ||
* @param key Key to sign with. | ||
*/ | ||
void addSignature(Models::Bundle& bundleToSign, const Models::Address& inputAddress, | ||
const std::vector<uint8_t>& key); | ||
|
||
/** | ||
* Validate the signature fragment. | ||
* | ||
* @param signedBundle The bundle. | ||
* @param inputAddress The address. | ||
* | ||
* @return whether the signatures are valid or not. | ||
*/ | ||
bool validateSignatures(const Models::Bundle& signedBundle, const Models::Address& inputAddress); | ||
|
||
} // namespace MultiSigning | ||
|
||
} // namespace Crypto | ||
|
||
} // namespace IOTA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.