aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-06-22 13:54:18 +0000
committerlloyd <[email protected]>2010-06-22 13:54:18 +0000
commit6d9ad105f26ce29b15a3d2a1dc8d3f842bc281b0 (patch)
tree89d656e974f4520c04b9f58039b4493bf6196a49 /src
parent238869aed29c3d703650ce55404929dc7e3f31fb (diff)
Only call the scalar versions if we actually have leftover blocks to
process
Diffstat (limited to 'src')
-rw-r--r--src/block/idea_sse2/idea_sse2.cpp6
-rw-r--r--src/block/noekeon_simd/noekeon_simd.cpp6
-rw-r--r--src/block/serpent_simd/serp_simd.cpp6
-rw-r--r--src/block/xtea_simd/xtea_simd.cpp6
4 files changed, 16 insertions, 8 deletions
diff --git a/src/block/idea_sse2/idea_sse2.cpp b/src/block/idea_sse2/idea_sse2.cpp
index 0948bf46a..a7ded37e1 100644
--- a/src/block/idea_sse2/idea_sse2.cpp
+++ b/src/block/idea_sse2/idea_sse2.cpp
@@ -204,7 +204,8 @@ void IDEA_SSE2::encrypt_n(const byte in[], byte out[], u32bit blocks) const
blocks -= 8;
}
- IDEA::encrypt_n(in, out, blocks);
+ if(blocks)
+ IDEA::encrypt_n(in, out, blocks);
}
/*
@@ -220,7 +221,8 @@ void IDEA_SSE2::decrypt_n(const byte in[], byte out[], u32bit blocks) const
blocks -= 8;
}
- IDEA::decrypt_n(in, out, blocks);
+ if(blocks)
+ IDEA::decrypt_n(in, out, blocks);
}
}
diff --git a/src/block/noekeon_simd/noekeon_simd.cpp b/src/block/noekeon_simd/noekeon_simd.cpp
index c36f269a4..be7ca86da 100644
--- a/src/block/noekeon_simd/noekeon_simd.cpp
+++ b/src/block/noekeon_simd/noekeon_simd.cpp
@@ -103,7 +103,8 @@ void Noekeon_SIMD::encrypt_n(const byte in[], byte out[], u32bit blocks) const
blocks -= 4;
}
- Noekeon::encrypt_n(in, out, blocks);
+ if(blocks)
+ Noekeon::encrypt_n(in, out, blocks);
}
/*
@@ -159,7 +160,8 @@ void Noekeon_SIMD::decrypt_n(const byte in[], byte out[], u32bit blocks) const
blocks -= 4;
}
- Noekeon::decrypt_n(in, out, blocks);
+ if(blocks)
+ Noekeon::decrypt_n(in, out, blocks);
}
}
diff --git a/src/block/serpent_simd/serp_simd.cpp b/src/block/serpent_simd/serp_simd.cpp
index ba587e93d..c64514de1 100644
--- a/src/block/serpent_simd/serp_simd.cpp
+++ b/src/block/serpent_simd/serp_simd.cpp
@@ -188,7 +188,8 @@ void Serpent_SIMD::encrypt_n(const byte in[], byte out[], u32bit blocks) const
blocks -= 4;
}
- Serpent::encrypt_n(in, out, blocks);
+ if(blocks)
+ Serpent::encrypt_n(in, out, blocks);
}
/*
@@ -204,7 +205,8 @@ void Serpent_SIMD::decrypt_n(const byte in[], byte out[], u32bit blocks) const
blocks -= 4;
}
- Serpent::decrypt_n(in, out, blocks);
+ if(blocks)
+ Serpent::decrypt_n(in, out, blocks);
}
}
diff --git a/src/block/xtea_simd/xtea_simd.cpp b/src/block/xtea_simd/xtea_simd.cpp
index 44a4e81b6..794533d5e 100644
--- a/src/block/xtea_simd/xtea_simd.cpp
+++ b/src/block/xtea_simd/xtea_simd.cpp
@@ -102,7 +102,8 @@ void XTEA_SIMD::encrypt_n(const byte in[], byte out[], u32bit blocks) const
blocks -= 8;
}
- XTEA::encrypt_n(in, out, blocks);
+ if(blocks)
+ XTEA::encrypt_n(in, out, blocks);
}
/*
@@ -118,7 +119,8 @@ void XTEA_SIMD::decrypt_n(const byte in[], byte out[], u32bit blocks) const
blocks -= 8;
}
- XTEA::decrypt_n(in, out, blocks);
+ if(blocks)
+ XTEA::decrypt_n(in, out, blocks);
}
}