This commit is contained in:
aixiao 2023-07-07 11:58:01 +08:00
parent abf85e1cbd
commit d420e58926
5 changed files with 762 additions and 738 deletions

View File

@ -7,6 +7,7 @@ OBJ := sha
all: aes.o sha.o all: aes.o sha.o
$(CC) $(CFLAGS) -o $(OBJ) $^ $(LDFLAGS) $(CC) $(CFLAGS) -o $(OBJ) $^ $(LDFLAGS)
$(STRIP) $(OBJ)
.c.o: .c.o:
$(CC) $(CFLAGS) -c $< $(CC) $(CFLAGS) -c $<

View File

@ -18,13 +18,15 @@
## Help Information ## Help Information
SHA SHA
Shell Strict AES 128 bit encryption tool Shell Strict AES 128 bit encryption tool
AUTHOR: AIXIAO@AIXIAO.ME Author: AIXIAO@AIXIAO.ME
Usage: Usage:
-k : key sha [-kfh?]
-f : Script file -k : Key
-f : Script File
-h -? : Print Help
静态链接: 静态链接:

3
aes.c
View File

@ -2,7 +2,6 @@
#include "aes.h" #include "aes.h"
#define Nb 4 #define Nb 4
#if defined(AES256) && (AES256 == 1) #if defined(AES256) && (AES256 == 1)
@ -174,7 +173,7 @@ static void ShiftRows(state_t * state)
(*state)[1][1] = (*state)[2][1]; (*state)[1][1] = (*state)[2][1];
(*state)[2][1] = (*state)[3][1]; (*state)[2][1] = (*state)[3][1];
(*state)[3][1] = temp; (*state)[3][1] = temp;
temp = (*state)[0][2]; temp = (*state)[0][2];
(*state)[0][2] = (*state)[2][2]; (*state)[0][2] = (*state)[2][2];
(*state)[2][2] = temp; (*state)[2][2] = temp;

5
aes.h
View File

@ -1,6 +1,11 @@
#ifndef _AES_H_ #ifndef _AES_H_
#define _AES_H_ #define _AES_H_
#include <unistd.h>
#include <time.h>
#include <sys/time.h>
#include <string.h>
#include <stdint.h> #include <stdint.h>
#include <stddef.h> #include <stddef.h>

1481
sha.c

File diff suppressed because it is too large Load Diff