úÎm©bĂ@      !"#$%&'()*+,-./0123456789:;<=>?Good experimental#Vincent Hanquez <vincent@snarc.org>None@ABCDEFGHIJKLMNOPQ @BCDEHIJKLMN@ABCDEFGHIJKLMNOPQGood experimental#Vincent Hanquez <vincent@snarc.org> Safe-InferredR*sqrti returns two integer (l,b) so that l < = sqrt i <= b N the implementation is quite naive, use an approximation for the first number L and use a dichotomy algorithm to compute the bound relatively efficiently. S9get the extended GCD of two integer using integer divMod TTget the extended GCD of two integer using the extended binary algorithm (HAC 14.61) ? get (x,y,d) where d = gcd(a,b) and x,y satisfying ax + by = d U(check if a list of integer are all even RSTURSTURSTU Safe-InferredV5os2ip converts a byte string into a positive integer W5i2osp converts a positive integer into a byte string X;returns the number of bytes to store an integer with i2osp VWXVWXVWX Good experimental#Vincent Hanquez <vincent@snarc.org>NoneY-generate a positive integer between 0 and m. X using as many bytes as necessary to the same size as m, that are converted to integer. Z7generate a number between the inclusive bound [low,high]. [8generate a positive integer of a specific size in bits. E the number of bits need to be multiple of 8. It will always returns # an integer that is close 2^(1+bits/'8) by setting the 2 highest bits to 1. YZ[YZ[YZ[ Good experimental#Vincent Hanquez <vincent@snarc.org> Safe-Inferred\Gexponantiation_rtl_binary computes modular exponantiation as b^e mod m E using the right-to-left binary exponentiation algorithm (HAC 14.79) ]<exponantiation computes modular exponantiation as b^e mod m  using repetitive squaring. ^8inverse computes the modular inverse as in g^(-1) mod m \]^\]^\]^ Good experimental#Vincent Hanquez <vincent@snarc.org>None _)returns if the number is probably prime. G first a list of small primes are implicitely tested for divisibility, A then a fermat primality test is used with arbitrary numbers and K then the Miller Rabin algorithm is used with an accuracy of 30 recursions `0generate a prime number of the required bitsize a@generate a prime number of the form 2p+1 where p is also prime. = it is also knowed as a Sophie Germaine prime or safe prime. JThe number of safe prime is significantly smaller to the number of prime,  as such it shouldn'6t be used if this number is supposed to be kept safe. b<find a prime from a starting point where the property hold. c>find a prime from a starting point with no specific property. dLMiller Rabin algorithm return if the number is probably prime or composite. [ the tries parameter is the number of recursion, that determines the accuracy of the test. e/Probabilitic Test using Fermat primility test. D Beware of Carmichael numbers that are Fermat liars, i.e. this test < is useless for them. always combines with some other test. f"Test naively is integer is prime. D while naive, we skip even number and stop iteration at i > sqrt(n) g.Test is two integer are coprime to each other h%list of the first primes till 2903.. _`abcde&number of iterations of the algorithm  starting a number to test for primality fghi _`abcdefg _`abcdefghiGood experimental#Vincent Hanquez <vincent@snarc.org>NoneSthe random generator returns an error. give the opportunity to reseed for example. <signature is not valid r or s is not between the bound 0..q %sign message using the private key. +verify a bytestring using the public key.  j   jGood experimental#Vincent Hanquez <vincent@snarc.org>None!Egenerate params from a specific generator (2 or 5 are common values) R we generate a safe prime (a prime number of the form 2p+1 where p is also prime) "4generate a private number with no specific property - this number is usually called X in DH text. #?generate a public number that is for the other party benefits. - this number is usually called Y in DH text. $Qgenerate a shared key using our private number and the other party public number !"#$!"#$!"#$!"#$ Good experimental#Vincent Hanquez <vincent@snarc.org>Nonek4generate a private number with no specific property " this number is usually called a. 7FIXME replace generateOfSize by generateBetween [0, q-1] l?generate a public number that is for the other party benefits. % this number is usually called h=g^a m'encrypt with a specified ephemeral key  do not reuse ephemeral key. n/encrypt a message using params and public keys , will generate b (called the ephemeral key) odecrypt message klmno klmnoklmnoGood experimental#Vincent Hanquez <vincent@snarc.org>None (Sthe whole key is probably not valid, since the message is bigger than the key size )Sthe random generator returns an error. give the opportunity to reseed for example. *Nthe signature generated through the hash is too long to process with this key +the message decrypted doesn')t have a PKCS15 structure (0 2 .. 0 msg) ,:the message to encrypt is too long (>= private_size - 11) -Othe message to decrypt is not of the correct size (need to be == private_size) .(decrypt message using the private key. /Rencrypt a bytestring using the public key and a CryptoRandomGen random generator. 9 - the message need to be smaller than the key size - 11 0Asign message using private key, a hash and its ASN1 description 1(verify message with the signed message 2;generate a pair of (private, public) key of size in bytes. %&'()*+,-pqrs./012tuvw %&'()*+,-./012'-,+*)( &%2./01%&'-,+*)(pqrs./012tuvwGood experimental#Vincent Hanquez <vincent@snarc.org>None9Hencrypt with the key a bytestring and returns the encrypted bytestring :Hdecrypt with the key a bytestring and returns the encrypted bytestring 134567xyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“8”•–—˜™š›œžŸ 9:3456789:3456789:*34567xyz|{}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“8”•–—˜™š›œžŸ 9:Good experimentalNone$;ĄąŁ€<„Чš©=>Ș«Ź­?źŻ°±ČłŽ”¶·žčș»ŒœŸż;<=>?<;?=>;ĄąŁ€<„Чš©=>Ș«Ź­?źŻ°±ČłŽ”¶·žčș»ŒœŸż Good experimental#Vincent Hanquez <vincent@snarc.org>NoneÀÁÂĂÄĆÆGood experimental#Vincent Hanquez <vincent@snarc.org>NoneÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖ !"#$$%$&$'()*+,-./012(3)456789+,:;;<=>?98;@98ABBCCDEFGHIJKLMNOPQRSTUVWX Y Z [ \ ] ^ _ ` a b c d e f g h ij . / k 9 8lmnopqrjsstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š;›œ@žŸ ĄąŁ€„Чš©Șš«Ź­źŻ°±ČłŽ”¶· 8· 9· ž· :· č· ș· ș»Œ»œ»Ÿ»ż»À»Á»»Ă»Ä»Ć»Æ»A»;»Ç»ÇÈcryptocipher-0.4.0Crypto.Cipher.RSACrypto.Cipher.DSACrypto.Cipher.DHCrypto.Cipher.CamelliaCrypto.Cipher.BlowfishNumber.Polynomial Number.BasicNumber.SerializeNumber.GenerateNumber.ModArithmetic Number.PrimeCrypto.Cipher.ElGamalCrypto.Cipher.RC4Crypto.Cipher.AEScrypto-pubkey-types-0.2.0Crypto.Types.PubKey.RSApublic_epublic_n public_size PublicKey private_qinv private_dQ private_dP private_q private_p private_d private_pub PrivateKeyCrypto.Types.PubKey.DSAParams Signaturepublic_y public_params private_xprivate_paramsCrypto.Types.PubKey.DH PublicNumber PrivateNumber SharedKeyErrorRandomGenFailureInvalidSignaturesignverifygenerateParamsgeneratePrivategeneratePublic getSharedHashASN1HashFKeyInternalErrorSignatureTooLongMessageNotRecognizedMessageTooLongMessageSizeIncorrectdecryptencryptgenerateKeykkwke initKey128BlowfishinitKey PolynomialMonomialtoListfromList getWeight mergePolyaddPolysubPolynegPolymulPoly squarePolyexpPolydivPoly$fShowPolynomial$fShowMonomial $fOrdMonomialsqrtigcde gcde_binaryareEvenos2ipi2osp lengthBytes generateMaxgenerateBetweengenerateOfSizeexponantiation_rtl_binaryexponantiationinverseisProbablyPrime generatePrimegenerateSafePrimefindPrimeFromWith findPrimeFromprimalityTestMillerRabinprimalityTestFermatprimalityTestNaive isCoprime smallPrimesdividesexpmod encryptWithpadPKCS1 unpadPKCS1dpSlowdpFast makeSignaturegetRandomBytesi2ospOfWord128ModeEncryptDecrypt w128tow64 w64tow128w64tow8w8tow64w64tow32w32tow64w128tow8 getWord64 getWord128 putWord128sboxsbox1sbox2sbox3sbox4sigma1sigma2sigma3sigma4sigma5sigma6rotl128 setKeyInterimfeistelflflinvgetKeyKgetKeyKegetKeyKw doBlockRounddoBlock encryptBlock decryptBlock encryptChunk decryptChunkdoChunksunKey BlowfishStateBFbfKeybfStateSboxPbox selectEncrypt selectDecryptcipher initBoxeskeyFromByteStringkeyToByteString coreCrypto bfMakeKeyprocKey toW32Pair fromW32Pair decode32be encode64bemkBoxiPboxiSbox0iSbox1iSbox2iSbox3$fSerializeKey$fSerializeBlowfishcipher-rc4-0.1.1combineinitCtxCtxcipher-aes-0.1.5 decryptGCM decryptXTS decryptCTR decryptCBC decryptECB encryptXTS encryptGCM encryptCTRgenCTR encryptCBC encryptECBIV