forked from RustPython/RustPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsha256.rs
More file actions
22 lines (18 loc) · 637 Bytes
/
Copy pathsha256.rs
File metadata and controls
22 lines (18 loc) · 637 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use crate::vm::{PyRef, VirtualMachine, builtins::PyModule};
pub(crate) fn make_module(vm: &VirtualMachine) -> PyRef<PyModule> {
let _ = vm.import("_hashlib", 0);
_sha256::make_module(vm)
}
#[pymodule]
mod _sha256 {
use crate::hashlib::_hashlib::{HashArgs, local_sha224, local_sha256};
use crate::vm::{PyPayload, PyResult, VirtualMachine};
#[pyfunction]
fn sha224(args: HashArgs, vm: &VirtualMachine) -> PyResult {
Ok(local_sha224(args).into_pyobject(vm))
}
#[pyfunction]
fn sha256(args: HashArgs, vm: &VirtualMachine) -> PyResult {
Ok(local_sha256(args).into_pyobject(vm))
}
}