Files
boc/aamos-ledger-rust/target/debug/deps/librand_chacha-181890ec389f91c4.rmeta
T

207 lines
95 KiB
Plaintext
Raw Normal View History

rust
y#rustc 1.96.0 (ac68faa20 2026-05-25)ÁÀ뉊]!ÜÛê(¹Þ—šên-5be7b69c3ff7b5b8ÁíàÄTËŸ ÜJîÄ)'ß\¥!-3d1337db07d0b3aeÁ¤²XctÔ'ÐÓ©z¨ɽÓ-a4945860e1c53b00Á¤°ð ¾ä-±($²ï=©Ã-7e98a21bfd32b0edÁòÖÀH•‘PIÓHã#£-055f30b747f859b6Árustc_std_workspace_coreÁ­Cçß^ò½èÝ$­Çÿ+Cé-c4878ee60b2242c9ÁŸÃï+Ñ]ŠqB<ÏïW#-8dd1dd90e70d0b6aÁ miniz_oxideÁ€š»J(P>àö÷g\K-1eb618da2918ab7fÁadler2ÁÆ;+Þ®5¥Ìýݰ¦ÛLˆ-f7919172d268e069Á hashbrownÁPäV9ÒÆèÜ"ÊÖVŽ\-0fc2184a5da6723aÁrustc_std_workspace_allocÁs&ØòØy¯s•bæ!‰ýŠ-97e4bf30be240674Á
std_detectÁhŠBîÙºÌI®ËÅš-9dbbf8346ba7ac8bÁrustc_demangleÁûë9´Ç×@Œ’ùXFº-f33013f239bf9f14Ácfg_ifÁÜLhž§Œaã¯>­-0a71c8f33a838301Á addr2lineÁ׎Þ!]8V$É@@-e618e6be60e87ba2ÁgimliÁ¸
°µ~Î1‹Ñt ðÁ€w-1f7768a68858f670ÁobjectÁ
áPÃ?­À¶¼QHJ¥-914cd6a4dbe590d1ÁmemchrÁ›º«8Ór­2Ù $¨ûib-cf21ca6f2bb15dcdÁë
‹ás«LÖ€îâƒ×ɯŒ-ee6f3747e38367f0Á rand_coreÁÌý¦î—W‹œ]TewÉ:-802030763b7da6caÁ getrandomÁ’ú§‰, iMjã¸íçG‡-3af6da94d21ddbadÁ®f©¾/ô)c§{õa“â‘-a3906971a93fd1b8Áæ\‹±ÔcdùÀTƒ-f86f80b348d33b13Á
ppv_lite86Á<<rîd”Û Jøƒ¨x7qï-b7bc7268307ccbaaÁzerocopyÁ{£F™8ù£´ÉÒ6ñ°i-37880aa70dfe9a6cÁ DeserializeÁ\λserdeÁŒ® DeserializerÁdÛ»ö "$ SerializeÁLé»ö ?A
SerializerÁTô»ö ]_$¯h$¤h%add_posÁ<”íbigÁ¬ù%d0123Á,¹í ¬žß XZ»ö ˆãY¥
HœZ»ö Ãß XZ»ö ˆãYÃ¥
HœZ»ö ß XZ»ö ˆãY¥
HœZ»ö ÀchachaÁ 
BUF_BLOCKSÁ BLOCK_WORDSÁArray64Á
¥ˆ ¥¥É¥as_mutÁ¥ƒ!¥!× chacha_implÁgutsÁ%%%%%%%%%% %
% % %
%BLOCKÁ%BLOCK64Á%LOG2_BUFBLOCKSÁ% BUFBLOCKSÁ%BUFSZ64Á%BUFSZÁ%STREAM_PARAM_NONCEÁ%STREAM_PARAM_BLOCKÁ%roundÁ<§% diagonalizeÁ>§%
undiagonalizeÁ@§%Bæ C Brefill4ÁE B
set_block_posÁB
get_block_posÁB set_nonceÁB get_nonceÁBget_seedÁK %ó
MMachÁ% OÎ%refill_wide_implÁQÎQ %
read_u32leÁ ChaChaRngÁ
ChaChaCoreÁ>_×aaResultsÁagenerateÁeSeedÁf e from_seedÁh  kl k£
onext_u32Áonext_u64Áo
fill_bytesÁ s get_word_posÁs set_word_posÁs
set_streamÁs
get_streamÁs´x  
{÷}
abstract20Á÷ƒ÷ ChaCha20CoreÁºˆƒÖ ChaCha20RngÁrngÁƒ×ìseedÁ streamÁword_posÁš×ŸÖ  ¢×¤¤ó¤¨© ¨£« ®¯ ®£²Õ²ä²óˆ®¿´» ¾÷À 
abstract12ÁÃÄ÷ÃÆ÷Ç ChaCha12CoreÁɺ!˃"#Î$ÐÖ ChaCha12RngÁÒÿ%Ôƒ&Ö×ÃÌØªÙ Ø»ØÉÃÝ×ÃÃàÃâÖã 'å×(ççóç)ëì ë£î *+ñò ñ£,õÕõäõó-ùˆùù®ù¿ù´þ ./÷0ƒ1 abstract8Á÷÷Š ChaCha8CoreÁŒº2Žƒ345Ö
ChaCha8RngÁÿ6ƒ7תœ »É ×£¥Ö¦ %ChaChaÁ¨­¨®¨¯%¬ƒ%%¯%±Ö%StateÁ³§³¬³­³®³¯%¹§¹ƒ% refill_wideÁ¼ ¼fn_implÁ¾Î¾ %refill_narrow_roundsÁÁÉÂÎ%set_stream_paramÁÄÉÅÎ%get_stream_paramÁÇÉÈÎ%´Ê ÊÉÌÎÌ Ì % init_chachaÁÐ ÐÉÒÎÒ %
init_chacha_xÁÕ Õ ÕÉØÎØ Ø 


#
#
#
C
C
E
E
G
H
I
J
K
Q
Q
T
`
`
`
d
d
p
q
r
r
t
u
v
w
x
~
~


ƒ


Œ
Œ
Ž







ž
ž
 
£
£
£
§
§
³
´
µ
µ
·
¸
¹
º
»
Á
Á
Ä
Å
Æ
Ç
Ì
Ï
Ï
Ñ
Õ
×
×
×
Þ
Þ
Þ
á
á
ã
æ
æ
æ
ê
ê
ö
÷
ø
ø
ú
û
ü
ý
þ



ˆ

Š




˜
š
š
š
¡
¡
¡
¤
¤
¦
­
°
°
²
»
¼
¼
¾
¾
Á
Â
Ä
Å
Ç
È
Ê
Ì
Ð
Ð
Ò
Ò
Õ
Õ
Ø
Ø
³§
ˆ {<)º6`Ì¥à›(
È(ã›(Ø(Ø›(¿c›(Ø©ºàOJµ,ñ£Ðì„)µß„)„)„)¿c„)„)¬„)„)ØìÿÊŠÁ^¥é¾µ¿c*¬*|**é*„)µß***¿c쪘»É§›n—4òQQÐì+µß+++é+ 8*é* 8+ØÉÉʺ!Í%)<¤ŽXÐì—,µß—,—,—,¿c—,—,¬—,—,ØÒÒÌÓÿ†m¯G{›Ò¿c”-¬”-|”-”-é”-—,µß”-”-”-¿cØØÌÙªÃÛ»ÃÜÉÃùÀïÛg¹Ðì”.µß”.”.”.é”. 8”-é”- 8”.ØŒŒÓº’I u¹÷¡šÐìª/µßª/ª/ª/¿cª/ª/¬ª/ª/ØÿZÕ9Q(: ¥¿c§0¬§0|§0§0é§0ª/µß§0§0§0¿cœªž»ŸÉï)y3ëG¤Ðì§1µß§1§1§1é§1 8§0é§0 8§1ب¨œ©­ª®«¯©¥9Ø¢!çÐì½2µß½2½2½2س³éµ¬­·®¸¯Ð<2ó N«¨§ˆËÉÔÒŽŒ¬¨¹³!_š¢ÉÖÒÝØåŒ ŠœÍÉߨŒ¢®¨}ÎÉÀÒàØŒƒ£¯¨ŸÐÉÂÒâØŒ¥±¨a¤ÉçŒek¨É®ÒëŒñj­ÉðŒo²Òõz½Ò{ƒ¾ÒÄØÆÒ³àãØ ¿c
=ÐìCµß
1
EE¬(|é Ê816Á@64Á ì832Áì8 ì832Á ì832Á ì832Á ì832Á ì832Áì8 ì832Á ì832Á ì832Á ì832Á ì832Áì8 ì832Á ì832Á ì832Á ì832Áì816Á4ì8ü©-5<Ã$94ì8<œt6<@<,  <@6<Y+<i6<üö+7<¤*¤6<®6<¸6<œÂ5<7<' *5<(7<N<ü¢48<¼<.5<ƒ7<š5<7<„÷8<ì8ü×19ì8$98<ÿ@ ì832Á,
9ì8F$ì8/6:9ì8BUFSZÁ ì832Á,Æ%
9ì8S$ì8/6:9ì8BUFSZÁ,ó.
9ì8½%ì807;9ì8BUFSZÁYa9ì8nÀ|ì8Ž9ì8BUFSZÁ ì832Á ì832Á ì832Á ì832Á ì832Á ì832Áì824Á ì832Áì824Á¬ò È(&(1È(ì8@FM%\]ÀÄL€ÉVÌÒW©XìYÓŒZ[üä½üä(% The ChaCha random number generators.Áúü‘B? These are native Rust implementations of RNGs derived from theÁüÔ-* [ChaCha stream ciphers] by D J Bernstein.ÁúŒ† ## GeneratorsÁ˜úüœPM This crate provides 8-, 12- and 20-round variants of generators via a "core"ÁüíLI implementation (of [`BlockRngCore`]), each with an associated "RNG" typeÁüº (implementing [`RngCore`]).ÁÚúüÞNK These generators are all deterministic and portable (see [Reproducibility]Áü­96 in the book), with testing against reference vectors.Áçúüë# ## Cryptographic (secure) usageÁúü“NK Where secure unpredictable generators are required, it is suggested to useÁüâ63 [`ChaCha12Rng`] or [`ChaCha20Rng`] and to seed viaÁü™! [`SeedableRng::from_os_rng`].Á»úü¿KH See also the [Security] chapter in the rand book. The crate is providedÁü‹ IF "as is", without any form of guarantee, and without a security audit.ÁÕ úìÙ  ## Seeding (construction)Á÷ úüû KH Generators implement the [`SeedableRng`] trait. Any method may be used,ÁüÇ
MJ but note that `seed_from_u64` is not suitable for usage where security isÁü•  important. Some suggestions:Á úüº FC 1. With a fresh seed, **direct from the OS** (implies a syscall):Á\  ```Áü A> # use {rand_core::SeedableRng, rand_chacha::ChaCha12Rng};ÁüÏ -* let rng = ChaCha12Rng::from_os_rng();Áüý # # let _: ChaCha12Rng = rng;Á
óQü­
@= 2. **From a master generator.** This could be [`rand::rng`]Áüî
OL (effectively a fresh seed without the need for a syscall on each usage)Áü¾=: or a deterministic generator such as [`ChaCha20Rng`].ÁüüOL Beware that should a weak master generator be used, correlations may beÁüÌ?< detectable between the outputs of its child generators.ÁŒŒ ```ignoreÁüž:7 let rng = ChaCha12Rng::from_rng(&mut rand::rng());ÁóQåúüé(% See also [Seeding RNGs] in the book.ÁúŒ– ## GenerationÁ¨úü¬KH Generators implement [`RngCore`], whose methods may be used directly toÁüø.+ generate unbounded integer or byte values.Á ```Áü¯*' use rand_core::{SeedableRng, RngCore};ÁüÚ! use rand_chacha::ChaCha12Rng;Áüúü€=: let mut rng = ChaCha12Rng::from_seed(Default::default());Áܾ let x = rng.next_u64();ÁüÚ&# assert_eq!(x, 0x53f955076a9af49b);Á<µYúüNK It is often more convenient to use the [`rand::Rng`] trait, which providesÁüÜLI further functionality. See also the [Random Values] chapter in the book.Á©úü­96 [ChaCha stream ciphers]: https://cr.yp.to/chacha.htmlÁüçKH [Reproducibility]: https://rust-random.github.io/book/crate-reprod.htmlÁü³IF [Seeding RNGs]: https://rust-random.github.io/book/guide-seeding.htmlÁüýKH [Security]: https://rust-random.github.io/book/guide-rngs.html#securityÁüÉIF [Random Values]: https://rust-random.github.io/book/guide-values.htmlÁü“41 [`BlockRngCore`]: rand_core::block::BlockRngCoreÁüÈ# [`RngCore`]: rand_core::RngCoreÁüì+( [`SeedableRng`]: rand_core::SeedableRngÁü˜EB [`SeedableRng::from_os_rng`]: rand_core::SeedableRng::from_os_rngÁüÞ?< [`rand::rng`]: https://docs.rs/rand/latest/rand/fn.rng.htmlÁüžB? [`rand::Rng`]: https://docs.rs/rand/latest/rand/trait.Rng.htmlÁ%https://www.rust-lang.org/favicon.icoÁ„¿9https://www.rust-lang.org/logos/rust-logo-128x128-blk.pngÁlî#https://rust-random.github.io/rand/Álÿ¼ %\]ÀªÄ«ªÉVÌ©ÒW©¨Xì§YÓ¦ŒZ¥['*- #4ÉҌܨװ `BlockRngÁDÌÅ BlockRngCoreÁdÖ CryptoBlockRngÁtä
CryptoRngÁL… RngCoreÁ<|
SeedableRngÁ\™¬œ‘ÓLªÆ„¹±³˜z|LùgiQS8:¤ÛÊ8¬ÀÊ8Þ¥ÍìÈ( ({<)º6`ÌF(1Q–F(
È(`b<ˆ–FŒì8ü’4¥ài ³È((^´^!üû!¥ài ›(âÄ£Ü Ü›( ÜØ( ­
È(üÖ!¥ài Û›(åüþ 4Ý Ý›( ÝØ( ˆ
È($ü½9¥ài Š È(¡k<î( Ù &(¼ý,€Þ Þ›(›( 
È($‡üú!¥""ài ÿ(#Àc#ü¢4¥ßàá ß›( à c cˆ¢cµ
 `£cbufÁ `àB¤GS
áÖ¿Ù¿Ú¿«Û¿ˆÜ¿Ý¿Þ¿ˆ‚†f|Â
ŸÈŸÈ ÈErrorÁ O˜éBL! ©!
#È(± °Ä„\‘  åe £ ð, ¤8 ChaChaXCoreÁ& °8¼$ , ¸8
ChaChaXRngÁ& Ã8¼$ É, Ë8roundsÁ& Ò8$ ×, Ù8ÓÚ& Ý8$ â, ä8abstÁ& é8¼$ ï*ò õ âeš+ ÿ  8Ó , 8Ó+   ±8º4•  °8d$ ¡8²$ ¬8}®8»84¿, Æ8¸q Ó ø8º& æ8œ$ î88××'Ú8p8
â, æ8¸q ó ü8 8×  ¥
 ˆ8$‰$ 8± &  88×'š8ˆ(§8ת'­8Í  ò8writeÁ Í Î ä8± Ï$ Ð7ChaChaXCore {{}}Á”Ò8$‡8Ûf8
, 8¸q ª 8!8 Â8ÔÄ% Ç8!8ó â8§
 ë8Ôì ï% ð+ ÿ  8Ý48 8   Á  ¡8¢8$ ª8½ ¬& ­ ¯8°8$´'¸8ó Ã ˆ8 Ù8º ß8Ú ç ù, è8£r$ ï ñ8ò8½ ö ÷7ˆ ø% ú8$8Îg8
®, ²8¸q ¿ °
8!8 × Ù à8ÈÚ% Ü732ÁÞ% á+ ð ñ ø8Ý8 8£L‰  £8ª$“& 8$™'8(¥8 ­ ¦, ¿8¸q Ì ˜8º& ç8œ'ï8æ ñ ô  õ8ª$ ú ü ý 7ˆÈþ% 7 ƒ$ 88ùf8
Ï, Ó8¸q à á<S A cryptographically secure random number generator that uses the ChaCha algorithm.ÁüìV<úË<\ ChaCha is a stream cipher designed by Daniel J. Bernstein[^1], that we use as an RNG. It isÁü×_<[ an improved variant of the Salsa20 cipher family, which was selected as one of the "streamÁü¿^<: ciphers suitable for widespread adoption" by eSTREAM[^2].Áü¦=<úì<X ChaCha uses add-rotate-xor (ARX) operations as its basis. These are safe against timingÁüø[<[ attacks, although that is mostly a concern for ciphers and not for RNGs. We provide a SIMDÁüÜ ^<U implementation to support high throughput on a variety of common hardware platforms.ÁüÃ!X<ú¤"<[ With the ChaCha algorithm it is possible to choose the number of rounds the core algorithmÁü°"^<Y should run. The number of rounds is a tradeoff between performance and security, where 8Áü—#\<Z rounds is the minimum potentially secure configuration, and 20 rounds is widely used as aÁüü#]< conservative choice.ÁÄâ$<úƒ%<Z We use a 64-bit counter and 64-bit stream identifier as in Bernstein's implementation[^1]Áü%]<Z except that we use a stream identifier in place of a nonce. A 64-bit counter over 64-byteÁüõ%]<Y (16 word) blocks allows 1 ZiB of output before cycling, and the stream identifier allowsÁüÛ&\<Z 2<sup>64</sup> unique streams of output per seed. Both counter and stream are initializedÁüÀ']<H to zero but may be set via the `set_word_pos` and `set_stream` methods.Áü¦(K<úú(< The word layout is:Á¼†)<ú¦)< ```textÁ\²)<' constant constant constant constantÁüÆ)*<# seed seed seed seedÁüù)&<ü¨*&<( counter counter stream_id stream_idÁü×*+<µY<+<ú+<K This implementation uses an output buffer of sixteen `u32` words, and usesÁü§+N<3 [`BlockRng`] to implement the [`RngCore`] methods.Áüþ+6<ú½,<9 [^1]: D. J. Bernstein, [*ChaCha, a variant of Salsa20*](ÁüÉ,<<$ https://cr.yp.to/chacha.html)ÁüŽ-'<ú¾-<3 [^2]: [eSTREAM: the ECRYPT Stream Cipher Project](ÁüÊ-6<( http://www.ecrypt.eu.org/stream/)Áü‰.++ ½. ¾. Ó.8º4¿. Å. Ò.8d,Æ.$ Ë.8p,Í.8Ý.84á., è.8îqTé. ô. §/8ÿ/& …/8ÀfD‡/ /, /8¸q\/ œ/$ /8$²/8Îg\·/8
Ã/, Ç/8îqTÈ/ Ó/ ê1
8!$á/8$æ/ ë/ í/ ô/8Èî/% ð/7Ö|ò/% õ/+ „0 …0 Œ08Ý4†08 š08£L0 ¦0 ·08ª$§0& «08$­0'±08$³0(¹08$¼0 Á0 à1 8Ó08í$×0 Ü0, Þ08¸q\ß0'ê08£Lì0 õ0 ú08ª$ö0% û08$1 1 Ò18ÿ¨1& «18ÀfD­1