diff options
| author | Eric Biggers <ebiggers@google.com> | 2025-04-01 21:33:33 -0700 |
|---|---|---|
| committer | Kent Overstreet <kent.overstreet@linux.dev> | 2025-04-06 19:33:53 -0400 |
| commit | 4bf4b5046de0ef7f9dc50f3a9ef8a6dcda178a6d (patch) | |
| tree | 3d60c5ee7f32d122d91f246abff05b37e4db7762 /fs/bcachefs/io_read.c | |
| parent | bcachefs: Fix duplicate "ro,read_only" in opts at startup (diff) | |
| download | linux-4bf4b5046de0ef7f9dc50f3a9ef8a6dcda178a6d.tar.gz linux-4bf4b5046de0ef7f9dc50f3a9ef8a6dcda178a6d.zip | |
bcachefs: use library APIs for ChaCha20 and Poly1305
Just use the ChaCha20 and Poly1305 libraries instead of the clunky
crypto API. This is much simpler. It is also slightly faster, since
the libraries provide more direct access to the same
architecture-optimized ChaCha20 and Poly1305 code.
I've tested that existing encrypted bcachefs filesystems can be continue
to be accessed with this patch applied.
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/io_read.c')
| -rw-r--r-- | fs/bcachefs/io_read.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/io_read.c b/fs/bcachefs/io_read.c index 417bb0c7bbfa..fd627c8d1053 100644 --- a/fs/bcachefs/io_read.c +++ b/fs/bcachefs/io_read.c @@ -977,7 +977,8 @@ retry_pick: goto err; } - if (unlikely(bch2_csum_type_is_encryption(pick.crc.csum_type)) && !c->chacha20) { + if (unlikely(bch2_csum_type_is_encryption(pick.crc.csum_type)) && + !c->chacha20_key_set) { struct printbuf buf = PRINTBUF; bch2_read_err_msg_trans(trans, &buf, orig, read_pos); prt_printf(&buf, "attempting to read encrypted data without encryption key\n "); |
