Rename PRV_DIVERSIFIER to PRF_TAG

Co-authored-by: str4d <thestr4d@gmail.com>
This commit is contained in:
ying tong 2020-08-20 10:44:45 +08:00 committed by therealyingtong
parent edcecc8a31
commit 2f2c8ea5f3
No known key found for this signature in database
GPG Key ID: 179F32A1503D607E
2 changed files with 10 additions and 10 deletions

View File

@ -27,7 +27,7 @@ std::array<unsigned char, 64> PRF_expand(const uint256& sk, unsigned char t)
uint256 PRF_rcm(const uint256& rseed)
{
uint256 rcm;
auto tmp = PRF_expand(rseed, PRF_RCM_DIVERSIFIER);
auto tmp = PRF_expand(rseed, PRF_RCM_TAG);
librustzcash_to_scalar(tmp.data(), rcm.begin());
return rcm;
}
@ -35,7 +35,7 @@ uint256 PRF_rcm(const uint256& rseed)
uint256 PRF_esk(const uint256& rseed)
{
uint256 esk;
auto tmp = PRF_expand(rseed, PRF_ESK_DIVERSIFIER);
auto tmp = PRF_expand(rseed, PRF_ESK_TAG);
librustzcash_to_scalar(tmp.data(), esk.begin());
return esk;
}
@ -43,7 +43,7 @@ uint256 PRF_esk(const uint256& rseed)
uint256 PRF_ask(const uint256& sk)
{
uint256 ask;
auto tmp = PRF_expand(sk, PRF_ASK_DIVERSIFIER);
auto tmp = PRF_expand(sk, PRF_ASK_TAG);
librustzcash_to_scalar(tmp.data(), ask.begin());
return ask;
}
@ -51,7 +51,7 @@ uint256 PRF_ask(const uint256& sk)
uint256 PRF_nsk(const uint256& sk)
{
uint256 nsk;
auto tmp = PRF_expand(sk, PRF_NSK_DIVERSIFIER);
auto tmp = PRF_expand(sk, PRF_NSK_TAG);
librustzcash_to_scalar(tmp.data(), nsk.begin());
return nsk;
}
@ -59,7 +59,7 @@ uint256 PRF_nsk(const uint256& sk)
uint256 PRF_ovk(const uint256& sk)
{
uint256 ovk;
auto tmp = PRF_expand(sk, PRF_OVK_DIVERSIFIER);
auto tmp = PRF_expand(sk, PRF_OVK_TAG);
memcpy(ovk.begin(), tmp.data(), 32);
return ovk;
}

View File

@ -25,11 +25,11 @@ uint256 PRF_ovk(const uint256& sk);
uint256 PRF_rcm(const uint256& rseed);
uint256 PRF_esk(const uint256& rseed);
const char PRF_ASK_DIVERSIFIER = 0;
const char PRF_NSK_DIVERSIFIER = 1;
const char PRF_OVK_DIVERSIFIER = 2;
const char PRF_RCM_DIVERSIFIER = 4;
const char PRF_ESK_DIVERSIFIER = 5;
const char PRF_ASK_TAG = 0;
const char PRF_NSK_TAG = 1;
const char PRF_OVK_TAG = 2;
const char PRF_RCM_TAG = 4;
const char PRF_ESK_TAG = 5;
std::array<unsigned char, 11> default_diversifier(const uint256& sk);