Skip to content

Commit

Permalink
Merge commit from upstream
Browse files Browse the repository at this point in the history
# Conflicts:
#	.gitignore
#	Makefile
#	src/ldes56.c
#	src/md5.lua
#	src/md5lib.c
#	tests/test.lua
  • Loading branch information
starwing committed Apr 15, 2019
2 parents 0eee156 + 064d4a0 commit d137a15
Show file tree
Hide file tree
Showing 16 changed files with 413 additions and 164 deletions.
22 changes: 9 additions & 13 deletions Makefile
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,22 @@ CONFIG= ./config

include $(CONFIG)

ifeq "$(LUA_VERSION_NUM)" "500"
COMPAT_O= $(COMPAT_DIR)/compat-5.1.o
endif
COMPAT52_OBJS= src/compat-5.2.o

MD5_OBJS= src/md5.o src/md5lib.o $(COMPAT_O)
MD5_LIBNAME = md5.so
MD5_OBJS= src/md5.o src/md5lib.o
MD5_LUAS= src/md5.lua
MD5_LIBNAME = core.so

DES56_OBJS= src/des56.o src/ldes56.o
DES56_LIBNAME= des56.so

all: src/$(MD5_LIBNAME) src/$(DES56_LIBNAME)

src/$(MD5_LIBNAME) : $(MD5_OBJS)
export MACOSX_DEPLOYMENT_TARGET="10.3"; $(CC) $(CFLAGS) $(LIB_OPTION) -o src/$(MD5_LIBNAME) $(MD5_OBJS)
src/$(MD5_LIBNAME) : $(MD5_OBJS) $(COMPAT52_OBJS)
$(CC) $(CFLAGS) $(LIB_OPTION) -o src/$(MD5_LIBNAME) $(MD5_OBJS) $(COMPAT52_OBJS)

src/$(DES56_LIBNAME) : $(DES56_OBJS)
export MACOSX_DEPLOYMENT_TARGET="10.3"; $(CC) $(CFLAGS) $(LIB_OPTION) -o src/$(DES56_LIBNAME) $(DES56_OBJS)

$(COMPAT_DIR)/compat-5.1.o: $(COMPAT_DIR)/compat-5.1.c
$(CC) -c $(CFLAGS) -o $@ $(COMPAT_DIR)/compat-5.1.c
src/$(DES56_LIBNAME) : $(DES56_OBJS) $(COMPAT52_OBJS)
$(CC) $(CFLAGS) $(LIB_OPTION) -o src/$(DES56_LIBNAME) $(DES56_OBJS) $(COMPAT52_OBJS)

install: src/$(MD5_LIBNAME) src/$(DES56_LIBNAME)
mkdir -p $(LUA_LIBDIR)/md5
Expand All @@ -32,4 +28,4 @@ install: src/$(MD5_LIBNAME) src/$(DES56_LIBNAME)
cp src/$(DES56_LIBNAME) $(LUA_LIBDIR)

clean:
rm -f $(MD5_OBJS) src/$(MD5_LIBNAME) $(DES56_OBJS) src/$(DES56_LIBNAME)
rm -f $(MD5_OBJS) src/$(MD5_LIBNAME) $(DES56_OBJS) src/$(DES56_LIBNAME) $(COMPAT52_OBJS)
33 changes: 24 additions & 9 deletions README → README.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,32 +1,47 @@
MD5 - Cryptographic Library for Lua
Copyright 2003 PUC-Rio
http://www.keplerproject.org/md5
# MD5 - Cryptographic Library for Lua

http://keplerproject.github.io/md5/

MD5 offers basic cryptographic facilities for Lua 5.1: a hash (digest)
function, a pair crypt/decrypt based on MD5 and CFB, and a pair crypt/decrypt based
on DES with 56-bit keys.

MD5 current version is 1.1.2.
MD5 current version is 1.2.

Please check the documentation at /doc/us/ for more information.

## Installation

