lib/crypto: Remove unused file blockhash.h
PATCH 1/1 lib/crypto: Remove unused file blockhash.h
For a short time this file was used by the SHA-256 and Poly1305 library code, but they are no longer using it. Remove this unused file.
---
This patch is targeting libcrypto-next
include/crypto/internal/blockhash.h | 52 ----------------------------- 1 file changed, 52 deletions(-) delete mode 100644 include/crypto/internal/blockhash.h
include/crypto/internal/blockhash.h deleted +0 -52
@@ -1,52 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* -* Handle partial blocks for block hash. -* -* Copyright (c) 2015 Linaro Ltd <[email protected]> -* Copyright (c) 2025 Herbert Xu <[email protected]> -*/ - -#ifndef _CRYPTO_INTERNAL_BLOCKHASH_H -#define _CRYPTO_INTERNAL_BLOCKHASH_H - -#include <linux/string.h> -#include <linux/types.h> - -#define BLOCK_HASH_UPDATE_BASE (block_fn, state, src, nbytes, bs, dv, \ - buf, buflen) \ - ({ \ - typeof(block_fn) *_block_fn = &(block_fn); \ - typeof(state + 0) _state = (state); \ - unsigned int _buflen = (buflen); \ - size_t _nbytes = (nbytes); \ - unsigned int _bs = (bs); \ - const u8 *_src = (src); \ - u8 *_buf = (buf); \ - while ((_buflen + _nbytes) >= _bs) { \ - const u8 *data = _src; \ - size_t len = _nbytes; \ - size_t blocks; \ - int remain; \ - if (_buflen) { \ - remain = _bs - _buflen; \ - memcpy(_buf + _buflen, _src, remain); \ - data = _buf; \ - len = _bs; \ - } \ - remain = len % bs; \ - blocks = (len - remain) / (dv); \ - (*_block_fn)(_state, data, blocks); \ - _src += len - remain - _buflen; \ - _nbytes -= len - remain - _buflen; \ - _buflen = 0; \ - } \ - memcpy(_buf + _buflen, _src, _nbytes); \ - _buflen += _nbytes; \ - }) - -#define BLOCK_HASH_UPDATE (block, state, src, nbytes, bs, buf, buflen) \ - BLOCK_HASH_UPDATE_BASE(block, state, src, nbytes, bs, 1, buf, buflen) -#define BLOCK_HASH_UPDATE_BLOCKS (block, state, src, nbytes, bs, buf, buflen) \ - BLOCK_HASH_UPDATE_BASE(block, state, src, nbytes, bs, bs, buf, buflen) - -#endif /* _CRYPTO_INTERNAL_BLOCKHASH_H */
base-commit: ce260754bb435aea18e6a1a1ce3759249013f5a4
Signature · 1 line
2.53.0
Quoted 12 lines · Eric Biggers
For a short time this file was used by the SHA-256 and Poly1305 library code, but they are no longer using it. Remove this unused file.
Signed-off-by Eric Biggers <[email protected]>---
This patch is targeting libcrypto-next
include/crypto/internal/blockhash.h | 52 ----------------------------- 1 file changed, 52 deletions(-) delete mode 100644 include/crypto/internal/blockhash.h
Quoted 64 lines
include/crypto/internal/blockhash.h deleted +0
-49@@ -1,52 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* -* Handle partial blocks for block hash. -* -* Copyright (c) 2015 Linaro Ltd <[email protected]> -* Copyright (c) 2025 Herbert Xu <[email protected]> -*/ - -#ifndef _CRYPTO_INTERNAL_BLOCKHASH_H -#define _CRYPTO_INTERNAL_BLOCKHASH_H - -#include <linux/string.h> -#include <linux/types.h> - -#define BLOCK_HASH_UPDATE_BASE (block_fn, state, src, nbytes, bs, dv, \ - buf, buflen) \ - ({ \ - typeof(block_fn) *_block_fn = &(block_fn); \ - typeof(state + 0) _state = (state); \ - unsigned int _buflen = (buflen); \ - size_t _nbytes = (nbytes); \ - unsigned int _bs = (bs); \ - const u8 *_src = (src); \ - u8 *_buf = (buf); \ - while ((_buflen + _nbytes) >= _bs) { \ - const u8 *data = _src; \ - size_t len = _nbytes; \ - size_t blocks; \ - int remain; \ - if (_buflen) { \ - remain = _bs - _buflen; \ - memcpy(_buf + _buflen, _src, remain); \ - data = _buf; \ - len = _bs; \ - } \ - remain = len % bs; \ - blocks = (len - remain) / (dv); \ - (*_block_fn)(_state, data, blocks); \ - _src += len - remain - _buflen; \ - _nbytes -= len - remain - _buflen; \ - _buflen = 0; \ - } \ - memcpy(_buf + _buflen, _src, _nbytes); \ - _buflen += _nbytes; \ - }) - -#define BLOCK_HASH_UPDATE (block, state, src, nbytes, bs, buf, buflen) \ - BLOCK_HASH_UPDATE_BASE(block, state, src, nbytes, bs, 1, buf, buflen) -#define BLOCK_HASH_UPDATE_BLOCKS(block, state, src, nbytes, bs, buf,buflen) \
include/crypto/internal/blockhash.h deleted +0
-3- BLOCK_HASH_UPDATE_BASE(block, state, src, nbytes, bs, bs, buf, buflen) - -#endif /* _CRYPTO_INTERNAL_BLOCKHASH_H */ base-commit:
ce260754bb435aea18e6a1a1ce3759249013f5a4Signature · 1 line
2.53.0
Eric Biggers
AppliedQuoted 7 lines · Eric Biggers
For a short time this file was used by the SHA-256 and Poly1305 library code, but they are no longer using it. Remove this unused file.
Signed-off-by Eric Biggers <[email protected]>---
This patch is targeting libcrypto-next
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=libcrypto-next
- Eric