1104476Ssam/*	$OpenBSD: xform.c,v 1.16 2001/08/28 12:20:43 ben Exp $	*/
2139825Simp/*-
3104476Ssam * The authors of this code are John Ioannidis (ji@tla.org),
4247061Spjd * Angelos D. Keromytis (kermit@csd.uch.gr),
5247061Spjd * Niels Provos (provos@physnet.uni-hamburg.de) and
6247061Spjd * Damien Miller (djm@mindrot.org).
7104476Ssam *
8104476Ssam * This code was written by John Ioannidis for BSD/OS in Athens, Greece,
9104476Ssam * in November 1995.
10104476Ssam *
11104476Ssam * Ported to OpenBSD and NetBSD, with additional transforms, in December 1996,
12104476Ssam * by Angelos D. Keromytis.
13104476Ssam *
14104476Ssam * Additional transforms and features in 1997 and 1998 by Angelos D. Keromytis
15104476Ssam * and Niels Provos.
16104476Ssam *
17104476Ssam * Additional features in 1999 by Angelos D. Keromytis.
18104476Ssam *
19247061Spjd * AES XTS implementation in 2008 by Damien Miller
20247061Spjd *
21104476Ssam * Copyright (C) 1995, 1996, 1997, 1998, 1999 by John Ioannidis,
22104476Ssam * Angelos D. Keromytis and Niels Provos.
23104476Ssam *
24104476Ssam * Copyright (C) 2001, Angelos D. Keromytis.
25104476Ssam *
26247061Spjd * Copyright (C) 2008, Damien Miller
27275732Sjmg * Copyright (c) 2014 The FreeBSD Foundation
28275732Sjmg * All rights reserved.
29247061Spjd *
30275732Sjmg * Portions of this software were developed by John-Mark Gurney
31275732Sjmg * under sponsorship of the FreeBSD Foundation and
32275732Sjmg * Rubicon Communications, LLC (Netgate).
33275732Sjmg *
34104476Ssam * Permission to use, copy, and modify this software with or without fee
35104476Ssam * is hereby granted, provided that this entire notice is included in
36104476Ssam * all copies of any software which is or includes a copy or
37104476Ssam * modification of this software.
38104476Ssam * You may use this code under the GNU public license if you so wish. Please
39104476Ssam * contribute changes back to the authors under this freer than GPL license
40104476Ssam * so that we may further the use of strong encryption without limitations to
41104476Ssam * all.
42104476Ssam *
43104476Ssam * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR
44104476Ssam * IMPLIED WARRANTY. IN PARTICULAR, NONE OF THE AUTHORS MAKES ANY
45104476Ssam * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE
46104476Ssam * MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR
47104476Ssam * PURPOSE.
48104476Ssam */
49104476Ssam
50116191Sobrien#include <sys/cdefs.h>
51116191Sobrien__FBSDID("$FreeBSD$");
52116191Sobrien
53104476Ssam#include <opencrypto/rmd160.h>
54292963Sallanjude#include <opencrypto/xform_auth.h>
55104476Ssam
56275732Sjmgstatic	int RMD160Update_int(void *, const u_int8_t *, u_int16_t);
57104476Ssam
58104476Ssam/* Authentication instances */
59158703Spjdstruct auth_hash auth_hash_hmac_ripemd_160 = {
60104476Ssam	CRYPTO_RIPEMD160_HMAC, "HMAC-RIPEMD-160",
61285336Sgnn	RIPEMD160_HMAC_KEY_LEN, RIPEMD160_HASH_LEN, sizeof(RMD160_CTX),
62285336Sgnn	RIPEMD160_HMAC_BLOCK_LEN,
63275732Sjmg	(void (*)(void *)) RMD160Init, NULL, NULL, RMD160Update_int,
64104476Ssam	(void (*)(u_int8_t *, void *)) RMD160Final
65104476Ssam};
66104476Ssam
67104476Ssam/*
68104476Ssam * And now for auth.
69104476Ssam */
70104476Ssamstatic int
71275732SjmgRMD160Update_int(void *ctx, const u_int8_t *buf, u_int16_t len)
72104476Ssam{
73104476Ssam	RMD160Update(ctx, buf, len);
74104476Ssam	return 0;
75104476Ssam}
76