feat: Move all constants into their own file
This commit is contained in:
parent
4baf8187e1
commit
3829c6c11b
11
lib/src/common/constants.dart
Normal file
11
lib/src/common/constants.dart
Normal file
@ -0,0 +1,11 @@
|
||||
/// The overarching assumption is that we use Ed25519 keys for the identity keys
|
||||
const omemoX3DHInfoString = 'OMEMO X3DH';
|
||||
|
||||
/// The info used for when encrypting the AES key for the actual payload.
|
||||
const omemoPayloadInfoString = 'OMEMO Payload';
|
||||
|
||||
/// Info string for ENCRYPT
|
||||
const encryptHkdfInfoString = 'OMEMO Message Key Material';
|
||||
|
||||
/// Amount of messages we may skip per session
|
||||
const maxSkip = 1000;
|
@ -1,6 +1,7 @@
|
||||
import 'package:cryptography/cryptography.dart';
|
||||
import 'package:hex/hex.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:omemo_dart/src/common/constants.dart';
|
||||
import 'package:omemo_dart/src/common/result.dart';
|
||||
import 'package:omemo_dart/src/crypto.dart';
|
||||
import 'package:omemo_dart/src/double_ratchet/kdf.dart';
|
||||
@ -9,12 +10,6 @@ import 'package:omemo_dart/src/helpers.dart';
|
||||
import 'package:omemo_dart/src/keys.dart';
|
||||
import 'package:omemo_dart/src/protobuf/schema.pb.dart';
|
||||
|
||||
/// Amount of messages we may skip per session
|
||||
const maxSkip = 1000;
|
||||
|
||||
/// Info string for ENCRYPT
|
||||
const encryptHkdfInfoString = 'OMEMO Message Key Material';
|
||||
|
||||
@immutable
|
||||
class SkippedKey {
|
||||
const SkippedKey(this.dh, this.n);
|
||||
|
@ -1,2 +0,0 @@
|
||||
/// The info used for when encrypting the AES key for the actual payload.
|
||||
const omemoPayloadInfoString = 'OMEMO Payload';
|
@ -4,6 +4,7 @@ import 'package:collection/collection.dart';
|
||||
import 'package:cryptography/cryptography.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
import 'package:omemo_dart/src/common/constants.dart';
|
||||
import 'package:omemo_dart/src/common/result.dart';
|
||||
import 'package:omemo_dart/src/crypto.dart';
|
||||
import 'package:omemo_dart/src/double_ratchet/double_ratchet.dart';
|
||||
@ -11,7 +12,6 @@ import 'package:omemo_dart/src/errors.dart';
|
||||
import 'package:omemo_dart/src/helpers.dart';
|
||||
import 'package:omemo_dart/src/keys.dart';
|
||||
import 'package:omemo_dart/src/omemo/bundle.dart';
|
||||
import 'package:omemo_dart/src/omemo/constants.dart';
|
||||
import 'package:omemo_dart/src/omemo/decryption_result.dart';
|
||||
import 'package:omemo_dart/src/omemo/device.dart';
|
||||
import 'package:omemo_dart/src/omemo/encrypted_key.dart';
|
||||
|
@ -1,6 +1,7 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:math';
|
||||
import 'package:cryptography/cryptography.dart';
|
||||
import 'package:omemo_dart/src/common/constants.dart';
|
||||
import 'package:omemo_dart/src/common/result.dart';
|
||||
import 'package:omemo_dart/src/crypto.dart';
|
||||
import 'package:omemo_dart/src/errors.dart';
|
||||
@ -8,9 +9,6 @@ import 'package:omemo_dart/src/helpers.dart';
|
||||
import 'package:omemo_dart/src/keys.dart';
|
||||
import 'package:omemo_dart/src/omemo/bundle.dart';
|
||||
|
||||
/// The overarching assumption is that we use Ed25519 keys for the identity keys
|
||||
const omemoX3DHInfoString = 'OMEMO X3DH';
|
||||
|
||||
/// Performed by Alice
|
||||
class X3DHAliceResult {
|
||||
const X3DHAliceResult(this.ek, this.sk, this.opkId, this.ad);
|
||||
|
Loading…
Reference in New Issue
Block a user