git: dm_target_crypt_ng - Improve crypto_cipher API

Michael Neumann mneumann at crater.dragonflybsd.org
Sat Apr 12 03:28:40 PDT 2025


commit 74ee00299129e5fc6b026e657a05dea82e26a211
Author: Michael Neumann <mneumann at ntecs.de>
Date:   Fri Apr 11 23:14:47 2025 +0200

    dm_target_crypt_ng - Improve crypto_cipher API
    
    * Introduce sessions - crypto_cipher_initsession() and
      crypto_cipher_freesession().
    
    * This allows us to hide (most) implementation details.
    
    * Expose public functions `crypto_cipher_` instead of calling the
      function pointers from crypto_cipher directly. Required to hide
      implementation details.
    
    * Move error checking into the API layer. Cipher implementations can
      assume that the context is correctly memory aligned and the block
      size matches that of the algorithm.

Summary of changes:
 sys/dev/disk/dm/crypt_ng/crypto_cipher.c   | 449 ++++++++++++++++++-----------
 sys/dev/disk/dm/crypt_ng/crypto_cipher.h   |  88 +++---
 sys/dev/disk/dm/crypt_ng/dm_target_crypt.c |  61 ++--
 3 files changed, 358 insertions(+), 240 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/74ee00299129e5fc6b026e657a05dea82e26a211


-- 
DragonFly BSD source repository


More information about the Commits mailing list