-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathsha3.rs
More file actions
40 lines (33 loc) · 1.15 KB
/
sha3.rs
File metadata and controls
40 lines (33 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
pub(crate) use _sha3::module_def;
#[pymodule]
mod _sha3 {
use crate::hashlib::_hashlib::{
HashArgs, local_sha3_224, local_sha3_256, local_sha3_384, local_sha3_512, local_shake_128,
local_shake_256,
};
use crate::vm::{PyPayload, PyResult, VirtualMachine};
#[pyfunction]
fn sha3_224(args: HashArgs, vm: &VirtualMachine) -> PyResult {
Ok(local_sha3_224(args, vm)?.into_pyobject(vm))
}
#[pyfunction]
fn sha3_256(args: HashArgs, vm: &VirtualMachine) -> PyResult {
Ok(local_sha3_256(args, vm)?.into_pyobject(vm))
}
#[pyfunction]
fn sha3_384(args: HashArgs, vm: &VirtualMachine) -> PyResult {
Ok(local_sha3_384(args, vm)?.into_pyobject(vm))
}
#[pyfunction]
fn sha3_512(args: HashArgs, vm: &VirtualMachine) -> PyResult {
Ok(local_sha3_512(args, vm)?.into_pyobject(vm))
}
#[pyfunction]
fn shake_128(args: HashArgs, vm: &VirtualMachine) -> PyResult {
Ok(local_shake_128(args, vm)?.into_pyobject(vm))
}
#[pyfunction]
fn shake_256(args: HashArgs, vm: &VirtualMachine) -> PyResult {
Ok(local_shake_256(args, vm)?.into_pyobject(vm))
}
}