Module Name:    src
Committed By:   pgoyette
Date:           Wed Jan  1 15:18:57 UTC 2014

Modified Files:
        src/sys/crypto/blowfish: files.blowfish
        src/sys/crypto/camellia: camellia.c
        src/sys/crypto/cast128: cast128.c
        src/sys/crypto/des: files.des
        src/sys/crypto/skipjack: skipjack.c
        src/sys/modules: Makefile
Added Files:
        src/sys/crypto/blowfish: bf_module.c
        src/sys/crypto/des: des_module.c
        src/sys/modules/blowfish: Makefile
        src/sys/modules/camellia: Makefile
        src/sys/modules/cast128: Makefile
        src/sys/modules/des: Makefile
        src/sys/modules/skipjack: Makefile

Log Message:
Create modules for software crypto components.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/crypto/blowfish/bf_module.c
cvs rdiff -u -r1.3 -r1.4 src/sys/crypto/blowfish/files.blowfish
cvs rdiff -u -r1.1 -r1.2 src/sys/crypto/camellia/camellia.c
cvs rdiff -u -r1.9 -r1.10 src/sys/crypto/cast128/cast128.c
cvs rdiff -u -r0 -r1.1 src/sys/crypto/des/des_module.c
cvs rdiff -u -r1.1 -r1.2 src/sys/crypto/des/files.des
cvs rdiff -u -r1.3 -r1.4 src/sys/crypto/skipjack/skipjack.c
cvs rdiff -u -r1.132 -r1.133 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/blowfish/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/camellia/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/cast128/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/des/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/skipjack/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/crypto/blowfish/files.blowfish
diff -u src/sys/crypto/blowfish/files.blowfish:1.3 src/sys/crypto/blowfish/files.blowfish:1.4
--- src/sys/crypto/blowfish/files.blowfish:1.3	Sun Dec 11 12:20:48 2005
+++ src/sys/crypto/blowfish/files.blowfish	Wed Jan  1 15:18:57 2014
@@ -1,7 +1,8 @@
-#	$NetBSD: files.blowfish,v 1.3 2005/12/11 12:20:48 christos Exp $
+#	$NetBSD: files.blowfish,v 1.4 2014/01/01 15:18:57 pgoyette Exp $
 
 define	blowfish
 
+file	crypto/blowfish/bf_module.c	blowfish
 file	crypto/blowfish/bf_ecb.c	blowfish
 file	crypto/blowfish/bf_enc.c	blowfish
 file	crypto/blowfish/bf_cbc.c	blowfish

