diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-06-04 14:59:22 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-07-29 12:18:42 +0200 |
commit | 76c96fad246393f205e4ad4fdc1abb98582a1849 (patch) | |
tree | 13ef27476346907f4b9b073fed09e68ae3d8570e /src/util | |
parent | 8d1e83097d360916c07552b7765339727760e2a8 (diff) |
move ID computation into libtalerutil
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/crypto.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/util/crypto.c b/src/util/crypto.c index 4735af3b0..be361ea31 100644 --- a/src/util/crypto.c +++ b/src/util/crypto.c @@ -541,4 +541,29 @@ TALER_denomination_group_get_key ( } +void +TALER_kyc_measure_authorization_hash ( + const struct TALER_AccountAccessTokenP *access_token, + uint64_t row, + uint32_t offset, + struct TALER_KycMeasureAuthorizationHash *mah) +{ + uint64_t be64 = GNUNET_htonll (row); + uint32_t be32 = htonl ((uint32_t) offset); + + GNUNET_assert ( + GNUNET_YES == + GNUNET_CRYPTO_kdf (mah, + sizeof (*mah), + &be64, + sizeof (be64), + access_token, + sizeof (*access_token), + &be32, + sizeof (be32), + NULL, + 0)); +} + + /* end of crypto.c */ |