diff options
author | Mauro <you@example.com> | 2021-06-30 07:57:22 +0000 |
---|---|---|
committer | Mauro Sardara <msardara@cisco.com> | 2021-07-06 16:16:04 +0000 |
commit | 08233d44a6cfde878d7e10bca38ae935ed1c8fd5 (patch) | |
tree | 7ecc534d55bdc7e8dd15ecab084720910bcdf4d9 /libtransport/src/core/manifest_inline.h | |
parent | 147ba39bed26887f5eba84757e2463ab8e370a9a (diff) |
[HICN-713] Transport Library Major Refactoring 2
Co-authored-by: Luca Muscariello <muscariello@ieee.org>
Co-authored-by: Michele Papalini <micpapal@cisco.com>
Co-authored-by: Olivier Roques <oroques+fdio@cisco.com>
Co-authored-by: Giulio Grassi <gigrassi@cisco.com>
Signed-off-by: Mauro Sardara <msardara@cisco.com>
Change-Id: I5b2c667bad66feb45abdb5effe22ed0f6c85d1c2
Diffstat (limited to 'libtransport/src/core/manifest_inline.h')
-rw-r--r-- | libtransport/src/core/manifest_inline.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libtransport/src/core/manifest_inline.h b/libtransport/src/core/manifest_inline.h index fcb1d214f..a487ccfe3 100644 --- a/libtransport/src/core/manifest_inline.h +++ b/libtransport/src/core/manifest_inline.h @@ -48,7 +48,7 @@ class ManifestInline static TRANSPORT_ALWAYS_INLINE ManifestInline *createManifest( const core::Name &manifest_name, ManifestVersion version, - ManifestType type, auth::CryptoHashType algorithm, bool is_last, + ManifestType type, HashType algorithm, bool is_last, const Name &base_name, NextSegmentCalculationStrategy strategy, std::size_t signature_size) { auto manifest = new ManifestInline(manifest_name, signature_size); @@ -110,24 +110,24 @@ class ManifestInline // Convert several manifests into a single map from suffixes to packet hashes. // All manifests must have been decoded beforehand. - static std::unordered_map<Suffix, HashEntry> getSuffixMap( + static std::unordered_map<Suffix, Hash> getSuffixMap( const std::vector<ManifestInline *> &manifests) { - std::unordered_map<Suffix, HashEntry> suffix_map; + std::unordered_map<Suffix, Hash> suffix_map; for (auto manifest_ptr : manifests) { - HashType hash_algorithm = manifest_ptr->getHashAlgorithm(); + HashType hash_type = manifest_ptr->getHashAlgorithm(); SuffixList suffix_list = manifest_ptr->getSuffixList(); for (auto it = suffix_list.begin(); it != suffix_list.end(); ++it) { - std::vector<uint8_t> hash( - it->second, it->second + auth::hash_size_map[hash_algorithm]); - suffix_map[it->first] = {hash_algorithm, hash}; + Hash hash(it->second, Hash::getSize(hash_type), hash_type); + suffix_map[it->first] = hash; } } return suffix_map; } - static std::unordered_map<Suffix, HashEntry> getSuffixMap( + + static std::unordered_map<Suffix, Hash> getSuffixMap( ManifestInline *manifest) { return getSuffixMap(std::vector<ManifestInline *>{manifest}); } |