Skip to content

Commit

Permalink
make algo info const
Browse files Browse the repository at this point in the history
  • Loading branch information
dangfan committed Oct 25, 2023
1 parent 75192fd commit 02fe680
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions include/algo.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ typedef enum {
AES256,
} key_type_t;

extern int PRIVATE_KEY_LENGTH[KEY_TYPE_PKC_END];
extern int PUBLIC_KEY_LENGTH[KEY_TYPE_PKC_END];
extern int SIGNATURE_LENGTH[KEY_TYPE_PKC_END];
extern const int PRIVATE_KEY_LENGTH[KEY_TYPE_PKC_END];
extern const int PUBLIC_KEY_LENGTH[KEY_TYPE_PKC_END];
extern const int SIGNATURE_LENGTH[KEY_TYPE_PKC_END];

#define IS_ECC(type) ((type) == SECP256R1 || (type) == SECP256K1 || (type) == SECP384R1 || (type) == SM2 || (type) == ED25519 || (type) == X25519)
#define IS_SHORT_WEIERSTRASS(type) ((type) == SECP256R1 || (type) == SECP256K1 || (type) == SECP384R1 || (type) == SM2)
Expand Down
6 changes: 3 additions & 3 deletions src/algo.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
#include <algo.h>

int PRIVATE_KEY_LENGTH[KEY_TYPE_PKC_END] = {32, 32, 48, 32, 32, 32, 128, 192, 256};
int PUBLIC_KEY_LENGTH[KEY_TYPE_PKC_END] = {64, 64, 96, 64, 32, 32, 256, 384, 512};
int SIGNATURE_LENGTH[KEY_TYPE_PKC_END] = {64, 64, 96, 64, 64, 64, 256, 384, 512};
const int PRIVATE_KEY_LENGTH[KEY_TYPE_PKC_END] = {32, 32, 48, 32, 32, 32, 128, 192, 256};
const int PUBLIC_KEY_LENGTH[KEY_TYPE_PKC_END] = {64, 64, 96, 64, 32, 32, 256, 384, 512};
const int SIGNATURE_LENGTH[KEY_TYPE_PKC_END] = {64, 64, 96, 64, 64, 64, 256, 384, 512};

0 comments on commit 02fe680

Please sign in to comment.