mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-08-07 21:53:41 +08:00
SM4/CTR
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
|
||||
#include "sm3.h"
|
||||
#include "byteorder.h"
|
||||
#include "../byteorder.h"
|
||||
#include <string.h>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user