Thread (7 messages) 7 messages, 2 authors, 2015-05-29

Re: crypto: algif_aead - Switch to new AEAD interface

From: Stephan Mueller <hidden>
Date: 2015-05-27 10:10:12

Am Mittwoch, 27. Mai 2015, 17:24:41 schrieb Herbert Xu:

Hi Herbert,
-
-	if (ctx->enc) {
-		/* round up output buffer to multiple of block size */
-		outlen = ((used + bs - 1) / bs * bs);
Why wouldn't the round up for the output not be needed any more? If the caller 
provides input data that is not multiple of block sizes and the output buffer 
is also not multiple of block sizes, wouldn't an encrypt overstep boundaries?
-		/* add the size needed for the auth tag to be created */
-		outlen += as;
-	} else {
-		/* output data size is input without the authentication tag */
-		outlen = used - as;
-		/* round up output buffer to multiple of block size */
-		outlen = ((outlen + bs - 1) / bs * bs);
Same here.
-	}
+	used -= ctx->aead_assoclen + (ctx->enc ? as : 0);


Ciao
Stephan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help