utils/gcm-ref (poly64_mul_simple): Pad v based on the length of v.
[catacomb] / utils / gcm-ref
index ec25bb8..0367241 100755 (executable)
@@ -281,7 +281,7 @@ def poly64_mul_simple(u, v, presfn, wd, dispwd, mulwd, uwhat, vwhat):
   ## straightforward except for the 96-bit case, where we end up with two
   ## short pieces which we pad at the beginning.
   if uw%mulwd: pad = (-uw)%mulwd; u += C.ByteString.zero(pad); uw += pad
-  if vw%mulwd: pad = (-uw)%mulwd; v += C.ByteString.zero(pad); vw += pad
+  if vw%mulwd: pad = (-vw)%mulwd; v += C.ByteString.zero(pad); vw += pad
   uu = split_gf(u, mulwd)
   vv = split_gf(v, mulwd)