const byte * SimpleKeyingInterface::GetIVAndThrowIfInvalid(const NameValuePairs ¶ms, size_t &size) { ConstByteArrayParameter ivWithLength; const byte *iv; bool found = false; try {found = params.GetValue(Name::IV(), ivWithLength);} catch (const NameValuePairs::ValueTypeMismatch &) {} if (found) { iv = ivWithLength.begin(); ThrowIfInvalidIV(iv); size = ThrowIfInvalidIVLength((int)ivWithLength.size()); return iv; } else if (params.GetValue(Name::IV(), iv)) { ThrowIfInvalidIV(iv); size = IVSize(); return iv; } else { ThrowIfResynchronizable(); size = 0; return NULL; } }
const byte * SimpleKeyingInterface::GetIVAndThrowIfInvalid(const NameValuePairs ¶ms) { const byte *iv; if (params.GetValue(Name::IV(), iv)) ThrowIfInvalidIV(iv); else ThrowIfResynchronizable(); return iv; }