XPost: linux.debian.kernel
Control: tag -1 - moreinfo
On Wed, Jul 09, 2025 at 06:15:10PM +0200, Ben Hutchings wrote:
What does the actual declaration of this function look like, and what toolchain are you using to compile it?
I get this out of src:botan3 3.7.1+dfsg-2 src/lib/modes/cbc/cbc.cpp
when building with clang trunk (21.0.0 (++20250519112653+d0ee35851bb9-1~exp1~20250519112844.1459))
(from
http://apt.llvm.org/bookworm/)
when configuring as ./configure.py --minimized-build --enable-modules cbc,twofish
then building with make build/obj/lib/modes_cbc.o
The construction looks like
class secure_allocator { /* ... */ };
using secure_vector = std::vector<T, secure_allocator<T>>;
class BOTAN_PUBLIC_API(2, 0) Cipher_Mode : public SymmetricAlgorithm {
template <concepts::resizable_byte_buffer T>
void update(T& buffer, size_t offset = 0) {
// ...
}
}
class CBC_Mode : public Cipher_Mode {}
class CBC_Encryption : public CBC_Mode {
private:
void finish_msg(secure_vector<uint8_t>& final_block, size_t offset = 0) override;
}
void CBC_Encryption::finish_msg(secure_vector<uint8_t>& buffer, size_t offset) {
// ...
update(buffer, offset);
}
(there's some other callers but they all use the same update overload).
On Thu, 19 Jun 2025 16:09:24 +0200 =?utf-8?B?0L3QsNCx?= <[email protected]> wrote:
+ 89.76% 0.00% bench bench [.] _ZN5Botan11Cipher_Mode6updateITkNS_8concepts21resizable_byte_bufferESt6vectorIhNS_16secure_allocatorIhEEEEEvRT_m
The llvm-cxxfilt command demangles it to "void Botan::Cipher_Mode::update<std::vector<unsigned char, Botan::secure_allocator<unsigned char>>>(std::vector<unsigned char, Botan::secure_allocator<unsigned char>>&, unsigned long)" but it seems
to be ignoring part of the symbol, specifically "Botan::concepts::resizable_byte_buffer".
So the full declaration will be something like
template<concepts::resizable_byte_buffer = std::vector<unsigned char, Botan::secure_allocator<unsigned char>>> // except as an instantiation, not a default
void Botan::Cipher_Mode::update(std::vector<unsigned char, Botan::secure_allocator<unsigned char>>, unsigned long);
so llvm-cxxfilt gets it mostly right.
I don't really see why the concept bit is in there either,
it feels like it ought to be immaterial?
If I delete the "Tk" from the mangled symbol then they all agree it
should be demangled to "void
Botan::Cipher_Mode::update<std::vector<unsigned char, Botan::secure_allocator<unsigned char>>>(std::vector<unsigned char, Botan::secure_allocator<unsigned char>>&, unsigned long)".
This must mean that's "The koncept" as an extension, then, clearly?
Maybe this wants to get forwarded to LLVM more-so than anything else.
Building with bookworm GCC doesn't give give me any symbols
matching /update/ except for an update_granularity.
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEfWlHToQCjFzAxEFjvP0LAY0mWPEFAmhuo+8ACgkQvP0LAY0m WPGDbQ//Y9SZeoBnJmB2OzvATmxXv5jVsDRA2JivHn/BMUGhqdpI2cYdGze2gtVw 7+JiWDwteBYdu2YjUIXymVjiR9To49aZuVvx0tXGaT3XMWbMn2l/5yMlem5cAzlZ 8y61tVhnfwgatXTfWigWMmYEyTbXjH9/Qu8vvNv4gspFE3iukcRCt/sesOweBnCA zVIV3MkyYZ67AxR1YclHV64A/Kmn5PXZh9G9foaHDytaCM5Hp8rXaN8bZuURI6TK /AURoueWifFzI4hc34qHliczjv2I+071mi3Zu7hkj2qp6PzLvaP2H5S6G6hbwesL dI/XD1OLY/+Pa1sLxtC87Aiwqf9zQWipOio3u0CXNCr+PTuTiLBH448l8GtLkV2H KfEgaiGcQO72AhWzQ9NTl2/u/F8mNGoLe016ZbNNyescvn3Y3Uc5t6Dg7OdrBqhB bmYm3HHtxd6DiFvu8RcUjxosxeo/vl/7y0eMm7kPxN/psNrvz+mNz68rUq7XReAE dw8v4CW/siNZ5XsiPSJZ0OwJbLfPKAGVeG1twDpXMgosVYEBGZlYxoz0tiaVQfIZ 3uSMqhsa2Z0U1brdwCJ8yZV9nC+vlxqocRKW47UJiLKtk+3sGXKPIMC19/45attU HQ1xXCIB1peMNvqEseM2YP718o+zBjGR90U3dNZfx3rl0Y91g/0=
=xcSB
-----END PGP SIGNATURE-----
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)