belt-ecb

Crates.iobelt-ecb
lib.rsbelt-ecb
version
sourcesrc
created_at2023-03-03 07:00:33.814085
updated_at2024-11-03 01:15:28.215042
descriptionGeneric implementation of the belt-ecb block mode of operation (STB 34.101.31-2020)
homepage
repositoryhttps://github.com/RustCrypto/block-modes
max_upload_size
id799523
Cargo.toml error:TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Artyom Pavlov (newpavlov)

documentation

https://docs.rs/belt-ecb

README

This crate is deprecated.

For implementation of the belt-ecb mode you can use the cts crate with block cipher implementation from the belt-block crate:

use cts::{Decrypt, Encrypt, KeyInit};
use hex_literal::hex;

type BeltEcb = cts::EcbCs2<belt_block::BeltBlock>;

// Test vector from STB 34.101.31-2020, table A.9
let key = hex!(
    "E9DEE72C 8F0C0FA6 2DDB49F4 6F739647"
    "06075316 ED247A37 39CBA383 03A98BF6"
);
let pt = hex!(
    "B194BAC8 0A08F53B 366D008E 584A5DE4"
    "8504FA9D 1BB6C7AC 252E72C2 02FDCE0D"
    "5BE3D612 17B96181 FE6786AD 716B890B"
);
let ct = hex!(
    "69CCA1C9 3557C9E3 D66BC3E0 FA88FA6E"
    "5F23102E F1097107 75017F73 806DA9DC"
    "46FB2ED2 CE771F26 DCB5E5D1 569F9AB0"
);

let mut buf = [0u8; 48];

BeltEcb::new(&key.into()).encrypt_b2b(&pt, &mut buf).unwrap();
assert_eq!(buf, ct);

BeltEcb::new(&key.into()).decrypt(&mut buf).unwrap();
assert_eq!(buf, pt);
Commit count: 53

cargo fmt