Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit 9932c6d

Browse files
committed
More minor changes done #3
1 parent d0623e8 commit 9932c6d

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

include/nil/crypto3/block/algorithm/encrypt.hpp

+7-9
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,8 @@ namespace nil {
9898
typename KeyIterator,
9999
typename CipherAccumulator = typename block::block_accumulator<
100100
typename BlockCipher::stream_encoder_type>>
101-
detail::range_encrypter_impl<detail::value_encrypter_impl<CipherAccumulator>> encrypt(InputIterator first,
102-
InputIterator last,
103-
KeyIterator key_first,
104-
KeyIterator key_last) {
101+
block::detail::range_encrypter_impl<block::detail::value_encrypter_impl<CipherAccumulator>> encrypt(
102+
InputIterator first, InputIterator last, KeyIterator key_first, KeyIterator key_last) {
105103
typedef block::detail::value_encrypter_impl<CipherAccumulator> StreamEncrypterImpl;
106104
typedef block::detail::range_encrypter_impl<StreamEncrypterImpl> EncrypterImpl;
107105

@@ -124,8 +122,8 @@ namespace nil {
124122
template<typename BlockCipher, typename SinglePassRange, typename KeyRange, typename OutputIterator>
125123
OutputIterator encrypt(const SinglePassRange &rng, const KeyRange &key, OutputIterator out) {
126124

127-
typedef typename detail::range_stream_encrypter_traits<typename BlockCipher::stream_encrypter_type,
128-
SinglePassRange>::type CipherState;
125+
typedef typename block::detail::range_stream_encrypter_traits<typename BlockCipher::stream_encrypter_type,
126+
SinglePassRange>::type CipherState;
129127

130128
typedef block::detail::value_encrypter_impl<CipherState> StreamEncrypterImpl;
131129
typedef block::detail::itr_encrypter_impl<StreamEncrypterImpl, OutputIterator> EncrypterImpl;
@@ -147,10 +145,10 @@ namespace nil {
147145
template<typename BlockCipher,
148146
typename SinglePassRange,
149147
typename KeyRange,
150-
typename CipherState = typename detail::range_stream_encrypter_traits<
148+
typename CipherState = typename block::detail::range_stream_encrypter_traits<
151149
typename BlockCipher::stream_encrypter_type, SinglePassRange>::type>
152-
detail::range_encrypter_impl<detail::value_encrypter_impl<CipherState>> encrypt(const SinglePassRange &r,
153-
const KeyRange &key) {
150+
block::detail::range_encrypter_impl<detail::value_encrypter_impl<CipherState>> encrypt(const SinglePassRange &r,
151+
const KeyRange &key) {
154152

155153
typedef block::detail::value_encrypter_impl<CipherState> StreamEncrypterImpl;
156154
typedef block::detail::range_encrypter_impl<StreamEncrypterImpl> EncrypterImpl;

include/nil/crypto3/block/detail/sm4/sm4_functions.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace nil {
2626
typedef std::array<word_type, constants_size> transposed_constants_type;
2727

2828
inline static word_type t_slow(word_type b, const constants_type &constants) {
29-
const word_type t = basic_functions<WordBits>::make_uint_t<32>(
29+
const word_type t = basic_functions<WordBits>::make_uint_t<WordBits>(
3030
constants[basic_functions<WordBits>::extract_uint_t<CHAR_BIT>(b, 0)],
3131
constants[basic_functions<WordBits>::extract_uint_t<CHAR_BIT>(b, 1)],
3232
constants[basic_functions<WordBits>::extract_uint_t<CHAR_BIT>(b, 2)],
@@ -49,7 +49,7 @@ namespace nil {
4949

5050
// Variant of T for key round_constants_words
5151
inline static word_type tp(word_type b, const constants_type &constants) {
52-
const uint32_t t = basic_functions<WordBits>::make_uint_t<32>(
52+
const word_type t = basic_functions<WordBits>::make_uint_t<WordBits>(
5353
constants[basic_functions<WordBits>::extract_uint_t<CHAR_BIT>(b, 0)],
5454
constants[basic_functions<WordBits>::extract_uint_t<CHAR_BIT>(b, 1)],
5555
constants[basic_functions<WordBits>::extract_uint_t<CHAR_BIT>(b, 2)],

0 commit comments

Comments
 (0)