diff --git a/Makefile b/Makefile index ae79951..45789a7 100644 --- a/Makefile +++ b/Makefile @@ -28,11 +28,6 @@ $(BIN): $(OBJS) %.o: %.c $(CC) $(CFLAGS) -c -o $@ $< -fn.o: luainit.inc - -luainit.inc: luainit.lua - echo -n -e "\0" | cat $< - | xxd -i > $@ - clean: rm -f *.o *.inc rm -f $(BIN) diff --git a/fn.c b/fn.c index e67a26c..98bf245 100644 --- a/fn.c +++ b/fn.c @@ -34,10 +34,31 @@ -static const char fn_initcode[] = -{ - #include "luainit.inc" -}; +static const char fn_initcode[] = \ +"function AES(k, v)\n" +" if not k then k = \"00000000000000000000000000000000\" end\n" +" if not v then v = 0 end\n" +" return { t = \"AES\", k = k, v = v }\n" +"end\n" +"\n" +"\n" +"function _3K3DES(k, v)\n" +" if not k then k = \"000000000000000000000000000000000000000000000000\" end\n" +" if not v then v = 0 end\n" +" return { t = \"3K3DES\", k = k, v = v }\n" +"end\n" +"\n" +"function _3DES(k, v)\n" +" if not k then k = \"00000000000000000000000000000000\" end\n" +" if not v then v = 0 end\n" +" return { t = \"3DES\", k = k, v = v }\n" +"end\n" +"\n" +"function DES(k, v)\n" +" if not k then k = \"0000000000000000\" end\n" +" if not v then v = 0 end\n" +" return { t = \"DES\", k = k, v = v }\n" +"end"; diff --git a/luainit.lua b/luainit.lua deleted file mode 100644 index 06e12e9..0000000 --- a/luainit.lua +++ /dev/null @@ -1,24 +0,0 @@ -function AES(k, v) - if not k then k = "00000000000000000000000000000000" end - if not v then v = 0 end - return { t = "AES", k = k, v = v } -end - - -function _3K3DES(k, v) - if not k then k = "000000000000000000000000000000000000000000000000" end - if not v then v = 0 end - return { t = "3K3DES", k = k, v = v } -end - -function _3DES(k, v) - if not k then k = "00000000000000000000000000000000" end - if not v then v = 0 end - return { t = "3DES", k = k, v = v } -end - -function DES(k, v) - if not k then k = "0000000000000000" end - if not v then v = 0 end - return { t = "DES", k = k, v = v } -end