mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-06 16:36:16 +08:00
Fix kyber commands bugs
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2025 The GmSSL Project. All Rights Reserved.
|
||||
* Copyright 2014-2026 The GmSSL Project. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
@@ -49,6 +49,8 @@ int kyberdecap_main(int argc, char **argv)
|
||||
|
||||
KYBER_CIPHERTEXT ciphertext;
|
||||
|
||||
init_zeta();
|
||||
|
||||
memset(&key, 0, sizeof(key));
|
||||
|
||||
argc--;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2025 The GmSSL Project. All Rights Reserved.
|
||||
* Copyright 2014-2026 The GmSSL Project. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
@@ -19,10 +19,6 @@
|
||||
|
||||
static const char *usage = "-pubkey file [-out file] -outkey file [-verbose]\n";
|
||||
|
||||
|
||||
// decap 中的out一定是secret,而in 一定是ciphertext
|
||||
// encap 中的out 是decap的in,因此encap中的out是ciphertext,而输出的secret是特殊的
|
||||
|
||||
static const char *options =
|
||||
"Options\n"
|
||||
" -pubkey file Input public key file\n"
|
||||
@@ -52,6 +48,7 @@ int kyberencap_main(int argc, char **argv)
|
||||
|
||||
uint8_t outkey[32];
|
||||
|
||||
init_zeta();
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2025 The GmSSL Project. All Rights Reserved.
|
||||
* Copyright 2014-2026 The GmSSL Project. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
@@ -42,6 +42,8 @@ int kyberkeygen_main(int argc, char **argv)
|
||||
uint8_t *ppubout = pubout;
|
||||
size_t outlen = 0, puboutlen = 0;
|
||||
|
||||
init_zeta();
|
||||
|
||||
memset(&key, 0, sizeof(key));
|
||||
|
||||
argc--;
|
||||
|
||||
Reference in New Issue
Block a user