mirror of
https://github.com/redstrate/Miscel.git
synced 2025-05-20 12:07:46 +00:00
Rename Blowfish to SteamTicketBlowfish
Apparently cbindgen doesn't support "use" aliases so we need to name it here so it doesn't clash with the one in Physis.
This commit is contained in:
parent
d600d6eb9a
commit
b0c3d4db47
1 changed files with 4 additions and 4 deletions
|
@ -7,14 +7,14 @@ use constants::{BLOWFISH_P, BLOWFISH_S};
|
|||
const ROUNDS: usize = 16;
|
||||
|
||||
/// Implementation of the Blowfish block cipher, specialized for encrypting and decrypting Steam tickets in the launcher. This is somehow *different* than the one used with SqexArg.
|
||||
pub struct Blowfish {
|
||||
pub struct SteamTicketBlowfish {
|
||||
p: [u32; 18],
|
||||
s: [[u32; 256]; 4],
|
||||
}
|
||||
|
||||
impl Blowfish {
|
||||
impl SteamTicketBlowfish {
|
||||
/// Initializes a new Blowfish session with a key.
|
||||
pub fn new(key: &[u8]) -> Blowfish {
|
||||
pub fn new(key: &[u8]) -> Self {
|
||||
let mut s = Self {
|
||||
p: BLOWFISH_P,
|
||||
s: BLOWFISH_S,
|
||||
|
@ -98,7 +98,7 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_encrypt_decrypt() {
|
||||
let blowfish = Blowfish::new(b"00000000#un@e=x>");
|
||||
let blowfish = SteamTicketBlowfish::new(b"00000000#un@e=x>");
|
||||
|
||||
let mut data = [
|
||||
8, 187, 54, 57, 54, 52, 55, 53, 54, 56, 54, 97, 55, 53, 54, 49, 54, 52, 51, 56, 51, 57,
|
||||
|
|
Loading…
Add table
Reference in a new issue