2N/A#* GRUB -- GRand Unified Bootloader 2N/A#* Copyright (C) 2009 Free Software Foundation, Inc. 2N/A#* GRUB is free software: you can redistribute it and/or modify 2N/A#* it under the terms of the GNU General Public License as published by 2N/A#* the Free Software Foundation, either version 3 of the License, or 2N/A#* (at your option) any later version. 2N/A#* GRUB is distributed in the hope that it will be useful, 2N/A#* but WITHOUT ANY WARRANTY; without even the implied warranty of 2N/A#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2N/A#* GNU General Public License for more details. 2N/A#* You should have received a copy of the GNU General Public License 2N/A print (
"Usage: %s SOURCE DESTINATION" %
sys.
argv[
0])
2N/A# Strictly speaking CRC32/CRC24 work on bytes so this value should be 1 2N/A# But libgcrypt uses 64. Let's keep the value for compatibility. Since 2N/A "_gcry_digest_spec_crc32_rfc1510" :
64,
2N/A "_gcry_digest_spec_crc24_rfc2440" :
64,
2N/A "_gcry_digest_spec_md4" :
64,
2N/A "_gcry_digest_spec_md5" :
64,
2N/A "_gcry_digest_spec_rmd160" :
64,
2N/A "_gcry_digest_spec_sha1" :
64,
2N/A "_gcry_digest_spec_sha224" :
64,
2N/A "_gcry_digest_spec_sha256" :
64,
2N/A "_gcry_digest_spec_sha384" :
128,
2N/A "_gcry_digest_spec_sha512" :
128,
2N/A "_gcry_digest_spec_tiger" :
64,
2N/A "_gcry_digest_spec_whirlpool" :
64}
2N/A# rijndael is the only cipher using aliases. So no need for mangling, just 2N/A if re.
match (
"(Manifest|Makefile\.am|ac\.c|cipher\.c|hash-common\.c|hmac-tests\.c|md\.c|pubkey\.c)$",
cipher_file):
2N/A # Autogenerated files. Not even worth mentionning in ChangeLog 2N/A fw.
write (
"/* This file was automatically imported with \n")
2N/A fw.
write (
"void camellia_setup128(const unsigned char *key, grub_uint32_t *subkey);\n")
2N/A fw.
write (
"void camellia_setup192(const unsigned char *key, grub_uint32_t *subkey);\n")
2N/A fw.
write (
"void camellia_setup256(const unsigned char *key, grub_uint32_t *subkey);\n")
2N/A fw.
write (
"void camellia_encrypt128(const grub_uint32_t *subkey, grub_uint32_t *io);\n")
2N/A fw.
write (
"void camellia_encrypt192(const grub_uint32_t *subkey, grub_uint32_t *io);\n")
2N/A fw.
write (
"void camellia_encrypt256(const grub_uint32_t *subkey, grub_uint32_t *io);\n")
2N/A fw.
write (
"void camellia_decrypt128(const grub_uint32_t *subkey, grub_uint32_t *io);\n")
2N/A fw.
write (
"void camellia_decrypt192(const grub_uint32_t *subkey, grub_uint32_t *io);\n")
2N/A fw.
write (
"void camellia_decrypt256(const grub_uint32_t *subkey, grub_uint32_t *io);\n")
2N/A # Whole libgcrypt is distributed under GPLv3+ or compatible 2N/A print (
"ERROR: Unknown digest blocksize: %s\n" 2N/A # Used only for selftests. 2N/A m =
re.
match (
"(static byte|static unsigned char) (weak_keys_chksum)\[[0-9]*\] =",
line)
2N/A # We're optimising for size. 2N/A if not re.
match (
"(run_selftests|selftest|_gcry_aes_c.._..c|_gcry_[a-z0-9]*_hash_buffer|tripledes_set2keys|do_tripledes_set_extra_info|_gcry_rmd160_mixblock|serpent_test)",
line)
is None:
2N/A fw.
write (
"static const char *serpent_test (void) { return 0; }\n");
2N/A m =
re.
match (
"(static const char( |)\*|static gpg_err_code_t|void|static int|static gcry_err_code_t)$",
line)
2N/Afw.
write (
"%04d-%02d-%02d Automatic import tool\n" % \