socsvn commit: r255276 - soc2013/def/crashdump-head/sys/crypto
def at FreeBSD.org
def at FreeBSD.org
Sun Jul 28 18:06:27 UTC 2013
Author: def
Date: Sun Jul 28 18:06:27 2013
New Revision: 255276
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=255276
Log:
Remove xts_smallblock because it's not a part of the standard and crash dumps are larger than 16B.
Modified:
soc2013/def/crashdump-head/sys/crypto/xts.c
Modified: soc2013/def/crashdump-head/sys/crypto/xts.c
==============================================================================
--- soc2013/def/crashdump-head/sys/crypto/xts.c Sun Jul 28 17:54:42 2013 (r255275)
+++ soc2013/def/crashdump-head/sys/crypto/xts.c Sun Jul 28 18:06:27 2013 (r255276)
@@ -125,26 +125,6 @@
}
static __inline void
-xts_smallblock(const struct xts_alg *alg, const struct xts_ctx *data_ctx,
- uint64_t *tweak, const uint8_t *src, uint8_t *dst, int len)
-{
- uint8_t buf[XTS_BLK_BYTES], *p;
-
- /*
- * Encryption/decryption of sectors smaller then 128 bits is not defined
- * by IEEE P1619 standard.
- * To work around it encrypt such sector in CTR mode.
- * CTR tweak (counter) value is XTS-tweak xor'ed with block length, i.e.
- * entire small block has to be reencrypted after length change.
- */
- memset(buf, len, XTS_BLK_BYTES);
- xor128(buf, buf, tweak);
- alg->pa_encrypt(data_ctx, buf, buf);
- for (p = buf; len > 0; len--)
- *(dst++) = *(src++) ^ *(p++);
-}
-
-static __inline void
xts_start(const struct xts_alg *alg, const struct xts_ctx *tweak_ctx,
uint64_t *tweak, uint64_t sector, const uint8_t *xtweak)
{
@@ -165,11 +145,6 @@
xts_start(alg, tweak_ctx, tweak, sector, xtweak);
- if (len < XTS_BLK_BYTES) {
- xts_smallblock(alg, data_ctx, tweak, src, dst, len);
- return;
- }
-
while (len >= XTS_BLK_BYTES) {
xts_fullblock(alg->pa_encrypt, data_ctx, tweak, src, dst);
dst += XTS_BLK_BYTES;
@@ -192,11 +167,6 @@
xts_start(alg, tweak_ctx, tweak, sector, xtweak);
- if (len < XTS_BLK_BYTES) {
- xts_smallblock(alg, data_ctx, tweak, src, dst, len);
- return;
- }
-
if ((len & XTS_BLK_MASK) != 0)
len -= XTS_BLK_BYTES;
More information about the svn-soc-all
mailing list