Index: src/sys/crypto/camellia/camellia.c
diff -u src/sys/crypto/camellia/camellia.c:1.1 src/sys/crypto/camellia/camellia.c:1.2
--- src/sys/crypto/camellia/camellia.c:1.1	Thu May  5 17:38:36 2011
+++ src/sys/crypto/camellia/camellia.c	Wed Jan  1 15:18:57 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: camellia.c,v 1.1 2011/05/05 17:38:36 drochner Exp $ */
+/* $NetBSD: camellia.c,v 1.2 2014/01/01 15:18:57 pgoyette Exp $ */
 
 /* camellia.h ver 1.1.0
  *
@@ -35,6 +35,9 @@
 #include <sys/cdefs.h>
 #include <sys/types.h>
 #include <sys/systm.h>
+#include <sys/errno.h>
+#include <sys/module.h>
+
 #include <crypto/camellia/camellia.h>
 
 
@@ -1321,3 +1324,19 @@ Camellia_DecryptBlock(const int keyBitLe
     PUTU32(plaintext+8,  tmp[2]);
     PUTU32(plaintext+12, tmp[3]);
 }
+
+MODULE(MODULE_CLASS_MISC, camellia, NULL);
+
+static int
+camellia_modcmd(modcmd_t cmd, void *opaque)
+{
+
+	switch (cmd) {
+	case MODULE_CMD_INIT:
+		return 0;
+	case MODULE_CMD_FINI:
+		return 0;
+	default:
+		return ENOTTY;
+	}
+}

Index: src/sys/crypto/cast128/cast128.c
diff -u src/sys/crypto/cast128/cast128.c:1.9 src/sys/crypto/cast128/cast128.c:1.10
--- src/sys/crypto/cast128/cast128.c:1.9	Wed May 10 21:53:15 2006
+++ src/sys/crypto/cast128/cast128.c	Wed Jan  1 15:18:57 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cast128.c,v 1.9 2006/05/10 21:53:15 mrg Exp $	*/
+/*	$NetBSD: cast128.c,v 1.10 2014/01/01 15:18:57 pgoyette Exp $	*/
 /*      $OpenBSD: cast.c,v 1.2 2000/06/06 06:49:47 deraadt Exp $       */
 
 /*
@@ -9,9 +9,12 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cast128.c,v 1.9 2006/05/10 21:53:15 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cast128.c,v 1.10 2014/01/01 15:18:57 pgoyette Exp $");
 
 #include <sys/types.h>
+#include <sys/errno.h>
+#include <sys/module.h>
+
 #include <crypto/cast128/cast128.h>
 #include <crypto/cast128/cast128sb.h>
 
@@ -246,3 +249,23 @@ void cast128_setkey(cast128_key* key, co
 }
 
 /* Made in Canada */
+
+#if defined(_KERNEL)
+
+MODULE(MODULE_CLASS_MISC, cast128, NULL);
+
+static int
+cast128_modcmd(modcmd_t cmd, void *opaque)
+{
+
+	switch (cmd) {
+	case MODULE_CMD_INIT:
+		return 0;
+	case MODULE_CMD_FINI:
+		return 0;
+	default:
+		return ENOTTY;
+	}
+}
+
+#endif /* defined(KERNEL) */

Index: src/sys/crypto/des/files.des
diff -u src/sys/crypto/des/files.des:1.1 src/sys/crypto/des/files.des:1.2
--- src/sys/crypto/des/files.des:1.1	Fri Oct 11 01:52:10 2002
+++ src/sys/crypto/des/files.des	Wed Jan  1 15:18:57 2014
@@ -1,7 +1,8 @@
-#	$NetBSD: files.des,v 1.1 2002/10/11 01:52:10 thorpej Exp $
+#	$NetBSD: files.des,v 1.2 2014/01/01 15:18:57 pgoyette Exp $
 
 define	des
 
+file	crypto/des/des_module.c		des
 file	crypto/des/des_ecb.c		des
 file	crypto/des/des_setkey.c		des
 file	crypto/des/des_enc.c		des

Index: src/sys/crypto/skipjack/skipjack.c
diff -u src/sys/crypto/skipjack/skipjack.c:1.3 src/sys/crypto/skipjack/skipjack.c:1.4
--- src/sys/crypto/skipjack/skipjack.c:1.3	Sun Dec 11 12:20:53 2005
+++ src/sys/crypto/skipjack/skipjack.c	Wed Jan  1 15:18:57 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: skipjack.c,v 1.3 2005/12/11 12:20:53 christos Exp $ */
+/*	$NetBSD: skipjack.c,v 1.4 2014/01/01 15:18:57 pgoyette Exp $ */
 /*	$OpenBSD: skipjack.c,v 1.3 2001/05/05 00:31:34 angelos Exp $	*/
 
 /*
@@ -15,11 +15,14 @@
 */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: skipjack.c,v 1.3 2005/12/11 12:20:53 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: skipjack.c,v 1.4 2014/01/01 15:18:57 pgoyette Exp $");
 
+#include <sys/errno.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
 #include <sys/param.h>
+
 #include <crypto/skipjack/skipjack.h>
-#include <sys/malloc.h>
 #include <opencrypto/cryptodev.h>
 
 static const u_int8_t ftable[0x100] =
