introduce allocation wrappers to improve libgcrypt performance