crypto: avoid undefined behavior in nettle calls