forked from lthn/blockchain
crypto: hs(str, s, pk) added
This commit is contained in:
parent
3be48761a6
commit
7e9c24d4b9
1 changed files with 11 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// Copyright (c) 2020-2023 Zano Project
|
||||
// Copyright (c) 2020-2023 sowle (val@zano.org, crypto.sowle@gmail.com)
|
||||
// Copyright (c) 2020-2024 Zano Project
|
||||
// Copyright (c) 2020-2024 sowle (val@zano.org, crypto.sowle@gmail.com)
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
//
|
||||
|
|
@ -1342,6 +1342,15 @@ namespace crypto
|
|||
return hs_calculator.calc_hash();
|
||||
}
|
||||
|
||||
static scalar_t hs(const char(&str32)[32], const scalar_t& s, const crypto::public_key& pk)
|
||||
{
|
||||
hs_t hs_calculator(2);
|
||||
hs_calculator.add_32_chars(str32);
|
||||
hs_calculator.add_scalar(s);
|
||||
hs_calculator.add_pub_key(pk);
|
||||
return hs_calculator.calc_hash();
|
||||
}
|
||||
|
||||
static scalar_t hs(const crypto::public_key& pk, const uint64_t i)
|
||||
{
|
||||
hs_t hs_calculator(2);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue