I noticed that Session::sign(), and the alternative sign_init()/sign_update()/sign_final() methods, always perform heap allocations (sign() and sign_final() both return Vec). At least for my use case, I already know which cryptographic algorithm is being used, so I know exactly how big the resulting signature should be. I'd like to have non-allocating methods, where I can pass in a buffer of a pre-determined size, just for efficiency.
This concern probably extends to all the other PKCS#11 operations. If this feels like a worthwhile change, I'm happy to put up PRs (at least for a few interesting operations). But I wanted to check in before getting started.
I noticed that
Session::sign(), and the alternativesign_init()/sign_update()/sign_final()methods, always perform heap allocations (sign()andsign_final()both returnVec). At least for my use case, I already know which cryptographic algorithm is being used, so I know exactly how big the resulting signature should be. I'd like to have non-allocating methods, where I can pass in a buffer of a pre-determined size, just for efficiency.This concern probably extends to all the other PKCS#11 operations. If this feels like a worthwhile change, I'm happy to put up PRs (at least for a few interesting operations). But I wanted to check in before getting started.