Deleted Added
full compact
mdX.3 (1803) mdX.3 (9488)
1.\"
2.\" ----------------------------------------------------------------------------
3.\" "THE BEER-WARE LICENSE" (Revision 42):
4.\" <phk@login.dkuug.dk> wrote this file. As long as you retain this notice you
5.\" can do whatever you want with this stuff. If we meet some day, and you think
6.\" this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7.\" ----------------------------------------------------------------------------
8.\"
1.\"
2.\" ----------------------------------------------------------------------------
3.\" "THE BEER-WARE LICENSE" (Revision 42):
4.\" <phk@login.dkuug.dk> wrote this file. As long as you retain this notice you
5.\" can do whatever you want with this stuff. If we meet some day, and you think
6.\" this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7.\" ----------------------------------------------------------------------------
8.\"
9.\" $FreeBSD: head/lib/libmd/mdX.3 1803 1994-07-24 03:29:56Z phk $
9.\" $FreeBSD: head/lib/libmd/mdX.3 9488 1995-07-12 09:13:49Z phk $
10.\"
11.Dd July 14, 1994
12.Dt MDX 3
13.Os FreeBSD 2
14.Sh NAME
15.Nm MDXInit ,
16.Nm MDXUpdate ,
17.Nm MDXFinal ,

--- 5 unchanged lines hidden (view full) ---

23.Fd #include <mdX.h>
24.Ft void
25.Fn MDXInit "MDX_CTX *context"
26.Ft void
27.Fn MDXUpdate "MDX_CTX *context" "unsigned char *data" "unsigned int len"
28.Ft void
29.Fn MDXFinal "unsigned char digest[16]" "MDX_CTX *context"
30.Ft "char *"
10.\"
11.Dd July 14, 1994
12.Dt MDX 3
13.Os FreeBSD 2
14.Sh NAME
15.Nm MDXInit ,
16.Nm MDXUpdate ,
17.Nm MDXFinal ,

--- 5 unchanged lines hidden (view full) ---

23.Fd #include <mdX.h>
24.Ft void
25.Fn MDXInit "MDX_CTX *context"
26.Ft void
27.Fn MDXUpdate "MDX_CTX *context" "unsigned char *data" "unsigned int len"
28.Ft void
29.Fn MDXFinal "unsigned char digest[16]" "MDX_CTX *context"
30.Ft "char *"
31.Fn MDXEnd "MDX_CTX *context"
31.Fn MDXEnd "MDX_CTX *context" "char *buf"
32.Ft "char *"
32.Ft "char *"
33.Fn MDXFile "char *filename"
33.Fn MDXFile "char *filename" "char *buf"
34.Ft "char *"
34.Ft "char *"
35.Fn MDXData "unsigned char *data" "unsigned int len"
35.Fn MDXData "unsigned char *data" "unsigned int len" "char *buf"
36.Sh DESCRIPTION
37The MDX functions calculate a 128-bit cryptographic checksum (digest)
38for any number of input bytes. A cryptographic checksum is a one-way
39hash-function, that is, you cannot find (except by exhaustive search)
40the input corresponding to a particular output. This net result is
41a ``fingerprint'' of the input-data, which doesn't disclose the actual
42input.
43

--- 10 unchanged lines hidden (view full) ---

54functions are the core functions. Allocate a MDX_CTX, initialize it with
55.Fn MDXInit
56run over the data with
57.Fn MDXUpdate
58and finally extract the result using
59.Fn MDXFinal .
60
61.Fn MDXEnd
36.Sh DESCRIPTION
37The MDX functions calculate a 128-bit cryptographic checksum (digest)
38for any number of input bytes. A cryptographic checksum is a one-way
39hash-function, that is, you cannot find (except by exhaustive search)
40the input corresponding to a particular output. This net result is
41a ``fingerprint'' of the input-data, which doesn't disclose the actual
42input.
43

--- 10 unchanged lines hidden (view full) ---

54functions are the core functions. Allocate a MDX_CTX, initialize it with
55.Fn MDXInit
56run over the data with
57.Fn MDXUpdate
58and finally extract the result using
59.Fn MDXFinal .
60
61.Fn MDXEnd
62is identical to
62is a wrapper for
63.Fn MDXFinal ,
63.Fn MDXFinal ,
64except the return is in ASCII-HEX in a
65string allocated with
66.Xr malloc 3 .
64which converts the return value to a 33 character (incl terminating NULL)
65ascii string which represents the 128 bits in hexadecimal.
67
68.Fn MDXFile
66
67.Fn MDXFile
69calculates the digest of a file, and returns the ASCII-HEX result.
68calculates the digest of a file, and uses
69.Fn MDXFinal
70to return the result.
70In case the file cannot be opened, NULL is returned.
71
72.Fn MDXData
71In case the file cannot be opened, NULL is returned.
72
73.Fn MDXData
73calculates the digest of a chunk of data in memory, and returns the ASCII-HEX
74result.
74calculates the digest of a chunk of data in memory, and uses
75.Fn MDXFinal
76to return the result.
75
76When using
77.Fn MDXEnd ,
78.Fn MDXFile
77
78When using
79.Fn MDXEnd ,
80.Fn MDXFile
79and
81or
80.Fn MDXData ,
82.Fn MDXData ,
81the returned string must be explicitly deallocated using
83the
84.Ar buf
85argument can be NULL, in which case the returned string is allocated with
86.Xr malloc 3
87and subsequently must be explicitly deallocated using
82.Xr free 3
83after use.
88.Xr free 3
89after use.
90If the
91.Ar buf
92argument isn't NULL it must point to at least 33 characters of buffer space.
84.Sh SEE ALSO
85.Xr md2 3 ,
86.Xr md4 3 ,
87.Xr md5 3
88.Pp
89ISOC
90Internet Request For Comments
91.%T RFC1319 ,

--- 14 unchanged lines hidden (view full) ---

106.Sh HISTORY
107These functions appeared in
108.Em FreeBSD-2.0
109.Sh BUGS
110No method is known to exist which finds two files having the same hash value,
111nor to find a file with a specific hash value.
112There is on the other hand no guarantee that such a method doesn't exist.
113
93.Sh SEE ALSO
94.Xr md2 3 ,
95.Xr md4 3 ,
96.Xr md5 3
97.Pp
98ISOC
99Internet Request For Comments
100.%T RFC1319 ,

--- 14 unchanged lines hidden (view full) ---

115.Sh HISTORY
116These functions appeared in
117.Em FreeBSD-2.0
118.Sh BUGS
119No method is known to exist which finds two files having the same hash value,
120nor to find a file with a specific hash value.
121There is on the other hand no guarantee that such a method doesn't exist.
122
114MD2 can only be used for Privacy Enhanced Mail.
123MD2 has only been released for use in Privacy Enhanced eMail.
115Use MD4 or MD5 if that isn't what you're doing.
116.Sh COPYRIGHT
124Use MD4 or MD5 if that isn't what you're doing.
125.Sh COPYRIGHT