mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 07:37:11 +02:00
Optimize key initialization
* Do not do redundant copying of numbers.
This commit is contained in:
parent
93809ec404
commit
f813bb704f
1 changed files with 2 additions and 2 deletions
|
@ -79,8 +79,8 @@ public:
|
|||
}
|
||||
Private(base::const_byte_span nBytes, base::const_byte_span eBytes) : _rsa(RSA_new()) {
|
||||
if (_rsa) {
|
||||
BIGNUM *n = BN_dup(openssl::BigNum(nBytes).raw());
|
||||
BIGNUM *e = BN_dup(openssl::BigNum(eBytes).raw());
|
||||
BIGNUM *n = openssl::BigNum(nBytes).raw();
|
||||
BIGNUM *e = openssl::BigNum(eBytes).raw();
|
||||
RSA_set0_key(_rsa, n, e, nullptr);
|
||||
if (!n || !e) {
|
||||
RSA_free(base::take(_rsa));
|
||||
|
|
Loading…
Add table
Reference in a new issue