Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev Sprinkle const into cgd crypto API.



details:   https://anonhg.NetBSD.org/src/rev/e93798d31318
branches:  trunk
changeset: 337725:e93798d31318
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Apr 25 12:55:04 2015 +0000

description:
Sprinkle const into cgd crypto API.

diffstat:

 sys/dev/cgd_crypto.c |  16 ++++++++--------
 sys/dev/cgd_crypto.h |   5 +++--
 2 files changed, 11 insertions(+), 10 deletions(-)

diffs (84 lines):

diff -r ff2c15466e11 -r e93798d31318 sys/dev/cgd_crypto.c
--- a/sys/dev/cgd_crypto.c      Sat Apr 25 09:08:51 2015 +0000
+++ b/sys/dev/cgd_crypto.c      Sat Apr 25 12:55:04 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd_crypto.c,v 1.12 2013/06/24 04:21:20 riastradh Exp $ */
+/* $NetBSD: cgd_crypto.c,v 1.13 2015/04/25 12:55:04 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgd_crypto.c,v 1.12 2013/06/24 04:21:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd_crypto.c,v 1.13 2015/04/25 12:55:04 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -126,8 +126,8 @@
 cgd_cipher_uio_cbc(void *privdata, cipher_func cipher,
     struct uio *dstuio, struct uio *srcuio)
 {
-       struct iovec    *dst;
-       struct iovec    *src;
+       const struct iovec      *dst;
+       const struct iovec      *src;
        int              dstnum;
        int              dstoff = 0;
        int              srcnum;
@@ -140,7 +140,7 @@
        for (;;) {
                int       l = MIN(dst->iov_len - dstoff, src->iov_len - srcoff);
                u_int8_t *d = (u_int8_t *)dst->iov_base + dstoff;
-               u_int8_t *s = (u_int8_t *)src->iov_base + srcoff;
+               const u_int8_t *s = (const u_int8_t *)src->iov_base + srcoff;
 
                cipher(privdata, d, s, l);
 
@@ -238,7 +238,7 @@
 
 static void
 cgd_cipher_aes_cbc(void *privdata, struct uio *dstuio,
-    struct uio *srcuio, void *iv, int dir)
+    struct uio *srcuio, const void *iv, int dir)
 {
        struct aes_privdata     *apd = privdata;
        struct aes_encdata       encd;
@@ -334,7 +334,7 @@
 
 static void
 cgd_cipher_3des_cbc(void *privdata, struct uio *dstuio,
-       struct uio *srcuio, void *iv, int dir)
+       struct uio *srcuio, const void *iv, int dir)
 {
        struct  c3des_privdata *cp = privdata;
        struct  c3des_encdata ce;
@@ -417,7 +417,7 @@
 
 static void
 cgd_cipher_bf_cbc(void *privdata, struct uio *dstuio,
-    struct uio *srcuio, void *iv, int dir)
+    struct uio *srcuio, const void *iv, int dir)
 {
        struct  bf_privdata *bp = privdata;
        struct  bf_encdata be;
diff -r ff2c15466e11 -r e93798d31318 sys/dev/cgd_crypto.h
--- a/sys/dev/cgd_crypto.h      Sat Apr 25 09:08:51 2015 +0000
+++ b/sys/dev/cgd_crypto.h      Sat Apr 25 12:55:04 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd_crypto.h,v 1.7 2012/12/05 02:23:20 christos Exp $ */
+/* $NetBSD: cgd_crypto.h,v 1.8 2015/04/25 12:55:04 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -38,7 +38,8 @@
 
 typedef void *(cfunc_init)(size_t, const void *, size_t *);
 typedef void  (cfunc_destroy)(void *);
-typedef void  (cfunc_cipher)(void *, struct uio *, struct uio *, void *, int);
+typedef void  (cfunc_cipher)(void *, struct uio *, struct uio *, const void *,
+                               int);
 
 struct cryptfuncs {
        const char       *cf_name;      /* cipher name */



Home | Main Index | Thread Index | Old Index