perf: reduce verification load (#75)

- assume valid keys in the db
- verify keys on import from headers + disk
- use references in keyring when possible
This commit is contained in:
Friedel Ziegelmayer
2019-05-17 10:19:43 +02:00
committed by Lars-Magnus Skog
parent 8678813051
commit 379fc72094
7 changed files with 54 additions and 36 deletions

View File

@@ -522,6 +522,7 @@ unsafe fn set_self_key(
CStr::from_ptr(buf_base64).to_str().unwrap(),
KeyType::Private,
)
.and_then(|k| if k.verify() { Some(k) } else { None })
.and_then(|k| k.split_key().map(|pub_key| (k, pub_key)))
{
stmt = dc_sqlite3_prepare(