25 #ifndef CRYPTO3_STREAM_ENCRYPT_HPP
26 #define CRYPTO3_STREAM_ENCRYPT_HPP
53 template<
typename StreamCipher,
typename InputIterator,
typename KeyIterator,
typename OutputIterator>
54 OutputIterator
encrypt(InputIterator first, InputIterator last, KeyIterator key_first, KeyIterator key_last,
57 typedef typename StreamCipher::stream_encrypter_type EncryptionMode;
63 return EncrypterImpl(first, last,
std::move(out), CiperState(StreamCipher(key_first, key_last)));
81 template<
typename StreamCipher,
typename InputIterator,
82 typename OutputAccumulator =
83 typename stream::stream_accumulator<typename StreamCipher::stream_encrypter_type>>
84 OutputAccumulator &
encrypt(InputIterator first, InputIterator last, OutputAccumulator &acc) {
86 typedef typename StreamCipher::stream_encrypter_type EncryptionMode;
92 return EncrypterImpl(first, last, acc);
109 template<
typename StreamCipher,
typename SinglePassRange,
110 typename OutputAccumulator =
111 typename stream::stream_accumulator<typename StreamCipher::stream_encrypter_type>>
112 OutputAccumulator &
encrypt(
const SinglePassRange &r, OutputAccumulator &acc) {
114 typedef typename StreamCipher::stream_encrypter_type EncryptionMode;
120 return EncrypterImpl(r, acc);
140 template<
typename StreamCipher,
typename InputIterator,
typename KeyIterator,
141 typename CipherAccumulator =
142 typename stream::stream_accumulator<typename StreamCipher::stream_encrypter_type>>
143 stream::detail::range_cipher_impl<stream::detail::value_cipher_impl<CipherAccumulator>>
144 encrypt(InputIterator first, InputIterator last, KeyIterator key_first, KeyIterator key_last) {
148 return EncrypterImpl(first, last, CipherAccumulator(StreamCipher(key_first, key_last)));
167 template<
typename StreamCipher,
typename SinglePassRange,
typename KeyRange,
typename OutputIterator>
168 OutputIterator
encrypt(
const SinglePassRange &rng,
const KeyRange &key, OutputIterator out) {
170 typedef typename StreamCipher::stream_encrypter_type EncryptionMode;
176 return EncrypterImpl(rng,
std::move(out), CipherState(StreamCipher(key)));
194 template<
typename StreamCipher,
typename SinglePassRange,
typename KeyRange,
195 typename CipherAccumulator =
196 typename stream::stream_accumulator<typename StreamCipher::stream_encrypter_type>>
197 stream::detail::range_cipher_impl<stream::detail::value_cipher_impl<CipherAccumulator>>
198 encrypt(
const SinglePassRange &r,
const KeyRange &key) {
203 return EncrypterImpl(r, CipherState(StreamCipher(key)));
OutputIterator encrypt(InputIterator first, InputIterator last, KeyInputIterator key_first, KeyInputIterator key_last, OutputIterator out)
Definition: block/include/nil/crypto3/block/algorithm/encrypt.hpp:66
OutputIterator move(const SinglePassRange &rng, OutputIterator result)
Definition: move.hpp:45
boost::accumulators::accumulator_set< digest< ProcessingMode::input_stream_bits >, boost::accumulators::features< accumulators::tag::stream< ProcessingMode > >> stream_accumulator
Cipher state managing container.
Definition: stream/include/nil/crypto3/stream/cipher_state.hpp:49
Definition: stream/include/nil/crypto3/stream/cipher_value.hpp:161
Definition: stream/include/nil/crypto3/stream/cipher_value.hpp:73
Definition: stream/include/nil/crypto3/stream/cipher_value.hpp:43
Definition: stream/include/nil/crypto3/stream/cipher_value.hpp:58