Skip to content

Commit 08b4c8a

Browse files
committed
first commit
0 parents  commit 08b4c8a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+30314
-0
lines changed

5.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111

hexdump.c

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#include <stdio.h>
2+
#include <string.h>
3+
4+
#define DEBUG(fmt,arg...) fprintf(stderr, fmt"\n", ##arg)
5+
//#define DEBUG(fmt,arg...) debug_print(fmt"\n", ##arg)
6+
7+
void hexdump(const void *data, unsigned int len)
8+
{
9+
char str[160], octet[10];
10+
unsigned int ofs, i, k;
11+
const unsigned char *buf = (const unsigned char *)data;
12+
const char *dimm = "+------------------------------------------------------------------------------+";
13+
14+
DEBUG("%s", dimm);
15+
DEBUG("| Offset : 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF |");
16+
DEBUG("%s", dimm);
17+
18+
for (ofs = 0; ofs < len; ofs += 16) {
19+
sprintf( str, "| %08x: ", ofs );
20+
21+
for (i = 0; i < 16; i++) {
22+
if ((i + ofs) < len)
23+
sprintf( octet, "%02X ", buf[ofs + i] );
24+
else
25+
strcpy( octet, " " );
26+
27+
strcat( str, octet );
28+
}
29+
strcat( str, " " );
30+
k = strlen( str );
31+
32+
for (i = 0; i < 16; i++) {
33+
if ((i + ofs) < len)
34+
str[k++] = (0x20 <= (buf[ofs + i]) && (buf[ofs + i]) <= 0x7E) ? buf[ofs + i] : '.';
35+
else
36+
str[k++] = ' ';
37+
}
38+
39+
str[k] = '\0';
40+
DEBUG("%s |", str);
41+
}
42+
43+
DEBUG("%s", dimm);
44+
}
45+
46+

hexdump.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#ifndef __HEXDUMP_H__
2+
#define __HEXDUMP_H__
3+
4+
void hexdump(const void *data, unsigned int len);
5+
6+
#endif /* __HEXDUMP_H__ */
7+
8+

main.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <stdio.h>
2+
#include <stdlib.h>
3+
#include <time.h>
4+
#include "sm2.h"
5+
6+
7+
extern int sm2_test();
8+
9+
int main(){
10+
11+
printf("begin sm2 test...\n");
12+
13+
sm2_test();
14+
15+
printf("\n``````````````````this is end```````````````````````\n");
16+
return 0;
17+
}

main.c.bak

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <stdio.h>
2+
#include <stdlib.h>
3+
#include <time.h>
4+
#include "sm2.h"
5+
6+
7+
extern int sm2_test();
8+
9+
int main(){
10+
11+
printf("sm2 test...\n");
12+
13+
sm2_test();
14+
15+
printf("\n``````````````````this is end```````````````````````\n");
16+
return 0;
17+
}