@@ -260,3 +263,19 @@ skipjack_backwards (u_int8_t *cipher, u_
 	plain [4] = wh3;  plain [5] = wl3;
 	plain [6] = wh4;  plain [7] = wl4;
 }
+
+MODULE(MODULE_CLASS_MISC, skipjack, NULL);
+
+static int
+skipjack_modcmd(modcmd_t cmd, void *opaque)
+{
+
+	switch (cmd) {
+	case MODULE_CMD_INIT:
+		return 0;
+	case MODULE_CMD_FINI:
+		return 0;
+	default:
+		return ENOTTY;
+	}
+}

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.132 src/sys/modules/Makefile:1.133
--- src/sys/modules/Makefile:1.132	Sun Dec 29 16:32:32 2013
+++ src/sys/modules/Makefile	Wed Jan  1 15:18:57 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.132 2013/12/29 16:32:32 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.133 2014/01/01 15:18:57 pgoyette Exp $
 
 .include <bsd.own.mk>
 
@@ -8,7 +8,10 @@ SUBDIR=		accf_dataready
 SUBDIR+=	accf_httpready
 SUBDIR+=	adosfs
 SUBDIR+=	aio
+SUBDIR+=	blowfish
 SUBDIR+=	bpf
+SUBDIR+=	camellia
+SUBDIR+=	cast128
 SUBDIR+=	ccd
 SUBDIR+=	cd9660
 SUBDIR+=	cgd
@@ -19,6 +22,7 @@ SUBDIR+=	compat
 SUBDIR+=	compat_ossaudio
 SUBDIR+=	coredump
 SUBDIR+=	dbcool
+SUBDIR+=	des
 SUBDIR+=	dk_subr
 SUBDIR+=	efs
 SUBDIR+=	ext2fs
@@ -78,6 +82,7 @@ SUBDIR+=	secmodel_bsd44
 SUBDIR+=	secmodel_extensions
 SUBDIR+=	secmodel_overlay
 SUBDIR+=	securelevel
+SUBDIR+=	skipjack
 SUBDIR+=	smbfs
 SUBDIR+=	spdmem
 SUBDIR+=	sysvbfs

Added files:

Index: src/sys/crypto/blowfish/bf_module.c
diff -u /dev/null src/sys/crypto/blowfish/bf_module.c:1.1
--- /dev/null	Wed Jan  1 15:18:57 2014
+++ src/sys/crypto/blowfish/bf_module.c	Wed Jan  1 15:18:57 2014
@@ -0,0 +1,51 @@
+/*	$NetBSD: bf_module.c,v 1.1 2014/01/01 15:18:57 pgoyette Exp $	*/
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Paul Goyette
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: bf_module.c,v 1.1 2014/01/01 15:18:57 pgoyette Exp $");
+
+#include <sys/errno.h>
+#include <sys/module.h>
+
+MODULE(MODULE_CLASS_MISC, blowfish, NULL);
+
+static int
+blowfish_modcmd(modcmd_t cmd, void *opaque)
+{
+
+	switch (cmd) {
+	case MODULE_CMD_INIT:
+		return 0;
+	case MODULE_CMD_FINI:
+		return 0;
+	default:
+		return ENOTTY;
+	}
+}

Index: src/sys/crypto/des/des_module.c
diff -u /dev/null src/sys/crypto/des/des_module.c:1.1
--- /dev/null	Wed Jan  1 15:18:57 2014
+++ src/sys/crypto/des/des_module.c	Wed Jan  1 15:18:57 2014
@@ -0,0 +1,51 @@
+/*	$NetBSD: des_module.c,v 1.1 2014/01/01 15:18:57 pgoyette Exp $	*/
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Paul Goyette
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: des_module.c,v 1.1 2014/01/01 15:18:57 pgoyette Exp $");
+
+#include <sys/errno.h>
+#include <sys/module.h>
+
+MODULE(MODULE_CLASS_MISC, des, NULL);
+
+static int
+des_modcmd(modcmd_t cmd, void *opaque)
+{
+
+	switch (cmd) {
+	case MODULE_CMD_INIT:
+		return 0;
+	case MODULE_CMD_FINI:
+		return 0;
+	default:
+		return ENOTTY;
+	}
+}

