xref: /freebsd/crypto/heimdal/lib/krb5/krb5_create_checksum.3 (revision daf1cffce2e07931f27c6c6998652e90df6ba87e)
1.\" Copyright (c) 1999 Kungliga Tekniska H�gskolan
2.\" $Id: krb5_create_checksum.3,v 1.1 1999/04/18 13:47:11 joda Exp $
3.Dd April  7, 1999
4.Dt NAME 3
5.Os HEIMDAL
6.Sh NAME
7.Nm krb5_checksum_is_collision_proof ,
8.Nm krb5_checksum_is_keyed ,
9.Nm krb5_checksumsize ,
10.Nm krb5_create_checksum ,
11.Nm krb5_verify_checksum
12.Nd creates and verifies checksums
13.Sh SYNOPSIS
14.Fd #include <krb5.h>
15
16.Ft krb5_error_code
17.Fn krb5_create_checksum "krb5_context context" "krb5_crypto crypto" "unsigned usage_or_type" "void *data" "size_t len" "Checksum *result"
18
19.Ft krb5_error_code
20.Fn krb5_verify_checksum "krb5_context context" "krb5_crypto crypto" "krb5_key_usage usage" "void *data" "size_t len" "Checksum *cksum"
21
22.Ft krb5_boolean
23.Fn krb5_checksum_is_collision_proof "krb5_context context" "krb5_cksumtype type"
24
25.Ft krb5_boolean
26.Fn krb5_checksum_is_keyed "krb5_context context" "krb5_cksumtype type"
27
28.Sh DESCRIPTION
29These functions are used to create and verify checksums.
30.Fn krb5_create_checksum
31creates a checksum of the specified data, and puts it in
32.Fa result .
33If
34.Fa crypto
35is
36.Dv NULL ,
37.Fa usage_or_type
38specifies the checksum type to use; it must not be keyed. Otherwise
39.Fa crypto
40is an encryption context created by
41.Fn krb5_crypto_init ,
42and
43.Fa usage_or_type
44specifies a key-usage.
45.Pp
46.Fn krb5_verify_checksum
47verifies the
48.Fa checksum ,
49against the provided data.
50.Pp
51.Fn krb5_checksum_is_collision_proof
52returns true is the specified checksum is collision proof (that it's
53very unlikely that two strings has the same hash value, and that it's
54hard to find two strings that has the same hash). Examples of
55collision proof checksums are MD5, and SHA1, while CRC32 is not.
56.Pp
57.Fn krb5_checksum_is_keyed
58returns true if the specified checksum type is keyed (that the hash
59value is a function of both the data, and a separate key). Examples of
60keyed hash algorithms are HMAC-SHA1-DES3, and RSA-MD5-DES. The
61.Dq plain
62hash functions MD5, and SHA1 are not keyed.
63
64.\" .Sh EXAMPLE
65.\" .Sh BUGS
66.Sh SEE ALSO
67.Xr krb5_crypto_init 3 ,
68.Xr krb5_encrypt 3
69