Sponsored by: The FreeBSD Foundation
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/opencrypto/cryptosoft.c | ||
---|---|---|
444–447 | ||
460 | ||
488 | Couldn't this be a for-loop as well? for (resid = crp->crp_payload_length; resid >= blksz; resid -= todo) | |
535 | Suppose todo == inlen, so the current input segment is a multiple of the block size. Then, on the next iteration we'll bounce the first block of the next segment through blk, even though that's not necessarily required. I don't think there's a correctness problem there, just seems suboptimal. | |
572 | Again, seems like this should be a for-loop. | |
603 | Same comment about not reloading the segment if outlen == 0 after subtracting todo. |
sys/opencrypto/cryptosoft.c | ||
---|---|---|
488 | I did this more to match swcr_encdec(), but I could make it a for loop. I think I want all of them to be the same though, so I might go back and adjust swcr_encdec() then. | |
535 | I think in the chacha20_poly1305 case I noticed this and fixed it. Part of the problem is that the GCM update routine wants blocks except for the last update. I think though I could handle this case by just checking for 'inlen == todo' here. |
sys/opencrypto/cryptosoft.c | ||
---|---|---|
535 | Actually, this suboptimal behavior is present even in swcr_encdec(), so I will have to go back and fix them all. |
- Use for loop instead of while.
- Handle boundary conditions when segment ends on a block boundary.