Loading...
Searching...
No Matches
su_md5.h
Go to the documentation of this file.
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef SU_MD5_H
#define SU_MD5_H
#ifndef SU_TYPES_H
#include "sofia-sip/su_types.h"
#endif
SOFIA_BEGIN_DECLS
typedef struct su_md5_t {
uint32_t buf[4];
uint32_t bits[2];
uint8_t in[64];
} su_md5_t;
#define SU_MD5_DIGEST_SIZE 16
SOFIAPUBFUN void su_md5_init(su_md5_t *context);
SOFIAPUBFUN void su_md5_deinit(su_md5_t *context);
SOFIAPUBFUN void su_md5_update(su_md5_t *context,
void const *buf, usize_t len);
SOFIAPUBFUN void su_md5_strupdate(su_md5_t *ctx, char const *s);
SOFIAPUBFUN void su_md5_str0update(su_md5_t *ctx, char const *s);
SOFIAPUBFUN void su_md5_iupdate(su_md5_t *context,
void const *buf, usize_t len);
SOFIAPUBFUN void su_md5_striupdate(su_md5_t *ctx, char const *s);
SOFIAPUBFUN void su_md5_stri0update(su_md5_t *ctx, char const *s);
SOFIAPUBFUN void su_md5_digest(su_md5_t const *ctx,
uint8_t digest[SU_MD5_DIGEST_SIZE]);
SOFIAPUBFUN void su_md5_hexdigest(su_md5_t const *ctx,
char digest[2 * SU_MD5_DIGEST_SIZE + 1]);
#define SU_MD5_STRUPDATE(ctx, s) \
((s) ? su_md5_update(ctx, (s), strlen(s)) : (void)0)
#define SU_MD5_STR0UPDATE(ctx, s) \
su_md5_update(ctx, (s) ? (s) : "", (s) ? strlen(s) + 1 : 1)
#define SU_MD5_STRIUPDATE(ctx, s) \
((s) ? su_md5_iupdate(ctx, (s), strlen(s)) : (void)0)
#define SU_MD5_STRI0UPDATE(ctx, s) \
su_md5_iupdate(ctx, (s) ? (s) : "", (s) ? strlen(s) : 1)
SOFIA_END_DECLS
#endif /* !defined(MD5_H) */
su_md5_t
MD5 context.
Definition su_md5.h:52
SOFIAPUBFUN
#define SOFIAPUBFUN
SOFIAPUBFUN declares an exported function.
Definition su_config.h:66
su_md5_str0update
void su_md5_str0update(su_md5_t *ctx, char const *s)
Update MD5 context with contents of string, including final NUL.
Definition su_md5.c:268
su_md5_update
void su_md5_update(su_md5_t *context, void const *buf, usize_t len)
Update MD5 context.
Definition su_md5.c:132
su_md5_strupdate
void su_md5_strupdate(su_md5_t *ctx, char const *s)
Update MD5 context with contents of string.
Definition su_md5.c:254
su_md5_striupdate
void su_md5_striupdate(su_md5_t *ctx, char const *s)
Update MD5 context with contents of case-independent string.
Definition su_md5.c:284
su_md5_init
void su_md5_init(su_md5_t *context)
Initialize MD5 context.
Definition su_md5.c:100
su_md5_deinit
void su_md5_deinit(su_md5_t *context)
Clear MD5 context.
Definition su_md5.c:117
su_md5_iupdate
void su_md5_iupdate(su_md5_t *context, void const *buf, usize_t len)
Update MD5 context.
Definition su_md5.c:201
su_md5_stri0update
void su_md5_stri0update(su_md5_t *ctx, char const *s)
Update MD5 context with contents of case-independent string, including final NUL.
Definition su_md5.c:299
su_types.h
Basic integer types for su library.
uint32_t
SU_U32_T uint32_t
32-bit unsigned integer
Definition su_types.h:87
uint8_t
SU_U8_T uint8_t
8-bit unsigned integer
Definition su_types.h:95

Sofia-SIP 1.12.11devel - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.