chiark / gitweb /
catacomb-import-update: Extra massaging of keccak code
authorMark Wooding <mdw@distorted.org.uk>
Thu, 26 Sep 2019 03:43:00 +0000 (04:43 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 2 Jan 2020 00:42:03 +0000 (00:42 +0000)
These .c files are not compiled yet, although this change does change
the output from --convert.

(This commit was originally an `@@@' commit from Mark Wooding,
"@@@ import-catacomb-crypto keccak/sha3".  I have added this commit
message.)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
catacomb-import-update

index 0ed4fe5e28ec8dc942d0d7409700c8ecfe7369f9..e15b4e4a478baedf57e1795d92a15f7979415c05 100755 (executable)
@@ -431,6 +431,9 @@ EOF
        { push @lookahead, $line2, $line1; }
     }
 
+    if ($line eq "static void rightenc_sz(shake_ctx *ctx, size_t n)")
+      { $skip_reason = "defun"; next LINE; }
+
     ## Other random tweaks.
     $line =~ s/ct_memeq/consttime_memeq/g;
     $line =~ s/\bSHA512_HASHSZ\b/SHA512_DIGEST_SIZE/g;
@@ -439,6 +442,7 @@ EOF
     $line =~ s{\b sha512_hash \( ([^,]+) (,\s*) ([^,]+) (,\s*) ([^)]+) \)}
              {sha512_process_bytes($3$2$5$2$1)}gx;
     $line =~ s/\bsha512_done\b/sha512_finish_ctx/g;
+    $line =~ s/\bdo\s*;\s*while\b/do {} while/g;
 
     ## Fix the provenance note.
     if ($line =~ /^ \* This file is part of Catacomb/) {