Expand description
Scram-RS (Sync and Async)
Provides a SASL SCRAM:
- SHA1
- SHA256
- SHA512
- -PLUS
Features:
-
default: “std”, “use_ring”
-
use_ring
- adds crate: ring as an alternative hashing and other crypto functions. -
exclude_sha1
- if enabled excludes the SHA1. -
std
- when set uses std lib, if removed, a no_std + alloc A program which includes this crate is based on standart library i.e std. For non-std an alloc crate is exported. Enabled by default. If CAPI was NOT excluded, and std was excluded, the crate will not be able to allocate memory in heap. For this reason, the set_allocator() should be called before using this crate in C program. -
without_async
- excludes the async code -
without_capi
- do not build CAPI code. -
xor_without_u128
- do not use the u128 type while performing XOR of arrays
For default crypto crates: scram-rs = { version = “0.13”, default-features = true}
For ring
crypto crates:
scram-rs = { version = “0.13”, default-features = false, features = [“use_ring”]}
§scram_sha256_server() sync tests (DEBUG) on AMD Ryzen 5 7600X 6-Core Processor 5453 MHz
iteration | rust-native | use_ring |
---|---|---|
1 | 30.481112ms | 7.813466ms |
§scram_sha256_works() async tests (DEBUG)
iteration | rust-native | use_ring |
---|---|---|
1 | 30.935835ms | 7.913466ms |
For usage see ./examples/ For C usage see ./tests/
Files:
- scram.rs contains client/server sync and async protocol handler
- scram_sync.rs a synchronious realization of the protocol handler
- scram_async.rs an asynchronious realization of the protocol handler
- scram_parser.rs a scram message parser
- scram_state.rs a global state of the protocol handler
- scram_hashing.rs contains all supported hashers implementation
- scram_error.rs error reporting code
- scram_common.rs a common code
- scram_cb.rs a channel bind code
- scram_auth.rs a authentification callbacks and interface
Re-exports§
pub use scram_cb::ChannelBindType;
pub use scram_common::ScramTypes;
pub use scram::*;
pub use scram_auth::*;
pub use scram_common::*;
pub use scram_hashing::*;
pub use scram_error::*;
pub use scram_cbh::*;
pub use scram_dyn::*;
Modules§
- c_api
- In order to use the C_API, the scramrs.h file should be included in the C-file.
- scram
- scram_
async - scram_
auth - scram_
cb - scram_
cbh - scram_
common - scram_
dyn - scram_
error - scram_
hashing - scram_
parser - scram_
state - scram_
sync - scram_
sync_ client - scram_
sync_ server
Macros§
- HELPER_
ERROR_ CLIENT - Use this macro in functions of trais ScramCbHelper, AsyncScramCbHelper on client side in order to indicate that the data is not possible to retrive
- HELPER_
ERROR_ SERVER - Use this macro in functions of trais ScramCbHelper, AsyncScramCbHelper on server side in order to indicate that the data is not possible to retrive
- HELPER_
UNSUP_ CLIENT - Use this macro in functions of trais ScramCbHelper, AsyncScramCbHelper on client side in order to indicate that this type of channel bind is not supported!
- HELPER_
UNSUP_ SERVER - Use this macro in functions of trais ScramCbHelper, AsyncScramCbHelper on server side in order to indicate that this type of channel bind is not supported!
- capi_
scram_ err - capi_
scram_ err_ map - capi_
scram_ err_ res - scram_
error - scram_
error_ map - scram_
ierror - scram_
ierror_ map