-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nguyen Van Nguyen <[email protected]>
- Loading branch information
Showing
86 changed files
with
110 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ import 'helpers.dart'; | |
/// encoding of the binary data and a checksum. | ||
/// See https://www.rfc-editor.org/rfc/rfc9580#section-6 | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class Armor { | ||
final class Armor { | ||
static const version = 'Dart PG v2'; | ||
static const comment = 'The Dart OpenPGP library'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ import '../../type/aead.dart'; | |
|
||
/// EAX Authenticated-Encryption class | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class Eax implements AeadInterface { | ||
final class Eax implements AeadInterface { | ||
final Uint8List key; | ||
final SymmetricAlgorithm symmetric; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ import '../../type/aead.dart'; | |
|
||
/// GCM Authenticated-Encryption class | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class Gcm implements AeadInterface { | ||
final class Gcm implements AeadInterface { | ||
final Uint8List key; | ||
final SymmetricAlgorithm symmetric; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ import '../../type/aead.dart'; | |
|
||
/// OCB Authenticated-Encryption class | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class Ocb implements AeadInterface { | ||
final class Ocb implements AeadInterface { | ||
final Uint8List key; | ||
final SymmetricAlgorithm symmetric; | ||
|
||
|
@@ -81,7 +81,7 @@ class Ocb implements AeadInterface { | |
/// An implementation of RFC 7253 on The OCB Authenticated-Encryption Algorithm. | ||
/// See https://tools.ietf.org/html/rfc7253 | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class OCBCipher implements AEADCipher { | ||
final class OCBCipher implements AEADCipher { | ||
static const _blockSize = 16; | ||
|
||
final BlockCipher _hashCipher; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ import '../../common/helpers.dart'; | |
|
||
/// Implementation of DSA (digital signature algorithm) | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class DSASigner implements Signer { | ||
final class DSASigner implements Signer { | ||
final Digest? _digest; | ||
|
||
late DSAAsymmetricKey? _key; | ||
|
@@ -150,7 +150,7 @@ class DSASigner implements Signer { | |
} | ||
} | ||
|
||
class DSASignature implements Signature { | ||
final class DSASignature implements Signature { | ||
final BigInt r; | ||
final BigInt s; | ||
|
||
|
@@ -191,14 +191,14 @@ abstract class DSAAsymmetricKey implements AsymmetricKey { | |
DSAAsymmetricKey(this.prime, this.order, this.generator); | ||
} | ||
|
||
class DSAPublicKey extends DSAAsymmetricKey implements PublicKey { | ||
final class DSAPublicKey extends DSAAsymmetricKey implements PublicKey { | ||
/// public exponent y = g ** x mod p | ||
final BigInt y; | ||
|
||
DSAPublicKey(this.y, super.prime, super.order, super.generator); | ||
} | ||
|
||
class DSAPrivateKey extends DSAAsymmetricKey implements PrivateKey { | ||
final class DSAPrivateKey extends DSAAsymmetricKey implements PrivateKey { | ||
/// secret exponent | ||
final BigInt x; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ import '../../common/helpers.dart'; | |
|
||
/// Asymmetric block cipher using basic ElGamal algorithm. | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class ElGamalEngine implements AsymmetricBlockCipher { | ||
final class ElGamalEngine implements AsymmetricBlockCipher { | ||
late ElGamalAsymmetricKey? _key; | ||
|
||
late SecureRandom _random; | ||
|
@@ -149,14 +149,15 @@ abstract class ElGamalAsymmetricKey implements AsymmetricKey { | |
ElGamalAsymmetricKey(this.prime, this.generator); | ||
} | ||
|
||
class ElGamalPublicKey extends ElGamalAsymmetricKey implements PublicKey { | ||
final class ElGamalPublicKey extends ElGamalAsymmetricKey implements PublicKey { | ||
/// public exponent y = g ** x mod p | ||
final BigInt y; | ||
|
||
ElGamalPublicKey(this.y, super.prime, super.generator); | ||
} | ||
|
||
class ElGamalPrivateKey extends ElGamalAsymmetricKey implements PrivateKey { | ||
final class ElGamalPrivateKey extends ElGamalAsymmetricKey | ||
implements PrivateKey { | ||
/// secret exponent | ||
final BigInt x; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ import 'base_engine.dart'; | |
/// All the algorithms herein are from Applied Cryptography | ||
/// and implement a simplified cryptography interface. | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class BlowfishEngine extends BaseEngine { | ||
final class BlowfishEngine extends BaseEngine { | ||
static const _kp = [ | ||
0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, // 0 - 3 | ||
0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ import 'package:pointycastle/api.dart'; | |
|
||
/// Buffered cipher. | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class BufferedCipher { | ||
final class BufferedCipher { | ||
final BlockCipher _underlyingCipher; | ||
|
||
final Uint8List _buffer; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ import '../../common/extensions.dart'; | |
|
||
/// Camellia - based on RFC 3713. | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class CamelliaEngine extends BaseEngine { | ||
final class CamelliaEngine extends BaseEngine { | ||
static const _blockSize = 16; | ||
|
||
static const _mask8 = 0xff; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ import '../../common/extensions.dart'; | |
/// | ||
/// and implement a simplified cryptography interface. | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class CAST5Engine extends BaseEngine { | ||
final class CAST5Engine extends BaseEngine { | ||
static const _sBox1 = [ | ||
0x30fb40d4, 0x9fa0ff0b, 0x6beccd2f, 0x3f258c7a, 0x1e213f2f, 0x9c004dd3, | ||
0x6003e540, 0xcf9fc949, // 0 - 7 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ import '../../common/extensions.dart'; | |
|
||
/// A class that provides a basic International Data Encryption Algorithm (IDEA) engine. | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class IDEAEngine extends BaseEngine { | ||
final class IDEAEngine extends BaseEngine { | ||
static const _mask = 0xffff; | ||
static const _base = 0x10001; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ import '../../common/extensions.dart'; | |
|
||
/// A class that provides Twofish encryption operations. | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class TwofishEngine extends BaseEngine { | ||
final class TwofishEngine extends BaseEngine { | ||
/// Q-Table 0 | ||
static const _q0 = [ | ||
0xa9, 0x67, 0xb3, 0xe8, 0x04, 0xfd, 0xa3, 0x76, // 0 - 7 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,8 @@ import '../type/private_key.dart'; | |
import '../type/secret_key_packet.dart'; | ||
import 'base_key.dart'; | ||
|
||
/// OpenPGP private key class | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
final class PrivateKey extends BaseKey implements PrivateKeyInterface { | ||
PrivateKey(super.packetList); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ import '../type/verification.dart'; | |
|
||
/// Verification class | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class Verification implements VerificationInterface { | ||
final class Verification implements VerificationInterface { | ||
@override | ||
final Uint8List keyID; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ import 'base_packet.dart'; | |
/// Implementation of the Symmetrically Encrypted Authenticated Encryption with | ||
/// Additional Data (AEAD) Protected Data Packet - Type 20 | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class AeadEncryptedDataPacket extends BasePacket | ||
final class AeadEncryptedDataPacket extends BasePacket | ||
implements EncryptedDataPacketInterface { | ||
static const version = 1; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ import 'base_packet.dart'; | |
|
||
/// Implementation of the Compressed Data (COMP) Packet - Type 11 | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class CompressedDataPacket extends BasePacket { | ||
final class CompressedDataPacket extends BasePacket { | ||
/// Default zip/zlib compression level, between 1 and 9 | ||
static const deflateLevel = 6; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ import 'user_attribute_subpacket.dart'; | |
|
||
/// Implementation of the Image User Attribute Subpacket | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class ImageUserAttribute extends UserAttributeSubpacket { | ||
final class ImageUserAttribute extends UserAttributeSubpacket { | ||
static const jpeg = 1; | ||
|
||
ImageUserAttribute( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ import 'key_wrapper.dart'; | |
|
||
/// An implementation of the AES Key Wrapper from the NIST Key Wrap Specification. | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class AesKeyWrapper extends KeyWrapper { | ||
final class AesKeyWrapper extends KeyWrapper { | ||
AesKeyWrapper(final int keySize) | ||
: super( | ||
BlockCipher('AES/ECB'), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ import 'key_wrapper.dart'; | |
|
||
/// An implementation of the Camellia key wrapper based on RFC 3657/RFC 3394. | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class CamelliaKeyWrapper extends KeyWrapper { | ||
final class CamelliaKeyWrapper extends KeyWrapper { | ||
CamelliaKeyWrapper(final int keySize) | ||
: super( | ||
ECBBlockCipher(CamelliaEngine()), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ import '../../type/verification_key_material.dart'; | |
|
||
/// DSA public key material | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class DSAPublicMaterial implements VerificationKeyMaterial { | ||
final class DSAPublicMaterial implements VerificationKeyMaterial { | ||
/// DSA prime p | ||
final BigInt prime; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ import 'dsa_public_material.dart'; | |
|
||
/// DSA secret key material | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class DSASecretMaterial implements SigningKeyMaterialInterface { | ||
final class DSASecretMaterial implements SigningKeyMaterialInterface { | ||
/// DSA secret exponent x | ||
final BigInt exponent; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ import 'ec_public_material.dart'; | |
|
||
/// ECDH public key material | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class ECDHPublicMaterial extends ECPublicMaterial { | ||
final class ECDHPublicMaterial extends ECPublicMaterial { | ||
final int reserved; | ||
|
||
/// Hash algorithm used with the KDF | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ import 'ecdh_public_material.dart'; | |
|
||
/// ECDH secret key material | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class ECDHSecretMaterial extends ECSecretMaterial | ||
final class ECDHSecretMaterial extends ECSecretMaterial | ||
implements SecretKeyMaterialInterface { | ||
@override | ||
final ECDHPublicMaterial publicMaterial; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ import 'session_key_cryptor.dart'; | |
|
||
/// ECDH session key cryptor class | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class ECDHSessionKeyCryptor extends SessionKeyCryptor { | ||
final class ECDHSessionKeyCryptor extends SessionKeyCryptor { | ||
/// 20 octets representing the UTF-8 encoding of the string 'Anonymous Sender ' | ||
static const _anonymousSender = [ | ||
0x41, 0x6e, 0x6f, 0x6e, // 0 - 3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ import '../../type/verification_key_material.dart'; | |
|
||
/// ECDSA public key material | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class ECDSAPublicMaterial extends ECPublicMaterial | ||
final class ECDSAPublicMaterial extends ECPublicMaterial | ||
implements VerificationKeyMaterial { | ||
ECDSAPublicMaterial(super.oid, super.q); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ import 'ecdsa_public_material.dart'; | |
|
||
/// ECDSA secret key material | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class ECDSASecretMaterial extends ECSecretMaterial | ||
final class ECDSASecretMaterial extends ECSecretMaterial | ||
implements SigningKeyMaterialInterface { | ||
@override | ||
final ECDSAPublicMaterial publicMaterial; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ import 'ec_public_material.dart'; | |
|
||
/// EdDSA legacy public key material | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class EdDSALegacyPublicMaterial extends ECPublicMaterial | ||
final class EdDSALegacyPublicMaterial extends ECPublicMaterial | ||
implements VerificationKeyMaterial { | ||
EdDSALegacyPublicMaterial(super.oid, super.q); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ import 'eddsa_legacy_public_material.dart'; | |
|
||
/// EdDSA legacy secret key material | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class EdDSALegacySecretMaterial implements SigningKeyMaterialInterface { | ||
final class EdDSALegacySecretMaterial implements SigningKeyMaterialInterface { | ||
/// Ed's seed parameter | ||
final BigInt seed; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ import '../../type/verification_key_material.dart'; | |
|
||
/// EdDSA public key material | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class EdDSAPublicMaterial implements VerificationKeyMaterial { | ||
final class EdDSAPublicMaterial implements VerificationKeyMaterial { | ||
final Uint8List publicKey; | ||
|
||
final EdDSACurve curve; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ import 'eddsa_public_material.dart'; | |
|
||
/// EdDSA secret key material | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class EdDSASecretMaterial implements SigningKeyMaterialInterface { | ||
final class EdDSASecretMaterial implements SigningKeyMaterialInterface { | ||
final Uint8List secretKey; | ||
|
||
@override | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ import '../../type/key_material.dart'; | |
|
||
/// ElGamal public key material | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class ElGamalPublicMaterial implements KeyMaterialInterface { | ||
final class ElGamalPublicMaterial implements KeyMaterialInterface { | ||
/// Elgamal prime p | ||
final BigInt prime; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,9 @@ import '../../cryptor/asymmetric/elgamal.dart'; | |
import '../../type/secret_key_material.dart'; | ||
import 'elgamal_public_material.dart'; | ||
|
||
class ElGamalSecretMaterial implements SecretKeyMaterialInterface { | ||
/// ElGamal secret key material | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
final class ElGamalSecretMaterial implements SecretKeyMaterialInterface { | ||
/// Elgamal secret exponent x. | ||
final BigInt exponent; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ import 'session_key_cryptor.dart'; | |
|
||
/// ElGamal session key cryptor class | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class ElGamalSessionKeyCryptor extends SessionKeyCryptor { | ||
final class ElGamalSessionKeyCryptor extends SessionKeyCryptor { | ||
/// MPI of ElGamal (Diffie-Hellman) value g**k mod p. | ||
final BigInt gamma; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ import '../../enum/montgomery_curve.dart'; | |
|
||
/// Montgomery public key material | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class MontgomeryPublicMaterial implements KeyMaterialInterface { | ||
final class MontgomeryPublicMaterial implements KeyMaterialInterface { | ||
final Uint8List publicKey; | ||
|
||
final MontgomeryCurve curve; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ import 'montgomery_public_material.dart'; | |
|
||
/// Montgomery secret key material | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
class MontgomerySecretMaterial implements SecretKeyMaterialInterface { | ||
final class MontgomerySecretMaterial implements SecretKeyMaterialInterface { | ||
final Uint8List secretKey; | ||
|
||
@override | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,9 @@ import 'montgomery_public_material.dart'; | |
import 'montgomery_secret_material.dart'; | ||
import 'session_key_cryptor.dart'; | ||
|
||
class MontgomerySessionKeyCryptor extends SessionKeyCryptor { | ||
/// Montgomery session key cryptor | ||
/// Author Nguyen Van Nguyen <[email protected]> | ||
final class MontgomerySessionKeyCryptor extends SessionKeyCryptor { | ||
/// The ephemeral key used to establish the shared secret | ||
final Uint8List ephemeralKey; | ||
|
||
|
Oops, something went wrong.