| 190 | |
| 191 | |
| 192 | const HashAlgorithmDescriptor* getHashAlgorithmDesc(thread_db* tdbb, const SysFunction* function, const dsc* algDsc, bool* cHash = nullptr) |
| 193 | { |
| 194 | bool cryptHash = (strcmp(function->name, "CRYPT_HASH") == 0); |
| 195 | if (cHash) |
| 196 | *cHash = cryptHash; |
| 197 | |
| 198 | if (!algDsc->dsc_address || !algDsc->isText()) |
| 199 | status_exception::raise(Arg::Gds(isc_sysf_invalid_hash_algorithm) << "<not a string constant>"); |
| 200 | |
| 201 | MetaName algorithmName; |
| 202 | MOV_get_metaname(tdbb, algDsc, algorithmName); |
| 203 | |
| 204 | return HashAlgorithmDescriptor::find(cryptHash ? cryptHashAlgorithmDescriptors : hashAlgorithmDescriptors, algorithmName); |
| 205 | } |
| 206 | |
| 207 | |
| 208 | // constants |