Import ezmlm 0.53
[ezmlm] / surfpcs.3
CommitLineData
5b62e993
MW
1.TH surfpcs 3
2.SH NAME
3surfpcs \- SURF protected counter sums
4.SH SYNTAX
5.B #include <surfpcs.h>
6
7void \fBsurfpcs_init\fP(&\fIs\fR,\fIseed\fR);
8
9void \fBsurfpcs_add\fP(&\fIs\fR,\fIbuf\fR,\fIlen\fR);
10
11void \fBsurfpcs_out\fP(&\fIs\fR,\fIh\fR);
12
13surfpcs \fIs\fR;
14.br
15uint32 \fIseed\fR[32];
16.br
17unsigned char *\fIbuf\fR;
18.br
19unsigned int \fIlen\fR;
20.br
21unsigned char \fIh\fR[SURFPCS_LEN];
22.SH DESCRIPTION
23.B surfpcs
24converts a character string to a 256-bit output,
25under control of a 1024-bit seed.
26When the seed is secret,
27.B surfpcs
28appears to be indistinguishable from a completely random
29variable-length-to-256-bit function.
30
31Applying
32.B surfpcs
33takes three steps.
34First, initialize a
35.B surfpcs
36variable,
37.IR s ,
38with
39.BR surfpcs_init .
40The seed will be recorded inside
41.IR s .
42
43Second, feed the input to
44.BR surfpcs_add .
45.I buf
46is a pointer to
47.I len
48characters of input.
49You can split the input across any number of
50.B surfpcs_add
51calls.
52
53Third, call
54.BR surfpcs_out .
55The output will be placed into
56.IR h ,
57an array of
58.B SURFPCS_LEN
59bytes.
60.B SURFPCS_LEN
61is 32.
62
63To apply
64.B surfpcs
65to another input you must call
66.B surfpcs_init
67again.
68.SH "SEE ALSO"
69surf(3)