Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sgxwallet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董子豪
sgxwallet
Commits
a1dfeb15
Unverified
Commit
a1dfeb15
authored
4 years ago
by
Oleh Nikolaiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2002 refactoring
parent
b4581917
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
10 deletions
+4
-10
DKGUtils.cpp
secure_enclave/DKGUtils.cpp
+1
-1
secure_enclave.c
secure_enclave/secure_enclave.c
+3
-9
No files found.
secure_enclave/DKGUtils.cpp
View file @
a1dfeb15
...
...
@@ -40,7 +40,7 @@
#include "DHDkg.h"
using
namespace
std
;
using
namespace
std
;
string
stringFromFr
(
libff
::
alt_bn128_Fr
&
_el
)
{
...
...
This diff is collapsed.
Click to expand it.
secure_enclave/secure_enclave.c
View file @
a1dfeb15
...
...
@@ -970,7 +970,7 @@ void trustedGenerateEcdsaKeyAES(int *errStatus, char *errString,
pub_key_y
[
i
]
=
'0'
;
}
strncpy
(
pub_key_y
+
n_zeroes
,
arr_y
,
1024
-
n_zeroes
);
char
skey_str
[
mpz_sizeinbase
(
skey
,
ECDSA_SKEY_BASE
)
+
2
];
char
skey_str
[
ECDSA_SKEY_LEN
];
//mpz_get_str(skey_str, ECDSA_SKEY_BASE, skey);
char
arr_skey_str
[
mpz_sizeinbase
(
skey
,
ECDSA_SKEY_BASE
)
+
2
];
mpz_get_str
(
arr_skey_str
,
ECDSA_SKEY_BASE
,
skey
);
...
...
@@ -979,6 +979,7 @@ void trustedGenerateEcdsaKeyAES(int *errStatus, char *errString,
skey_str
[
i
]
=
'0'
;
}
strncpy
(
skey_str
+
n_zeroes
,
arr_skey_str
,
65
-
n_zeroes
);
skey_str
[
ECDSA_SKEY_LEN
-
1
]
=
0
;
snprintf
(
errString
,
BUF_LEN
,
"skey is %s len %d
\n
"
,
skey_str
,
strlen
(
skey_str
));
int
stat
=
AES_encrypt
(
skey_str
,
encryptedPrivateKey
);
...
...
@@ -1233,8 +1234,6 @@ void trustedDecryptKeyAES(int *errStatus, char *errString, uint8_t *encryptedPri
uint32_t
enc_len
,
char
*
key
)
{
LOG_DEBUG
(
__FUNCTION__
);
uint32_t
decLen
;
*
errStatus
=
-
9
;
int
status
=
AES_decrypt
(
encryptedPrivateKey
,
enc_len
,
key
);
...
...
@@ -1245,12 +1244,6 @@ void trustedDecryptKeyAES(int *errStatus, char *errString, uint8_t *encryptedPri
return
;
}
if
(
decLen
>
MAX_KEY_LENGTH
)
{
*
errStatus
=
1
;
snprintf
(
errString
,
BUF_LEN
,
"wrong decLen"
);
//"decLen != MAX_KEY_LENGTH");
return
;
}
*
errStatus
=
-
10
;
uint64_t
keyLen
=
strnlen
(
key
,
MAX_KEY_LENGTH
);
...
...
@@ -1622,6 +1615,7 @@ trustedGetBlsPubKeyAES(int *errStatus, char *errString, uint8_t *encryptedPrivat
skey_hex
[
ECDSA_SKEY_LEN
-
1
]
=
0
;
if
(
calc_bls_public_key
(
skey_hex
,
bls_pub_key
)
!=
0
)
{
LOG_ERROR
(
skey_hex
);
*
errStatus
=
-
1
;
snprintf
(
errString
,
BUF_LEN
,
"could not calculate bls public key"
);
return
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment