diff options
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/api.c | 2 | ||||
-rw-r--r-- | crypto/digest.c | 4 | ||||
-rw-r--r-- | crypto/fcrypt.c | 2 | ||||
-rw-r--r-- | crypto/hmac.c | 3 | ||||
-rw-r--r-- | crypto/scatterwalk.c | 4 | ||||
-rw-r--r-- | crypto/scatterwalk.h | 8 | ||||
-rw-r--r-- | crypto/tcrypt.c | 4 | ||||
-rw-r--r-- | crypto/xcbc.c | 2 |
8 files changed, 15 insertions, 14 deletions
diff --git a/crypto/api.c b/crypto/api.c index 4ccc5af6c265..1f5c72477356 100644 --- a/crypto/api.c +++ b/crypto/api.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * Copyright (c) 2005 Herbert Xu <herbert@gondor.apana.org.au> | 6 | * Copyright (c) 2005 Herbert Xu <herbert@gondor.apana.org.au> |
7 | * | 7 | * |
8 | * Portions derived from Cryptoapi, by Alexander Kjeldaas <astor@fast.no> | 8 | * Portions derived from Cryptoapi, by Alexander Kjeldaas <astor@fast.no> |
9 | * and Nettle, by Niels M๖ller. | 9 | * and Nettle, by Niels Mรถller. |
10 | * | 10 | * |
11 | * This program is free software; you can redistribute it and/or modify it | 11 | * This program is free software; you can redistribute it and/or modify it |
12 | * under the terms of the GNU General Public License as published by the Free | 12 | * under the terms of the GNU General Public License as published by the Free |
diff --git a/crypto/digest.c b/crypto/digest.c index 1bf7414aeb9e..8871dec8cae7 100644 --- a/crypto/digest.c +++ b/crypto/digest.c | |||
@@ -41,7 +41,7 @@ static int update2(struct hash_desc *desc, | |||
41 | return 0; | 41 | return 0; |
42 | 42 | ||
43 | for (;;) { | 43 | for (;;) { |
44 | struct page *pg = sg->page; | 44 | struct page *pg = sg_page(sg); |
45 | unsigned int offset = sg->offset; | 45 | unsigned int offset = sg->offset; |
46 | unsigned int l = sg->length; | 46 | unsigned int l = sg->length; |
47 | 47 | ||
@@ -77,7 +77,7 @@ static int update2(struct hash_desc *desc, | |||
77 | 77 | ||
78 | if (!nbytes) | 78 | if (!nbytes) |
79 | break; | 79 | break; |
80 | sg = sg_next(sg); | 80 | sg = scatterwalk_sg_next(sg); |
81 | } | 81 | } |
82 | 82 | ||
83 | return 0; | 83 | return 0; |
diff --git a/crypto/fcrypt.c b/crypto/fcrypt.c index 9c2bb535b09a..d161949fdb94 100644 --- a/crypto/fcrypt.c +++ b/crypto/fcrypt.c | |||
@@ -10,7 +10,7 @@ | |||
10 | * | 10 | * |
11 | * Based on code: | 11 | * Based on code: |
12 | * | 12 | * |
13 | * Copyright (c) 1995 - 2000 Kungliga Tekniska H๖gskolan | 13 | * Copyright (c) 1995 - 2000 Kungliga Tekniska Hรถgskolan |
14 | * (Royal Institute of Technology, Stockholm, Sweden). | 14 | * (Royal Institute of Technology, Stockholm, Sweden). |
15 | * All rights reserved. | 15 | * All rights reserved. |
16 | * | 16 | * |
diff --git a/crypto/hmac.c b/crypto/hmac.c index 8802fb6dd5a6..e4eb6ac53b5c 100644 --- a/crypto/hmac.c +++ b/crypto/hmac.c | |||
@@ -159,7 +159,8 @@ static int hmac_digest(struct hash_desc *pdesc, struct scatterlist *sg, | |||
159 | desc.flags = pdesc->flags & CRYPTO_TFM_REQ_MAY_SLEEP; | 159 | desc.flags = pdesc->flags & CRYPTO_TFM_REQ_MAY_SLEEP; |
160 | 160 | ||
161 | sg_set_buf(sg1, ipad, bs); | 161 | sg_set_buf(sg1, ipad, bs); |
162 | sg1[1].page = (void *)sg; | 162 | |
163 | sg_set_page(&sg[1], (void *) sg); | ||
163 | sg1[1].length = 0; | 164 | sg1[1].length = 0; |
164 | sg_set_buf(sg2, opad, bs + ds); | 165 | sg_set_buf(sg2, opad, bs + ds); |
165 | 166 | ||
diff --git a/crypto/scatterwalk.c b/crypto/scatterwalk.c index 3052f6507f53..b9bbda0bb9f9 100644 --- a/crypto/scatterwalk.c +++ b/crypto/scatterwalk.c | |||
@@ -54,7 +54,7 @@ static void scatterwalk_pagedone(struct scatter_walk *walk, int out, | |||
54 | if (out) { | 54 | if (out) { |
55 | struct page *page; | 55 | struct page *page; |
56 | 56 | ||
57 | page = walk->sg->page + ((walk->offset - 1) >> PAGE_SHIFT); | 57 | page = sg_page(walk->sg) + ((walk->offset - 1) >> PAGE_SHIFT); |
58 | flush_dcache_page(page); | 58 | flush_dcache_page(page); |
59 | } | 59 | } |
60 | 60 | ||
@@ -62,7 +62,7 @@ static void scatterwalk_pagedone(struct scatter_walk *walk, int out, | |||
62 | walk->offset += PAGE_SIZE - 1; | 62 | walk->offset += PAGE_SIZE - 1; |
63 | walk->offset &= PAGE_MASK; | 63 | walk->offset &= PAGE_MASK; |
64 | if (walk->offset >= walk->sg->offset + walk->sg->length) | 64 | if (walk->offset >= walk->sg->offset + walk->sg->length) |
65 | scatterwalk_start(walk, sg_next(walk->sg)); | 65 | scatterwalk_start(walk, scatterwalk_sg_next(walk->sg)); |
66 | } | 66 | } |
67 | } | 67 | } |
68 | 68 | ||
diff --git a/crypto/scatterwalk.h b/crypto/scatterwalk.h index 500a220ad908..87ed681cceba 100644 --- a/crypto/scatterwalk.h +++ b/crypto/scatterwalk.h | |||
@@ -20,15 +20,15 @@ | |||
20 | 20 | ||
21 | #include "internal.h" | 21 | #include "internal.h" |
22 | 22 | ||
23 | static inline struct scatterlist *sg_next(struct scatterlist *sg) | 23 | static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg) |
24 | { | 24 | { |
25 | return (++sg)->length ? sg : (void *)sg->page; | 25 | return (++sg)->length ? sg : (void *) sg_page(sg); |
26 | } | 26 | } |
27 | 27 | ||
28 | static inline unsigned long scatterwalk_samebuf(struct scatter_walk *walk_in, | 28 | static inline unsigned long scatterwalk_samebuf(struct scatter_walk *walk_in, |
29 | struct scatter_walk *walk_out) | 29 | struct scatter_walk *walk_out) |
30 | { | 30 | { |
31 | return !(((walk_in->sg->page - walk_out->sg->page) << PAGE_SHIFT) + | 31 | return !(((sg_page(walk_in->sg) - sg_page(walk_out->sg)) << PAGE_SHIFT) + |
32 | (int)(walk_in->offset - walk_out->offset)); | 32 | (int)(walk_in->offset - walk_out->offset)); |
33 | } | 33 | } |
34 | 34 | ||
@@ -60,7 +60,7 @@ static inline unsigned int scatterwalk_aligned(struct scatter_walk *walk, | |||
60 | 60 | ||
61 | static inline struct page *scatterwalk_page(struct scatter_walk *walk) | 61 | static inline struct page *scatterwalk_page(struct scatter_walk *walk) |
62 | { | 62 | { |
63 | return walk->sg->page + (walk->offset >> PAGE_SHIFT); | 63 | return sg_page(walk->sg) + (walk->offset >> PAGE_SHIFT); |
64 | } | 64 | } |
65 | 65 | ||
66 | static inline void scatterwalk_unmap(void *vaddr, int out) | 66 | static inline void scatterwalk_unmap(void *vaddr, int out) |
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 18d489c8b935..d741c63af42c 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c | |||
@@ -317,7 +317,7 @@ static void test_cipher(char *algo, int enc, | |||
317 | goto out; | 317 | goto out; |
318 | } | 318 | } |
319 | 319 | ||
320 | q = kmap(sg[0].page) + sg[0].offset; | 320 | q = kmap(sg_page(&sg[0])) + sg[0].offset; |
321 | hexdump(q, cipher_tv[i].rlen); | 321 | hexdump(q, cipher_tv[i].rlen); |
322 | 322 | ||
323 | printk("%s\n", | 323 | printk("%s\n", |
@@ -390,7 +390,7 @@ static void test_cipher(char *algo, int enc, | |||
390 | temp = 0; | 390 | temp = 0; |
391 | for (k = 0; k < cipher_tv[i].np; k++) { | 391 | for (k = 0; k < cipher_tv[i].np; k++) { |
392 | printk("page %u\n", k); | 392 | printk("page %u\n", k); |
393 | q = kmap(sg[k].page) + sg[k].offset; | 393 | q = kmap(sg_page(&sg[k])) + sg[k].offset; |
394 | hexdump(q, cipher_tv[i].tap[k]); | 394 | hexdump(q, cipher_tv[i].tap[k]); |
395 | printk("%s\n", | 395 | printk("%s\n", |
396 | memcmp(q, cipher_tv[i].result + temp, | 396 | memcmp(q, cipher_tv[i].result + temp, |
diff --git a/crypto/xcbc.c b/crypto/xcbc.c index 9f502b86e0ea..ac68f3b62fde 100644 --- a/crypto/xcbc.c +++ b/crypto/xcbc.c | |||
@@ -120,7 +120,7 @@ static int crypto_xcbc_digest_update2(struct hash_desc *pdesc, | |||
120 | 120 | ||
121 | do { | 121 | do { |
122 | 122 | ||
123 | struct page *pg = sg[i].page; | 123 | struct page *pg = sg_page(&sg[i]); |
124 | unsigned int offset = sg[i].offset; | 124 | unsigned int offset = sg[i].offset; |
125 | unsigned int slen = sg[i].length; | 125 | unsigned int slen = sg[i].length; |
126 | 126 | ||