Skip to content

Commit

Permalink
Change hmac_xxx classes to aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Oct 21, 2024
1 parent da1d14e commit 8f65ea2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 134 deletions.
17 changes: 1 addition & 16 deletions include/boost/hash2/md5.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,22 +321,7 @@ class md5_128
}
};

class hmac_md5_128: public hmac<md5_128>
{
public:

hmac_md5_128()
{
}

explicit hmac_md5_128( std::uint64_t seed ): hmac<md5_128>( seed )
{
}

hmac_md5_128( unsigned char const * p, std::size_t n ): hmac<md5_128>( p, n )
{
}
};
using hmac_md5_128 = hmac<md5_128>;

} // namespace hash2
} // namespace boost
Expand Down
17 changes: 1 addition & 16 deletions include/boost/hash2/sha1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,22 +318,7 @@ class sha1_160
}
};

class hmac_sha1_160: public hmac<sha1_160>
{
public:

hmac_sha1_160()
{
}

explicit hmac_sha1_160( std::uint64_t seed ): hmac<sha1_160>( seed )
{
}

hmac_sha1_160( unsigned char const * p, std::size_t n ): hmac<sha1_160>( p, n )
{
}
};
using hmac_sha1_160 = hmac<sha1_160>;

} // namespace hash2
} // namespace boost
Expand Down
108 changes: 6 additions & 102 deletions include/boost/hash2/sha2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -764,108 +764,12 @@ class sha2_512_256 : detail::sha2_512_base

// hmac wrappers

class hmac_sha2_256 : public hmac<sha2_256>
{
public:

hmac_sha2_256()
{
}

explicit hmac_sha2_256( std::uint64_t seed ): hmac<sha2_256>( seed )
{
}

hmac_sha2_256( unsigned char const * p, std::size_t n ): hmac<sha2_256>( p, n )
{
}
};

class hmac_sha2_224 : public hmac<sha2_224>
{
public:

hmac_sha2_224()
{
}

explicit hmac_sha2_224( std::uint64_t seed ): hmac<sha2_224>( seed )
{
}

hmac_sha2_224( unsigned char const * p, std::size_t n ): hmac<sha2_224>( p, n )
{
}
};

class hmac_sha2_512 : public hmac<sha2_512>
{
public:

hmac_sha2_512()
{
}

explicit hmac_sha2_512( std::uint64_t seed ): hmac<sha2_512>( seed )
{
}

hmac_sha2_512( unsigned char const * p, std::size_t n ): hmac<sha2_512>( p, n )
{
}
};

class hmac_sha2_384 : public hmac<sha2_384>
{
public:

hmac_sha2_384()
{
}

explicit hmac_sha2_384( std::uint64_t seed ): hmac<sha2_384>( seed )
{
}

hmac_sha2_384( unsigned char const * p, std::size_t n ): hmac<sha2_384>( p, n )
{
}
};

class hmac_sha2_512_224 : public hmac<sha2_512_224>
{
public:

hmac_sha2_512_224()
{
}

explicit hmac_sha2_512_224( std::uint64_t seed ): hmac<sha2_512_224>( seed )
{
}

hmac_sha2_512_224( unsigned char const * p, std::size_t n ): hmac<sha2_512_224>( p, n )
{
}
};

class hmac_sha2_512_256 : public hmac<sha2_512_256>
{
public:

hmac_sha2_512_256()
{
}

explicit hmac_sha2_512_256( std::uint64_t seed ): hmac<sha2_512_256>( seed )
{
}

hmac_sha2_512_256( unsigned char const * p, std::size_t n ): hmac<sha2_512_256>( p, n )
{
}
};

using hmac_sha2_256 = hmac<sha2_256>;
using hmac_sha2_224 = hmac<sha2_224>;
using hmac_sha2_512 = hmac<sha2_512>;
using hmac_sha2_384 = hmac<sha2_384>;
using hmac_sha2_512_224 = hmac<sha2_512_224>;
using hmac_sha2_512_256 = hmac<sha2_512_256>;

} // namespace hash2
} // namespace boost
Expand Down

0 comments on commit 8f65ea2

Please sign in to comment.