diff options
author | Havoc Pennington <hp@redhat.com> | 2003-02-22 17:29:48 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2003-02-22 17:29:48 +0000 |
commit | 6c07098c5ec68e78320a6f07e4c9e141a95729ed (patch) | |
tree | f57c665728bb0efaf363701b6e9b37758de136c6 /dbus/dbus-sha.h | |
parent | 92f7d50b3b420670732a55bf15f7b343b2ce9fe6 (diff) |
2003-02-22 Havoc Pennington <hp@pobox.com>
* dbus/dbus-message.c (dbus_message_iter_get_string_array):
(dbus_message_iter_get_byte_array): Fix up doxygen warnings
* dbus/dbus-sha.c: add implementation of SHA-1 algorithm
* dbus/test/data/sha-1: add US government test suite for SHA-1
Diffstat (limited to 'dbus/dbus-sha.h')
-rw-r--r-- | dbus/dbus-sha.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/dbus/dbus-sha.h b/dbus/dbus-sha.h new file mode 100644 index 00000000..7f793844 --- /dev/null +++ b/dbus/dbus-sha.h @@ -0,0 +1,52 @@ +/* -*- mode: C; c-file-style: "gnu" -*- */ +/* dbus-sha.h SHA-1 implementation + * + * Copyright (C) 2003 Red Hat Inc. + * + * Licensed under the Academic Free License version 1.2 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +#ifndef DBUS_SHA_H +#define DBUS_SHA_H + +#include <dbus/dbus-macros.h> +#include <dbus/dbus-errors.h> +#include <dbus/dbus-string.h> + +DBUS_BEGIN_DECLS; + +typedef struct DBusSHAContext DBusSHAContext; + +struct DBusSHAContext +{ + dbus_uint32_t digest[5]; /**< Message digest */ + dbus_uint32_t count_lo; /**< 64-bit bit count */ + dbus_uint32_t count_hi; + dbus_uint32_t data[16]; /**< SHA data buffer */ +}; + +void _dbus_sha_init (DBusSHAContext *context); +void _dbus_sha_update (DBusSHAContext *context, + const DBusString *data); +dbus_bool_t _dbus_sha_final (DBusSHAContext *context, + DBusString *results); +dbus_bool_t _dbus_sha_compute (const DBusString *data, + DBusString *ascii_output); + +DBUS_END_DECLS; + +#endif /* DBUS_SHA_H */ |