Merge branch 'master' of https://git.efi.th-nuernberg.de/gitea/hopfma/appsec
This commit is contained in:
commit
e943e4cbb5
@ -18,7 +18,17 @@ fn main() {
|
|||||||
0xbd, 0xdd, 0x15, 0xc3, 0xb5, 0x96, 0x41, 0x17, 0x4e, 0xc9, 0x67, 0x8a, 0x53, 0x78,
|
0xbd, 0xdd, 0x15, 0xc3, 0xb5, 0x96, 0x41, 0x17, 0x4e, 0xc9, 0x67, 0x8a, 0x53, 0x78,
|
||||||
0x9d, 0x92, 0xc7, 0x54,
|
0x9d, 0x92, 0xc7, 0x54,
|
||||||
]);
|
]);
|
||||||
let (salsa_box, pub_key) = generate_box(bob_init_pub_key.clone());
|
|
||||||
|
// Generate a random secret key.
|
||||||
|
// NOTE: The secret key bytes can be accessed by calling `secret_key.as_bytes()`
|
||||||
|
let own_secret_key = SecretKey::generate(&mut OsRng);
|
||||||
|
|
||||||
|
// Get the public key for the secret key we just generated
|
||||||
|
let own_public_key = own_secret_key.public_key().clone();
|
||||||
|
|
||||||
|
// Create a `SalsaBox` by performing Diffie-Hellman key agreement between
|
||||||
|
// the two keys.
|
||||||
|
let salsa_box = SalsaBox::new(&bob_init_pub_key, &own_secret_key);
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let mut buffer = String::new();
|
let mut buffer = String::new();
|
||||||
|
2
src/bin/constants.rs
Normal file
2
src/bin/constants.rs
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
pub const KEYBYTE: u8 = 0b1;
|
||||||
|
pub const MSGBYTE: u8 = 0b01;
|
Loading…
x
Reference in New Issue
Block a user