Lines Matching refs:crypt

491 	struct bch_sb_field_crypt *crypt = field_to_type(f, crypt);  in bch2_sb_crypt_validate()  local
493 if (vstruct_bytes(&crypt->field) < sizeof(*crypt)) { in bch2_sb_crypt_validate()
495 vstruct_bytes(&crypt->field), sizeof(*crypt)); in bch2_sb_crypt_validate()
499 if (BCH_CRYPT_KDF_TYPE(crypt)) { in bch2_sb_crypt_validate()
500 prt_printf(err, "bad kdf type %llu", BCH_CRYPT_KDF_TYPE(crypt)); in bch2_sb_crypt_validate()
510 struct bch_sb_field_crypt *crypt = field_to_type(f, crypt); in bch2_sb_crypt_to_text() local
512 prt_printf(out, "KFD: %llu\n", BCH_CRYPT_KDF_TYPE(crypt)); in bch2_sb_crypt_to_text()
513 prt_printf(out, "scrypt n: %llu\n", BCH_KDF_SCRYPT_N(crypt)); in bch2_sb_crypt_to_text()
514 prt_printf(out, "scrypt r: %llu\n", BCH_KDF_SCRYPT_R(crypt)); in bch2_sb_crypt_to_text()
515 prt_printf(out, "scrypt p: %llu\n", BCH_KDF_SCRYPT_P(crypt)); in bch2_sb_crypt_to_text()
629 struct bch_sb_field_crypt *crypt, in bch2_decrypt_sb_key() argument
632 struct bch_encrypted_key sb_key = crypt->key; in bch2_decrypt_sb_key()
692 struct bch_sb_field_crypt *crypt; in bch2_disable_encryption() local
698 crypt = bch2_sb_field_get(c->disk_sb.sb, crypt); in bch2_disable_encryption()
699 if (!crypt) in bch2_disable_encryption()
704 if (bch2_key_is_encrypted(&crypt->key)) in bch2_disable_encryption()
707 ret = bch2_decrypt_sb_key(c, crypt, &key); in bch2_disable_encryption()
711 crypt->key.magic = cpu_to_le64(BCH_KEY_MAGIC); in bch2_disable_encryption()
712 crypt->key.key = key; in bch2_disable_encryption()
726 struct bch_sb_field_crypt *crypt; in bch2_enable_encryption() local
732 if (bch2_sb_field_get(c->disk_sb.sb, crypt)) in bch2_enable_encryption()
760 crypt = bch2_sb_field_resize(&c->disk_sb, crypt, in bch2_enable_encryption()
761 sizeof(*crypt) / sizeof(u64)); in bch2_enable_encryption()
762 if (!crypt) { in bch2_enable_encryption()
767 crypt->key = key; in bch2_enable_encryption()
791 struct bch_sb_field_crypt *crypt; in bch2_fs_encryption_init() local
803 crypt = bch2_sb_field_get(c->disk_sb.sb, crypt); in bch2_fs_encryption_init()
804 if (!crypt) in bch2_fs_encryption_init()
811 ret = bch2_decrypt_sb_key(c, crypt, &key); in bch2_fs_encryption_init()