Index: src/sys/modules/blowfish/Makefile
diff -u /dev/null src/sys/modules/blowfish/Makefile:1.1
--- /dev/null	Wed Jan  1 15:18:57 2014
+++ src/sys/modules/blowfish/Makefile	Wed Jan  1 15:18:57 2014
@@ -0,0 +1,26 @@
+#	$NetBSD: Makefile,v 1.1 2014/01/01 15:18:57 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+.PATH:	${S}/crypto/blowfish
+
+KMOD=	blowfish
+SRCS=	bf_module.c
+SRCS+=	bf_ecb.c
+SRCS+=	bf_skey.c  
+
+.if ${MACHINE} == "i386"
+
+.PATH:	${S}/crypto/blowfish/arch/i386
+
+SRCS+=	bf_enc.S
+SRCS+=	bf_cbc.S
+
+.else
+
+SRCS+=	bf_enc.c
+SRCS+=	bf_cbc.c
+
+.endif
+
+.include <bsd.kmodule.mk>

Index: src/sys/modules/camellia/Makefile
diff -u /dev/null src/sys/modules/camellia/Makefile:1.1
--- /dev/null	Wed Jan  1 15:18:57 2014
+++ src/sys/modules/camellia/Makefile	Wed Jan  1 15:18:57 2014
@@ -0,0 +1,10 @@
+#	$NetBSD: Makefile,v 1.1 2014/01/01 15:18:57 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+.PATH:	${S}/crypto/camellia
+
+KMOD=	camellia
+SRCS=	camellia.c camellia-api.c 
+
+.include <bsd.kmodule.mk>

Index: src/sys/modules/cast128/Makefile
diff -u /dev/null src/sys/modules/cast128/Makefile:1.1
--- /dev/null	Wed Jan  1 15:18:57 2014
+++ src/sys/modules/cast128/Makefile	Wed Jan  1 15:18:57 2014
@@ -0,0 +1,10 @@
+#	$NetBSD: Makefile,v 1.1 2014/01/01 15:18:57 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+.PATH:	${S}/crypto/cast128
+
+KMOD=	cast128
+SRCS=	cast128.c
+
+.include <bsd.kmodule.mk>

Index: src/sys/modules/des/Makefile
diff -u /dev/null src/sys/modules/des/Makefile:1.1
--- /dev/null	Wed Jan  1 15:18:57 2014
+++ src/sys/modules/des/Makefile	Wed Jan  1 15:18:57 2014
@@ -0,0 +1,15 @@
+#	$NetBSD: Makefile,v 1.1 2014/01/01 15:18:57 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+.PATH:	${S}/crypto/des
+
+KMOD=	des
+SRCS=	des_module.c
+SRCS+=	des_ecb.c
+SRCS+=	des_setkey.c
+SRCS+=	des_enc.c
+SRCS+=	des_cbc.c
+
+
+.include <bsd.kmodule.mk>

Index: src/sys/modules/skipjack/Makefile
diff -u /dev/null src/sys/modules/skipjack/Makefile:1.1
--- /dev/null	Wed Jan  1 15:18:57 2014
+++ src/sys/modules/skipjack/Makefile	Wed Jan  1 15:18:57 2014
@@ -0,0 +1,10 @@
+#	$NetBSD: Makefile,v 1.1 2014/01/01 15:18:57 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+.PATH:	${S}/crypto/skipjack
+
+KMOD=	skipjack
+SRCS=	skipjack.c
+
+.include <bsd.kmodule.mk>

Reply via email to