aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_keys.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/net/sunrpc/auth_gss/gss_krb5_keys.c b/net/sunrpc/auth_gss/gss_krb5_keys.c
index 76e42e6be755..24589bd2a4b6 100644
--- a/net/sunrpc/auth_gss/gss_krb5_keys.c
+++ b/net/sunrpc/auth_gss/gss_krb5_keys.c
@@ -59,6 +59,7 @@
59#include <linux/crypto.h> 59#include <linux/crypto.h>
60#include <linux/sunrpc/gss_krb5.h> 60#include <linux/sunrpc/gss_krb5.h>
61#include <linux/sunrpc/xdr.h> 61#include <linux/sunrpc/xdr.h>
62#include <linux/lcm.h>
62 63
63#ifdef RPC_DEBUG 64#ifdef RPC_DEBUG
64# define RPCDBG_FACILITY RPCDBG_AUTH 65# define RPCDBG_FACILITY RPCDBG_AUTH
@@ -72,7 +73,7 @@
72static void krb5_nfold(u32 inbits, const u8 *in, 73static void krb5_nfold(u32 inbits, const u8 *in,
73 u32 outbits, u8 *out) 74 u32 outbits, u8 *out)
74{ 75{
75 int a, b, c, lcm; 76 unsigned long ulcm;
76 int byte, i, msbit; 77 int byte, i, msbit;
77 78
78 /* the code below is more readable if I make these bytes 79 /* the code below is more readable if I make these bytes
@@ -82,17 +83,7 @@ static void krb5_nfold(u32 inbits, const u8 *in,
82 outbits >>= 3; 83 outbits >>= 3;
83 84
84 /* first compute lcm(n,k) */ 85 /* first compute lcm(n,k) */
85 86 ulcm = lcm(inbits, outbits);
86 a = outbits;
87 b = inbits;
88
89 while (b != 0) {
90 c = b;
91 b = a%b;
92 a = c;
93 }
94
95 lcm = outbits*inbits/a;
96 87
97 /* now do the real work */ 88 /* now do the real work */
98 89
@@ -101,7 +92,7 @@ static void krb5_nfold(u32 inbits, const u8 *in,
101 92
102 /* this will end up cycling through k lcm(k,n)/k times, which 93 /* this will end up cycling through k lcm(k,n)/k times, which
103 is correct */ 94 is correct */
104 for (i = lcm-1; i >= 0; i--) { 95 for (i = ulcm-1; i >= 0; i--) {
105 /* compute the msbit in k which gets added into this byte */ 96 /* compute the msbit in k which gets added into this byte */
106 msbit = ( 97 msbit = (
107 /* first, start with the msbit in the first, 98 /* first, start with the msbit in the first,