summaryrefslogtreecommitdiff
path: root/usr/src/lib/libresolv2/common/dnssafe/bigconst.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libresolv2/common/dnssafe/bigconst.c')
-rw-r--r--usr/src/lib/libresolv2/common/dnssafe/bigconst.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/usr/src/lib/libresolv2/common/dnssafe/bigconst.c b/usr/src/lib/libresolv2/common/dnssafe/bigconst.c
new file mode 100644
index 0000000000..e4754cb60d
--- /dev/null
+++ b/usr/src/lib/libresolv2/common/dnssafe/bigconst.c
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 1999 by Sun Microsystems, Inc.
+ * All rights reserved.
+ */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/* Copyright (C) RSA Data Security, Inc. created 1986, 1996. This is an
+ unpublished work protected as such under copyright law. This work
+ contains proprietary, confidential, and trade secret information of
+ RSA Data Security, Inc. Use, disclosure or reproduction without the
+ express written authorization of RSA Data Security, Inc. is
+ prohibited.
+ */
+
+#include "port_before.h"
+#include "global.h"
+#include "bigmath.h"
+#include "port_after.h"
+
+/* BigConst (a, v, n) -- a = v, where v is an int. Initialize bignum a to
+ value v.
+ */
+void BigConst (a, v, n)
+UINT2 *a;
+unsigned int v;
+unsigned int n;
+{
+ UINT2 signWord = (((UINT2)v & 0x8000) ? ~0 : 0);
+ register unsigned int i;
+
+ a[0] = (UINT2)v;
+ for (i = 1; i < n; i++)
+ a[i] = signWord;
+}