| 591 | }; |
| 592 | |
| 593 | bool FSCryptDenc::do_setup_cipher(int enc_mode) |
| 594 | { |
| 595 | auto iter = cipher_opt_map.find(enc_mode); |
| 596 | if (iter == cipher_opt_map.end()) { |
| 597 | return false; |
| 598 | } |
| 599 | |
| 600 | auto& opts = iter->second; |
| 601 | if (opts.cts_mode) { |
| 602 | init_cipher(EVP_CIPHER_fetch(NULL, opts.str, NULL), |
| 603 | { OSSL_PARAM_construct_utf8_string(OSSL_CIPHER_PARAM_CTS_MODE, (char *)"CS3", 0), |
| 604 | OSSL_PARAM_construct_end()} ); |
| 605 | } else { |
| 606 | init_cipher(EVP_CIPHER_fetch(NULL, opts.str, NULL), {} ); |
| 607 | } |
| 608 | |
| 609 | key_size = opts.key_size; |
| 610 | iv_size = opts.iv_size; |
| 611 | |
| 612 | return true; |
| 613 | } |
| 614 | |
| 615 | bool FSCryptFNameDenc::setup_cipher() |
| 616 | { |