• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/amule/libcryptoxx-5.6.0/

Lines Matching refs:length

12 void AdditiveCipherTemplate<S>::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &params)
15 policy.CipherSetKey(params, key, length);
29 void AdditiveCipherTemplate<S>::GenerateBlock(byte *outString, size_t length)
33 size_t len = STDMIN(m_leftOver, length);
35 length -= len;
39 if (!length)
47 if (length >= bytesPerIteration)
49 size_t iterations = length / bytesPerIteration;
52 length -= iterations * bytesPerIteration;
55 if (length > 0)
57 size_t bufferByteSize = RoundUpToMultipleOf(length, bytesPerIteration);
61 memcpy(outString, KeystreamBufferEnd()-bufferByteSize, length);
62 m_leftOver = bufferByteSize - length;
67 void AdditiveCipherTemplate<S>::ProcessData(byte *outString, const byte *inString, size_t length)
71 size_t len = STDMIN(m_leftOver, length);
73 length -= len;
78 if (!length)
86 if (policy.CanOperateKeystream() && length >= bytesPerIteration)
88 size_t iterations = length / bytesPerIteration;
96 length -= iterations * bytesPerIteration;
98 if (!length)
105 while (length >= bufferByteSize)
109 length -= bufferByteSize;
114 if (length > 0)
116 bufferByteSize = RoundUpToMultipleOf(length, bytesPerIteration);
120 xorbuf(outString, inString, KeystreamBufferEnd()-bufferByteSize, length);
121 m_leftOver = bufferByteSize - length;
126 void AdditiveCipherTemplate<S>::Resynchronize(const byte *iv, int length)
131 policy.CipherResynchronize(m_buffer, iv, this->ThrowIfInvalidIVLength(length));
153 void CFB_CipherTemplate<BASE>::UncheckedSetKey(const byte *key, unsigned int length, const NameValuePairs &params)
156 policy.CipherSetKey(params, key, length);
169 void CFB_CipherTemplate<BASE>::Resynchronize(const byte *iv, int length)
172 policy.CipherResynchronize(iv, this->ThrowIfInvalidIVLength(length));
177 void CFB_CipherTemplate<BASE>::ProcessData(byte *outString, const byte *inString, size_t length)
179 assert(length % this->MandatoryBlockSize() == 0);
188 size_t len = STDMIN(m_leftOver, length);
191 length -= len;
196 if (!length)
201 if (policy.CanIterate() && length >= bytesPerIteration && IsAlignedOn(outString, alignment))
204 policy.Iterate(outString, inString, GetCipherDir(*this), length / bytesPerIteration);
207 memcpy(outString, inString, length);
208 policy.Iterate(outString, outString, GetCipherDir(*this), length / bytesPerIteration);
210 inString += length - length % bytesPerIteration;
211 outString += length - length % bytesPerIteration;
212 length %= bytesPerIteration;
215 while (length >= bytesPerIteration)
219 length -= bytesPerIteration;
224 if (length > 0)
227 CombineMessageAndShiftRegister(outString, reg, inString, length);
228 m_leftOver = bytesPerIteration - length;
233 void CFB_EncryptionTemplate<BASE>::CombineMessageAndShiftRegister(byte *output, byte *reg, const byte *message, size_t length)
235 xorbuf(reg, message, length);
236 memcpy(output, reg, length);
240 void CFB_DecryptionTemplate<BASE>::CombineMessageAndShiftRegister(byte *output, byte *reg, const byte *message, size_t length)
242 for (unsigned int i=0; i<length; i++)