1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-04 02:09:26 +02:00

Format according to rustfmt

This commit is contained in:
Sasha Hilton 2018-02-26 02:50:41 +01:00
parent c3745a958a
commit 237ef1e4f9
22 changed files with 502 additions and 360 deletions

View file

@ -7,8 +7,9 @@ use std::ops::Add;
use core::audio_key::AudioKey;
const AUDIO_AESIV: &'static [u8] = &[0x72, 0xe0, 0x67, 0xfb, 0xdd, 0xcb, 0xcf, 0x77, 0xeb, 0xe8,
0xbc, 0x64, 0x3f, 0x63, 0x0d, 0x93];
const AUDIO_AESIV: &'static [u8] = &[
0x72, 0xe0, 0x67, 0xfb, 0xdd, 0xcb, 0xcf, 0x77, 0xeb, 0xe8, 0xbc, 0x64, 0x3f, 0x63, 0x0d, 0x93
];
pub struct AudioDecrypt<T: io::Read> {
cipher: Box<SynchronousStreamCipher + 'static>,
@ -44,8 +45,8 @@ impl<T: io::Read + io::Seek> io::Seek for AudioDecrypt<T> {
let skip = newpos % 16;
let iv = BigUint::from_bytes_be(AUDIO_AESIV)
.add(BigUint::from_u64(newpos / 16).unwrap())
.to_bytes_be();
.add(BigUint::from_u64(newpos / 16).unwrap())
.to_bytes_be();
self.cipher = aes::ctr(aes::KeySize::KeySize128, &self.key.0, &iv);
let buf = vec![0u8; skip as usize];