From d586997a6fa30a66f9b510c1cedeffda87bef3e0 Mon Sep 17 00:00:00 2001 From: fumiama Date: Sat, 11 Dec 2021 17:42:40 +0800 Subject: [PATCH] add more instructions --- README.md | 19 ++++++++++++------- md5.c | 2 ++ tea.c | 2 ++ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f240801..5d50c84 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# simple-md5-lib +# simple-crypto -Simple C lib of the MD5 algorithm +Simple C lib of the MD5 & TEA algorithm # Install ```bash -git clone https://github.com/fumiama/simple-md5-lib.git -cd simple-md5-lib +git clone https://github.com/fumiama/simple-crypto.git +cd simple-crypto mkdir build cd build cmake .. @@ -16,11 +16,16 @@ make install # Usage -1. Include `simplemd5.h` in your c program. +1. Include `simplecrypto.h` in your c program. ```c -#include +#include ``` -2. Call `md5` function. Don't forget to `free` the returned digest. +2. Call functions. Don't forget to `free` the returned digest. ```c uint8_t* md5(const uint8_t *data, size_t data_len); + +TEADAT* tea_encrypt_qq(const TEA t[4], const TEADAT* src); +TEADAT* tea_encrypt(const TEA t[4], const uint32_t sumtable[0x10], const TEADAT* src); +TEADAT* tea_decrypt_qq(const TEA t[4], const TEADAT* src); +TEADAT* tea_decrypt(const TEA t[4], const uint32_t sumtable[0x10], const TEADAT* src); ``` \ No newline at end of file diff --git a/md5.c b/md5.c index c7d9d9b..1889b6c 100644 --- a/md5.c +++ b/md5.c @@ -1,3 +1,5 @@ +// https://github.com/pod32g/MD5 + #include #include #if !__APPLE__ diff --git a/tea.c b/tea.c index 02b78e1..e2b5ebd 100644 --- a/tea.c +++ b/tea.c @@ -1,3 +1,5 @@ +// https://github.com/Mrs4s/MiraiGo/blob/master/binary/tea.go + #include #include #include