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
03c6d6dd
Unverified
Commit
03c6d6dd
authored
Jan 22, 2020
by
svetaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-2003 Add method generateSEK
parent
98bc15d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
0 deletions
+86
-0
SEKManager.cpp
SEKManager.cpp
+57
-0
SEKManager.h
SEKManager.h
+29
-0
No files found.
SEKManager.cpp
0 → 100644
View file @
03c6d6dd
/*
Copyright (C) 2019-Present SKALE Labs
This file is part of sgxwallet.
sgxwallet is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
sgxwallet is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with sgxwallet. If not, see <https://www.gnu.org/licenses/>.
@file SEKManager.cpp
@author Stan Kladko
@date 2019
*/
#include "SEKManager.h"
#include "RPCException.h"
#include "BLSCrypto.h"
#include "LevelDB.h"
#include <iostream>
#include "sgxwallet_common.h"
#include "sgxwallet.h"
void
generate_SEK
(){
char
*
errMsg
=
(
char
*
)
calloc
(
1024
,
1
);
int
err_status
=
0
;
uint8_t
*
encr_pr_key
=
(
uint8_t
*
)
calloc
(
1024
,
1
);
uint32_t
enc_len
=
0
;
status
=
generate_SEK
(
eid
,
&
err_status
,
errMsg
,
encr_pr_key
,
&
enc_len
);
if
(
err_status
!=
0
){
std
::
cerr
<<
"RPCException thrown"
<<
std
::
endl
;
throw
RPCException
(
-
666
,
errMsg
)
;
}
char
*
hexEncrKey
=
(
char
*
)
calloc
(
BUF_LEN
,
1
);
//carray2Hex(encr_pr_key, enc_len, hexEncrKey);
std
::
cerr
<<
"key is "
<<
errMsg
<<
std
::
endl
;
//levelDb->writeDataUnique("SEK", hexEncrKey);
free
(
errMsg
);
free
(
encr_pr_key
);
free
(
hexEncrKey
);
}
SEKManager.h
0 → 100644
View file @
03c6d6dd
/*
Copyright (C) 2019-Present SKALE Labs
This file is part of sgxwallet.
sgxwallet is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
sgxwallet is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with sgxwallet. If not, see <https://www.gnu.org/licenses/>.
@file SEKManager.h
@author Stan Kladko
@date 2019
*/
#ifndef SGXD_SEKMANAGER_H
#define SGXD_SEKMANAGER_H
void
generate_SEK
();
#endif //SGXD_SEKMANAGER_H
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