mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-13 03:46:26 +08:00
jni api
This commit is contained in:
@@ -61,6 +61,8 @@ tests:
|
||||
lint:
|
||||
lint -DLINT $(INCLUDES) $(SRC)>fluff
|
||||
|
||||
update: depend
|
||||
|
||||
depend:
|
||||
@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
|
||||
$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
||||
|
||||
22
crypto/sms4/README.md
Normal file
22
crypto/sms4/README.md
Normal file
@@ -0,0 +1,22 @@
|
||||
## SMS4 Sub-Library of GMSSL
|
||||
|
||||
Encryption modes:
|
||||
|
||||
* ECB: encrypt or decrypt a block, process only one block per call.
|
||||
* CBC: process variable length input with zero padding, IV works as both input and output.
|
||||
* CFB: same as CBC
|
||||
* OFB: same as CBC
|
||||
|
||||
Optimization for specific architecture:
|
||||
|
||||
* AVX2: support ECB, CTR and CBC-decrypt (todo)
|
||||
* KNC-NI: support ECB, CTR and CBC-decrypt (todo)
|
||||
|
||||
Some future plans:
|
||||
|
||||
* more operation modes, GCM, XTS, FFX, OFB ...
|
||||
* more optimiazations: ARM/NEON, X86 ASM, GPU, ...
|
||||
* secure implementation: Bit Slicing, Timing attack ...
|
||||
* formally verified.
|
||||
|
||||
|
||||
@@ -48,10 +48,10 @@ int main(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
printf("sms4 key scheduling passed!\n");
|
||||
|
||||
|
||||
/* test encrypt once */
|
||||
sms4_encrypt(&key, plaintext, buf);
|
||||
|
||||
|
||||
if (memcmp(buf, ciphertext1, sizeof(ciphertext1)) != 0) {
|
||||
printf("sms4 encrypt not pass!\n");
|
||||
goto end;
|
||||
@@ -70,7 +70,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
printf("sms4 encrypt 1000000 times pass!\n");
|
||||
printf("sms4 all test vectors pass!\n");
|
||||
|
||||
|
||||
return 0;
|
||||
end:
|
||||
printf("some test vector failed\n");
|
||||
|
||||
Reference in New Issue
Block a user