To install using [LuaRocks](https://github.com/keplerproject/luarocks) run:

```
luarocks install md5
```

To install on Linux/OSX/BSD, please edit the config file and then call

```
make
make install
```

The last step may require root privileges.

If you are using LuaRocks you can also install MD5 with:
## History

luarocks install md5
Version 1.2 [06/Sep/2013]

History
* Code adapted to compile for Lua 5.0, 5.1 and 5.2

Version 1.1.2 [12/May/2008]

* Fixed bug in 64-bit systems
* Fixed the Windows makefile to accept longer directory names
(patch by Alessandro Hecht and Ignacio Burgueño).


Please check the documentation at /doc/us/ for more information.
## License

MD5 is free software and uses the same license as Lua (MIT).

The DES 56 C library was implemented by Stuart Levy and uses a MIT license too (check the source)
The DES 56 C library was implemented by Stuart Levy and uses a MIT license too (check the source).
9 changes: 1 addition & 8 deletions config
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,9 @@ LUA_INC= $(PREFIX)/include
LIB_OPTION= -shared #for Linux
#LIB_OPTION= -bundle -undefined dynamic_lookup #for MacOS X

# Lua version number
# (according to Lua 5.1 definition:
# first version digit * 100 + second version digit
# e.g. Lua 5.0.2 => 500, Lua 5.1 => 501, Lua 5.1.1 => 501)
LUA_VERSION_NUM= 501
COMPAT_DIR= ../compat/src

# Compilation directives
WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -Wpointer-arith
INCS= -I$(LUA_INC) -I$(COMPAT_DIR)
INCS= -I$(LUA_INC)
CFLAGS= $(WARN) $(INCS)
CC= gcc

Expand Down
212 changes: 212 additions & 0 deletions doc/us/doc.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
body {
color: #47555c;
font-size: 16px;
font-family: "Open Sans", sans-serif;
margin: 0;
padding: 0;
background: #eff4ff;
}

a:link { color: #008fee; }
a:visited { color: #008fee; }
a:hover { color: #22a7ff; }

h1 { font-size:26px; }
h2 { font-size:24px; }
h3 { font-size:18px; }
h4 { font-size:16px; }

hr {
height: 1px;
background: #c1cce4;
border: 0px;
margin: 20px 0;
}

code {
font-family: "Open Sans Mono", "Andale Mono", monospace;
}

tt {
font-family: "Open Sans Mono", "Andale Mono", monospace;
}

body, td, th {
}

textarea, pre, tt {
font-family: "Open Sans Mono", "Andale Mono", monospace;
}

img {
border-width: 0px;
}

.example {
background-color: #323744;
color: white;
font-size: 16px;
padding: 16px 24px;
border-radius: 2px;
overflow-x: auto;
}

div.header, div.footer {
}

#container {
}

#product {
background-color: white;
padding: 10px;
height: 130px;
border-bottom: solid #d3dbec 1px;
}

#product big {
font-size: 42px;
}
#product strong {
font-weight: normal;
}

#product_logo {
float: right;
}

#product_name {
padding-top: 15px;
padding-left: 30px;
font-size: 42px;
font-weight: normal;
}

#product_description {
padding-left: 30px;
color: #757779;
}

#main {
background: #eff4ff;
margin: 0;
}

#navigation {
width: 100%;
background-color: rgb(44,62,103);
padding: 10px;
margin: 0;
}

#navigation h1 {
display: none;
}

#navigation a:hover {
text-decoration: underline;
}

#navigation ul li a {
color: rgb(136, 208, 255);
font-weight: bold;
text-decoration: none;
}

#navigation ul li li a {
color: rgb(136, 208, 255);
font-weight: normal;
text-decoration: none;
}

#navigation ul {
display: inline;
color: white;
padding: 0px;
padding-top: 10px;
padding-bottom: 10px;
}

#navigation li {
display: inline;
list-style-type: none;
padding-left: 5px;
padding-right: 5px;
}

#navigation li {
padding: 10px;
padding: 10px;
}

#navigation li li {
}

#navigation li:hover a {
color: rgb(166, 238, 255);
}

#content {
padding: 20px;
width: 800px;
margin-left: auto;
margin-right: auto;
}

#about {
display: none;
}

dl.reference {
background-color: white;
padding-left: 20px;
padding-right: 20px;
padding-bottom: 20px;
border: solid #d3dbec 1px;
}

dl.reference dt {
padding: 5px;
padding-top: 25px;
color: #637bbc;
}

dl.reference dl dt {
padding-top: 5px;
color: #637383;
}

dl.reference dd {
}

@media print {
body {
font: 10pt "Times New Roman", "TimeNR", Times, serif;
}
a {
font-weight:bold; color: #004080; text-decoration: underline;
}
#main {
background-color: #ffffff; border-left: 0px;
}
#container {
margin-left: 2%; margin-right: 2%; background-color: #ffffff;
}
#content {
margin-left: 0px; padding: 1em; border-left: 0px; border-right: 0px; background-color: #ffffff;
}
#navigation {
display: none;
}
#product_logo {
display: none;
}
#about img {
display: none;
}
.example {
font-family: "Andale Mono", monospace;
font-size: 8pt;
page-break-inside: avoid;
}
}
Loading

0 comments on commit d137a15

Please sign in to comment.