Šepot — end-to-end encrypted messenger
Initial public release. Anonymous on-device identity (no phone number, e-mail, or password), Signal-protocol cryptography (X3DH + PQXDH, Double Ratchet, sealed sender) via libsignal, a metadata-minimizing relay, group chats, disappearing messages, encrypted local storage, optional Tor transport, and a UI localized into Czech, English, German, Russian, and Italian. Monorepo: Flutter client (app/), Rust relay + wire types (rust/), protobuf definitions (proto/), self-host deploy (deploy/). Licensed under AGPL-3.0 with an app-store distribution exception (§7).
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import 'dart:typed_data';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:sepot/core/crypto/mnemonic.dart';
|
||||
|
||||
// Obnova účtu stojí na reverzibilitě mnemonicu: 24 slov -> týž privátní
|
||||
// klíč. Plnou identitu (LocalIdentity.create/recover) nejde testovat v čistém
|
||||
// Dart VM — libsignal je native. Tady ověřujeme to podstatné bez native.
|
||||
void main() {
|
||||
test('mnemonic round-trip je stabilní (základ obnovy účtu)', () {
|
||||
final key = Uint8List.fromList(List.generate(32, (i) => (i * 7 + 3) & 0xff));
|
||||
final words = SepotMnemonic.encode(key);
|
||||
expect(words.length, 24);
|
||||
expect(SepotMnemonic.isValid(words), isTrue);
|
||||
|
||||
final decoded = SepotMnemonic.decode(words);
|
||||
// deserialize -> serialize stabilní: obnova vždy vrátí identická slova/klíč
|
||||
expect(SepotMnemonic.encode(decoded), words);
|
||||
expect(SepotMnemonic.decode(SepotMnemonic.encode(decoded)), decoded);
|
||||
});
|
||||
|
||||
test('neplatná fráze se pozná', () {
|
||||
final words = SepotMnemonic.encode(Uint8List.fromList(List.filled(32, 0x11)));
|
||||
expect(SepotMnemonic.isValid(words.sublist(0, 23)), isFalse); // málo slov
|
||||
final broken = [...words]..[0] = 'zzzzzz';
|
||||
expect(SepotMnemonic.isValid(broken), isFalse); // neznámé slovo
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user