fix length computation for signature