Re: [PATCH 1/1]: Revised CTR mode implementation

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

 



On Wed, Oct 03, 2007 at 03:43:58PM -0500, Joy Latten wrote:
> On Wed, 2007-10-03 at 18:28 +0800, Herbert Xu wrote:
> > On Wed, Oct 03, 2007 at 06:21:49PM +0800, Herbert Xu wrote:
> > 
> > > static void __ctr_inc_byte(u8 *a, int size)
> > > {
> > > 	__be8 *b = (__be8 *)(a + size);
> > > 	u8 c;
> > > 
> > > 	do {
> > > 		c = be8_to_cpu(*--b) + 1;
> > > 		*b = cpu_to_be8(c);
> > > 		if (c)
> > > 			break;
> > > 	} while (--size);
> > 
> > This should be a for loop and we can make it inline too.
>
> Besides being used in ctr_inc_quad(), isn't __ctr_inc_byte() also
> allowing for counters that might be less than an integer or 4 bytes? 

Yeah I suppose since we're selecting between ctr_inc_32 and
ctr_inc_quad anyway we might as well keep ctr_inc_byte.

Of course the other optino is to throw away ctr_inc_32 and
just call ctr_inc_quad always.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux