You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Cleanup SHA hash implementation
This commit is contained in:
@@ -5,7 +5,7 @@ pub use base;
|
||||
use cpio::cpio_commands;
|
||||
use patch::{hexpatch, patch_encryption, patch_verity};
|
||||
use payload::extract_boot_from_payload;
|
||||
use sha::{get_sha, sha_digest, SHA};
|
||||
use sha::{get_sha, sha1_hash, sha256_hash, SHA};
|
||||
|
||||
mod cpio;
|
||||
mod patch;
|
||||
@@ -24,6 +24,14 @@ pub mod ffi {
|
||||
}
|
||||
|
||||
extern "Rust" {
|
||||
type SHA;
|
||||
fn get_sha(use_sha1: bool) -> Box<SHA>;
|
||||
fn update(self: &mut SHA, data: &[u8]);
|
||||
fn finalize_into(self: &mut SHA, out: &mut [u8]);
|
||||
fn output_size(self: &SHA) -> usize;
|
||||
fn sha1_hash(data: &[u8], out: &mut [u8]);
|
||||
fn sha256_hash(data: &[u8], out: &mut [u8]);
|
||||
|
||||
fn hexpatch(file: &[u8], from: &[u8], to: &[u8]) -> bool;
|
||||
fn patch_encryption(buf: &mut [u8]) -> usize;
|
||||
fn patch_verity(buf: &mut [u8]) -> usize;
|
||||
@@ -39,12 +47,4 @@ pub mod ffi {
|
||||
|
||||
unsafe fn cpio_commands(argc: i32, argv: *const *const c_char) -> bool;
|
||||
}
|
||||
|
||||
extern "Rust" {
|
||||
type SHA;
|
||||
fn get_sha(use_sha1: bool) -> Box<SHA>;
|
||||
fn finalize(&mut self) -> Vec<u8>;
|
||||
fn update(&mut self, data: &[u8]);
|
||||
fn sha_digest(data: &[u8], use_sha1: bool) -> Vec<u8>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user