8999 SMBIOS: cleanup 32-bit specific code
[unleashed.git] / usr / src / man / man3c / setkey.3c
blob054bc2b66f9285b55e71e25b0a86a9e6580837c7
1 '\" te
2 .\"  Copyright (c) 1992, X/Open Company Limited All Rights Reserved  Portions Copyright (c) 2002, Sun Microsystems, Inc.  All Rights Reserved
3 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
4 .\" http://www.opengroup.org/bookstore/.
5 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
6 .\"  This notice shall appear on any product containing this material.
7 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
9 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
10 .TH SETKEY 3C "Aug 14, 2002"
11 .SH NAME
12 setkey \- set encoding key
13 .SH SYNOPSIS
14 .LP
15 .nf
16 #include <stdlib.h>
18 \fBvoid\fR \fBsetkey\fR(\fBconst char *\fR\fIkey\fR);
19 .fi
21 .SH DESCRIPTION
22 .sp
23 .LP
24 The \fBsetkey()\fR function provides (rather primitive) access to the hashing
25 algorithm employed by the \fBcrypt\fR(3C) function. The argument of
26 \fBsetkey()\fR is an array of length 64 bytes containing only the bytes with
27 numerical value of 0 and 1. If this string is divided into groups of 8, the
28 low-order bit in each group is ignored; this gives a 56-bit key which is used
29 by the algorithm. This is the key that will be used with the algorithm to
30 encode a string \fIblock\fR passed to \fBencrypt\fR(3C).
31 .SH RETURN VALUES
32 .sp
33 .LP
34 No values are returned.
35 .SH ERRORS
36 .sp
37 .LP
38 The \fBsetkey()\fR function will fail if:
39 .sp
40 .ne 2
41 .na
42 \fB\fBENOSYS\fR\fR
43 .ad
44 .RS 10n
45 The functionality is not supported on this implementation.
46 .RE
48 .SH USAGE
49 .sp
50 .LP
51 In some environments, decoding may not be implemented.  This is related to U.S.
52 Government restrictions on encryption and decryption routines: the \fBDES\fR
53 decryption algorithm cannot be exported outside the U.S.A. Historical practice
54 has been to ship a different version of the encryption library without the
55 decryption feature in the routines supplied. Thus the exported version of
56 \fBencrypt()\fR does encoding but not decoding.
57 .sp
58 .LP
59 Because \fBsetkey()\fR does not return a value, applications wishing to check
60 for errors should set \fBerrno\fR to 0, call \fBsetkey()\fR, then test
61 \fBerrno\fR and, if it is non-zero, assume an error has occurred.
62 .SH ATTRIBUTES
63 .sp
64 .LP
65 See \fBattributes\fR(5) for descriptions of the following attributes:
66 .sp
68 .sp
69 .TS
70 box;
71 c | c
72 l | l .
73 ATTRIBUTE TYPE  ATTRIBUTE VALUE
75 Interface Stability     Standard
77 MT-Level        Safe
78 .TE
80 .SH SEE ALSO
81 .sp
82 .LP
83 \fBcrypt\fR(3C), \fBencrypt\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)