int BN_sub_word(BIGNUM *a, BN_ULONG w)
	{
	int i;
	w &= BN_MASK2;
	if (!w)
		return 1;
	if (BN_is_zero(a) || a->neg)
		{
		a->neg=0;
		i=BN_add_word(a,w);
		a->neg=1;
		return(i);
		}
	if ((a->top == 1) && (a->d[0] < w))
		{
		a->d[0]=w-a->d[0];
		a->neg=1;
		return(1);
		}
	i=0;
	for (;;)
		{
		if (a->d[i] >= w)
			{
			a->d[i]-=w;
			break;
			}
		else
			{
			a->d[i]=(a->d[i]-w)&BN_MASK2;
			i++;
			w=1;
			}
		}
	if ((a->d[i] == 0) && (i == (a->top-1)))
		a->top--;
	bn_check_top(a);
	return(1);
	}
['int BN_sub_word(BIGNUM *a, BN_ULONG w)\n\t{\n\tint i;\n\tw &= BN_MASK2;\n\tif (!w)\n\t\treturn 1;\n\tif (BN_is_zero(a) || a->neg)\n\t\t{\n\t\ta->neg=0;\n\t\ti=BN_add_word(a,w);\n\t\ta->neg=1;\n\t\treturn(i);\n\t\t}\n\tif ((a->top == 1) && (a->d[0] < w))\n\t\t{\n\t\ta->d[0]=w-a->d[0];\n\t\ta->neg=1;\n\t\treturn(1);\n\t\t}\n\ti=0;\n\tfor (;;)\n\t\t{\n\t\tif (a->d[i] >= w)\n\t\t\t{\n\t\t\ta->d[i]-=w;\n\t\t\tbreak;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\ta->d[i]=(a->d[i]-w)&BN_MASK2;\n\t\t\ti++;\n\t\t\tw=1;\n\t\t\t}\n\t\t}\n\tif ((a->d[i] == 0) && (i == (a->top-1)))\n\t\ta->top--;\n\tbn_check_top(a);\n\treturn(1);\n\t}']