Lines Matching refs:ret

102 	int ret;
107 ret = crypto_skcipher_encrypt(req);
108 if (ret)
109 pr_err("got error %i from crypto_skcipher_encrypt()", ret);
111 return ret;
132 int ret, i;
149 ret = do_encrypt_sg(tfm, nonce, sg, orig_len);
151 return ret;
160 int ret;
162 ret = PTR_ERR_OR_ZERO(chacha20);
163 if (ret) {
164 pr_err("error requesting chacha20 cipher: %s", bch2_err_str(ret));
165 return ret;
168 ret = crypto_skcipher_setkey(&chacha20->base,
170 if (ret) {
171 pr_err("error from crypto_skcipher_setkey(): %s", bch2_err_str(ret));
175 ret = do_encrypt(chacha20, nonce, buf, len);
178 return ret;
185 int ret;
190 ret = do_encrypt(c->chacha20, nonce, key, sizeof(key));
191 if (ret)
192 return ret;
224 struct bch_csum ret = { 0 };
231 memcpy(&ret, digest, bch_crc_bytes[type]);
232 return ret;
286 struct bch_csum ret = { 0 };
305 memcpy(&ret, digest, bch_crc_bytes[type]);
306 return ret;
328 int ret = 0;
339 ret = do_encrypt_sg(c->chacha20, nonce, sgl, bytes);
340 if (ret)
341 return ret;
516 int ret;
526 ret = 0;
528 ret = -EINVAL;
533 return ret;
572 int ret;
577 ret = __bch2_request_key(key_description.buf, key);
581 if (ret) {
587 ret = 0;
593 return ret;
622 int ret = 0;
628 ret = bch2_request_key(c->disk_sb.sb, &user_key);
629 if (ret) {
630 bch_err(c, "error requesting encryption key: %s", bch2_err_str(ret));
635 ret = bch2_chacha_encrypt_key(&user_key, bch2_sb_key_nonce(c),
637 if (ret)
642 ret = -EINVAL;
650 return ret;
655 int ret;
659 ret = PTR_ERR_OR_ZERO(c->chacha20);
661 if (ret) {
662 bch_err(c, "error requesting chacha20 module: %s", bch2_err_str(ret));
663 return ret;
668 ret = PTR_ERR_OR_ZERO(c->poly1305);
670 if (ret) {
671 bch_err(c, "error requesting poly1305 module: %s", bch2_err_str(ret));
672 return ret;
682 int ret = -EINVAL;
691 ret = 0;
695 ret = bch2_decrypt_sb_key(c, crypt, &key);
696 if (ret)
707 return ret;
715 int ret = -EINVAL;
723 ret = bch2_alloc_ciphers(c);
724 if (ret)
731 ret = bch2_request_key(c->disk_sb.sb, &user_key);
732 if (ret) {
733 bch_err(c, "error requesting encryption key: %s", bch2_err_str(ret));
737 ret = bch2_chacha_encrypt_key(&user_key, bch2_sb_key_nonce(c),
739 if (ret)
743 ret = crypto_skcipher_setkey(&c->chacha20->base,
745 if (ret)
751 ret = -BCH_ERR_ENOSPC_sb_crypt;
764 return ret;
781 int ret = 0;
784 ret = PTR_ERR_OR_ZERO(c->sha256);
785 if (ret) {
786 bch_err(c, "error requesting sha256 module: %s", bch2_err_str(ret));
794 ret = bch2_alloc_ciphers(c);
795 if (ret)
798 ret = bch2_decrypt_sb_key(c, crypt, &key);
799 if (ret)
802 ret = crypto_skcipher_setkey(&c->chacha20->base,
804 if (ret)
808 return ret;