ISAL::Crypto - Perl interface for Intel(R) Intelligent Storage Acceleration Library Crypto Version - collection of optimized low-level functions targeting storage applications.
use ISAL::Crypto qw(:all); my $feature = "avx512"; my $init = "init_$feature"; my $mgr = ISAL::Crypto::Mgr::SHA256->$init(); my $ctx1 = ISAL::Crypto::Ctx::SHA256->init(); my $ctx2 = ISAL::Crypto::Ctx::SHA256->init(); my $submit = "submit_$feature"; $mgr->$submit($ctx1, $str1, ENTIRE); $mgr->$submit($ctx2, $str2, FIRST); $mgr->$submit($ctx2, $str3, UPDATE); $mgr->$submit($ctx2, $str4, UPDATE); $mgr->$submit($ctx2, $str5, LAST); my $flush = "flush_$feature"; while ($mgr->$flush()){}; my $result_digest1 = $ctx1->get_digest(); my $result_digest2 = $ctx2->get_digest();
ISAL::Crypto - allows to run multiple hash calculations at the same time on one cpu using vector registers for much better throuput than usual single registers calculations.
Return hash reference with format {"HAS_$FEATURE_NAME_UPPERCASE" => 1,}. For example: { HAS_SSE => 1, HAS_AVX => 1, HAS_AVX2 => 0, HAS_AVX512 => 0, HAS_AVX512F => 0, HAS_AVX512VL => 0, HAS_AVX512BW => 0, HAS_AVX512CD => 0, HAS_AVX512DQ => 0, }
{"HAS_$FEATURE_NAME_UPPERCASE" => 1,}
{ HAS_SSE => 1, HAS_AVX => 1, HAS_AVX2 => 0, HAS_AVX512 => 0, HAS_AVX512F => 0, HAS_AVX512VL => 0, HAS_AVX512BW => 0, HAS_AVX512CD => 0, HAS_AVX512DQ => 0, }
Return list of available CPU features names in lowercase: ("sse", "avx").
Init mgr taking in account CPU features. Return "ISAL::Crypto::Mgr::$ALGO" reference.
"ISAL::Crypto::Mgr::$ALGO"
Submit $ctx taking in account CPU features with $str and mask with values: (0: UPDATE), (1: FIRST), (2: LAST), (3: ENTIRE).
$ctx
$str
Return $ctx with the stampted error status if it is imposible to submit it now or if there were maximum submited contexts and manager flush them all. You can unsubmited job with undef $ctx - and it will be cleared from manager.
undef $ctx
$str MUST TO BE IN SAFE until $mgr->flush_* will be called. If $str has been freed then $mgr->flush_* (or later call of $mgr->submit_* with fully filled slots for contexts) behaviour IS UNDEFINED. It can lead to segmentation fault or incorrect digest value results.
$mgr->flush_*
$mgr->submit_*
Flush all submited context jobs taking in account CPU features. When the first job is finished its $ctx will be returned.
Return the number of used manager's lanes.
Init ctx and return "ISAL::Crypto::Ctx::$ALGO" reference.
"ISAL::Crypto::Ctx::$ALGO"
Returns the digest encoded as a binary string.
Returns the digest encoded as a hexadecimal string.
Returns the number value of context status. Values: (0: CTX_STS_IDLE), (1: CTX_STS_PROCESSING), (2: CTX_STS_LAST), (4: CTX_STS_COMPLETE).
Returns the number value of context error. Values: (0: CTX_ERROR_NONE), (-1: CTX_ERROR_INVALID_FLAGS), (-2: CTX_ERROR_ALREADY_PROCESSING), (-3: CTX_ERROR_ALREADY_COMPLETED).
Nothing is exported by default.
To start benchmark run make bench in console.
make bench
Sergey Kaplun, <burii@cpan.org<gt>,
Mons Anderson - The rationale and motivation
Please report any bugs or feature requests in https://github.com/Buristan/ISAL-Crypto/issues
Copyright (C) 2019 by Sergey Kaplun
This program is released under the following license: BSD 3-Clause
To install ISAL::Crypto, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ISAL::Crypto
CPAN shell
perl -MCPAN -e shell install ISAL::Crypto
For more information on module installation, please visit the detailed CPAN module installation guide.