This commit is contained in:
Zhi Guan
2016-04-18 13:41:56 +02:00
parent 37ac6cd45a
commit da6bb109b4
27 changed files with 1494 additions and 255 deletions

View File

@@ -79,5 +79,5 @@ clean:
# DO NOT DELETE THIS LINE -- make depend depends on it.
sm3.o: sm3.c sm3.h byteorder.h
sm3test.o: sm3test.c sm3.h byteorder.h
sm3.o: sm3.c sm3.h ../byteorder.h
sm3test.o: sm3test.c sm3.h ../byteorder.h

View File

@@ -1,22 +0,0 @@
#ifndef ZCRYPT_BYTEORDER_H
#define ZCRYPT_BYTEORDER_H
#ifdef CPU_BIGENDIAN
#define cpu_to_be16(v) (v)
#define cpu_to_be32(v) (v)
#define be16_to_cpu(v) (v)
#define be32_to_cpu(v) (v)
#else
#define cpu_to_be16(v) (((v)<< 8) | ((v)>>8))
#define cpu_to_be32(v) (((v)>>24) | (((v)>>8)&0xff00) | (((v)<<8)&0xff0000) | ((v)<<24))
#define be16_to_cpu(v) cpu_to_be16(v)
#define be32_to_cpu(v) cpu_to_be32(v)
#endif
#endif

View File

@@ -51,7 +51,7 @@
#include "sm3.h"
#include "byteorder.h"
#include "../byteorder.h"
#include <string.h>