File: k12m14.hpp

package info (click to toggle)
salmon 1.10.2%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 35,580 kB
  • sloc: cpp: 199,285; ansic: 171,082; sh: 859; python: 792; makefile: 235
file content (71 lines) | stat: -rw-r--r-- 1,671 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
This code is written by kerukuro and released into public domain.
*/

#ifndef DIGESTPP_ALGORITHM_K12M14_HPP
#define DIGESTPP_ALGORITHM_K12M14_HPP

#include "../hasher.hpp"
#include "detail/k12m14_provider.hpp"
#include "mixin/k12m14_mixin.hpp"

namespace digestpp
{

/**
 * @brief KangarooTwelve function
 *
 * Extendable output function similar to SHAKE128 but with reduced number of round.
 *
 * @xof
 *
 * @mixinparams customization
 *
 * @mixin{mixin::k12m14_mixin}
 *
 * @par Example:\n
 * @code // Absorb a string and squeeze 32 bytes of output
 * digestpp::k12 hasher;
 * hasher.absorb("The quick brown fox jumps over the lazy dog");
 * std::cout << hasher.hexsqueeze(32) << '\n';
 * @endcode
 *
 * @par Example output:\n
 * @code b4f249b4f77c58df170aa4d1723db1127d82f1d98d25ddda561ada459cd11a48
 * @endcode
 *
 * @sa hasher, mixin::k12m14_mixin
 */
typedef hasher<detail::k12m14_provider<128>, mixin::k12m14_mixin> k12;

/**
 * @brief MarsupilamiFourteen function
 *
 * Extendable output function similar to KangarooTwelve, but providing 256-bit security.
 *
 * @xof
 *
 * @mixinparams customization
 *
 * @mixin{mixin::k12m14_mixin}
 *
 * @par Example:\n
 * @code // Absorb a string and squeeze 32 bytes of output
 * digestpp::m14 hasher;
 * hasher.absorb("The quick brown fox jumps over the lazy dog");
 * std::cout << hasher.hexsqueeze(32) << '\n';
 * @endcode
 *
 * @par Example output:\n
 * @code 3611bcaa666347770dbffd4562f137c5adfe2e09f3c4268ef7c7d7c0e6c5d59c
 * @endcode
 *
 * @sa hasher, mixin::k12m14_mixin
 */
typedef hasher<detail::k12m14_provider<256>, mixin::k12m14_mixin> m14;

} // namespace digestpp

#endif // DIGESTPP_ALGORITHM_K12M14_HPP