makefile

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
############################################################################
2+
#makefile
3+
############################################################################
4+
5+
#****************************************************************************
6+
# Cross complie path
7+
#****************************************************************************
8+
#GCC_PATH=D:\msysgit\mingw
9+
#CHAIN_ROOT=/home/yang/imax283/ctools/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin
10+
11+
#CROSS_COMPILE=$(CHAIN_ROOT)/arm-none-linux-gnueabi-
12+
13+
CHAIN_ROOT= /home/yang/b503/ctools/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin
14+
CROSS_COMPILE=$(CHAIN_ROOT)/arm-linux-gnueabihf-
15+
#CROSS_COMPILE =
16+
17+
CC := $(CROSS_COMPILE)gcc
18+
CXX := $(CROSS_COMPILE)g++
19+
AS := $(CROSS_COMPILE)as
20+
AR := $(CROSS_COMPILE)ar
21+
LD := $(CROSS_COMPILE)ld
22+
RANLIB := $(CROSS_COMPILE)ranlib
23+
OBJDUMP:= $(CROSS_COMPILE)objdump
24+
OBJCOPY:= $(CROSS_COMPILE)objcopy
25+
STRIP := $(CROSS_COMPILE)strip
26+
27+
#****************************************************************************
28+
# Flags
29+
#****************************************************************************
30+
31+
CFLAGS= -g -o2
32+
LDSCRIPT=
33+
LDFLAGS=
34+
35+
36+
#****************************************************************************
37+
# Source files
38+
#****************************************************************************
39+
SRC_C=$(shell find . -name "*.c")
40+
41+
OBJ_C=$(patsubst %.c, %.o, $(SRC_C))
42+
43+
SRCS := $(SRC_C) $(SRC_C)
44+
45+
OBJS := $(OBJ_C)
46+
47+
48+
#****************************************************************************
49+
# Targets of the build
50+
#****************************************************************************
51+
TARGET := test
52+
53+
.PHONY: clean
54+
all: prebuild $(TARGET)
55+
56+
#****************************************************************************
57+
# TARGET
58+
#****************************************************************************
59+
prebuild:
60+
@echo Building exe...
61+
62+
$(TARGET) : $(OBJS)
63+
@echo Generating exe...
64+
$(CC) -o $(TARGET) $(OBJS) $(LDSCRIPT)
65+
@echo OK!
66+
67+
%.o : %.c
68+
$(CC) -c $(CFLAGS) $< -o $@
69+
70+
clean:
71+
@echo The following files:
72+
rm -f $(TARGET) *.so
73+
find . -name "*.[od]" |xargs rm
74+
@echo Removed!

makefile~

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
############################################################################
2+
#makefile
3+
############################################################################
4+
5+
#****************************************************************************
6+
# Cross complie path
7+
#****************************************************************************
8+
#GCC_PATH=D:\msysgit\mingw
9+
#CHAIN_ROOT=/home/yang/imax283/ctools/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin
10+
11+
#CROSS_COMPILE=$(CHAIN_ROOT)/arm-none-linux-gnueabi-
12+
13+
#CHAIN_ROOT= /home/yang/b503/ctools/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin
14+
#CROSS_COMPILE=$(CHAIN_ROOT)/arm-linux-gnueabihf-
15+
CROSS_COMPILE =
16+
17+
CC := $(CROSS_COMPILE)gcc
18+
CXX := $(CROSS_COMPILE)g++
19+
AS := $(CROSS_COMPILE)as
20+
AR := $(CROSS_COMPILE)ar
21+
LD := $(CROSS_COMPILE)ld
22+
RANLIB := $(CROSS_COMPILE)ranlib
23+
OBJDUMP:= $(CROSS_COMPILE)objdump
24+
OBJCOPY:= $(CROSS_COMPILE)objcopy
25+
STRIP := $(CROSS_COMPILE)strip
26+
27+
#****************************************************************************
28+
# Flags
29+
#****************************************************************************
30+
31+
CFLAGS=
32+
LDSCRIPT=
33+
LDFLAGS=
34+
35+
36+
#****************************************************************************
37+
# Source files
38+
#****************************************************************************
39+
SRC_C=$(shell find . -name "*.c")
40+
41+
OBJ_C=$(patsubst %.c, %.o, $(SRC_C))
42+
43+
SRCS := $(SRC_C) $(SRC_C)
44+
45+
OBJS := $(OBJ_C)
46+
47+
48+
#****************************************************************************
49+
# Targets of the build
50+
#****************************************************************************
51+
TARGET := test
52+
53+
.PHONY: clean
54+
all: prebuild $(TARGET)
55+
56+
#****************************************************************************
57+
# TARGET
58+
#****************************************************************************
59+
prebuild:
60+
@echo Building exe...
61+
62+
$(TARGET) : $(OBJS)
63+
@echo Generating exe...
64+
$(CC) -o $(TARGET) $(OBJS) $(LDSCRIPT)
65+
@echo OK!
66+
67+
%.o : %.c
68+
$(CC) -c $(CFLAGS) $< -o $@
69+
70+
clean:
71+
@echo The following files:
72+
rm -f $(TARGET) *.so
73+
find . -name "*.[od]" |xargs rm
74+
@echo Removed!

0 commit comments

Comments
 (0)