From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id E22EC4C30B for ; Thu, 6 Feb 2025 16:04:53 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9B54468B874; Thu, 6 Feb 2025 18:04:50 +0200 (EET) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9B46468B874 for ; Thu, 6 Feb 2025 18:04:44 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id F071344331 for ; Thu, 6 Feb 2025 16:04:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1738857884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KoR87AegvgUTQVnRNmb7tnZfJFQ2f4fe8F36DqLdqYU=; b=n7ceqi+iCPqSbbp37ZPEwEIbzFJiRo97ScOgQcvfwJJXu2oKC9JzW6G9nfLuBGd1ZMBONy gS7Y/K9mGJdY1prgXX4mtm22OUNOJhY4PaEYy9kF+rsEyV22s9P9l0IBI0bHGbj/illbhR buufTJ9zVo5eCq9pArrGzZByxOYmOEdf0IFl3UHYtWKywuRRcG1lmIzZRwr9G6t6LNhoQW pyixuC/VVGwreEloI8TXw77qeKOiZUoyihbxtwNVUzbe1H02Nf/GieaQ4KYNp2x8O4JBNL lK8cc0i55hggX8t83EElNNTyUjHs4mIc9ZQm4P/MNqVJkqt281Mq5D1LyffuSA== Date: Thu, 6 Feb 2025 17:04:43 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250206160443.GT4991@pb2> References: <20250205221813.4110398-1-martin@martin.st> <20250205221813.4110398-2-martin@martin.st> <20250206001638.GI4991@pb2> MIME-Version: 1.0 In-Reply-To: X-GND-State: clean X-GND-Score: -70 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvieekudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdlfedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddtudenucfhrhhomhepofhitghhrggvlhcupfhivgguvghrmhgrhigvrhcuoehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgeqnecuggftrfgrthhtvghrnhepudetvdfhudeuudegudefgfehhfevvdfggfffkefhvdfgvdetffdtjeekheetfeehnecukfhppeeguddrieeirdeijedruddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeguddrieeirdeijedruddufedphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepmhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepfhhfmhhpvghgqdguvghvvghlsehffhhmphgvghdrohhrgh X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH v2 2/2] random_seed: Improve behaviour with small timer increments with high precision timers X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: multipart/mixed; boundary="===============6608439490998882129==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============6608439490998882129== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jolerGjvme+AC0t/" Content-Disposition: inline --jolerGjvme+AC0t/ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 06, 2025 at 02:38:48PM +0200, Martin Storsj=F6 wrote: > On Thu, 6 Feb 2025, Michael Niedermayer wrote: >=20 > > > + // If the timer resolution is high, and we get the same = timer > > > + // value multiple times, use variances in the number of = repeats > > > + // of each timer value as entropy. If the number of repe= ats changed, > > > + // proceed to the next index. > >=20 > > Does it still work if you check against the last 2 ? > > or does this become too slow ? > > What iam thinking of is this > >=20 > > 7,8,7,8,8,7,8,7,8,8,7,8,7,8,8,7,8,7,8,8,... and a 9 or 6 or further dis= tant would trigger it > >=20 > > I assume both the CPU clock and the wall time are quite precisse so if = we > > just compare them the entropy could be low even with 2 alternating valu= es >=20 > Yes, that still works for making it terminate in a reasonable amount of > time. I updated the patch to keep track of 3 numbers of repeats, and we > consider that we got valid entropy once the new number of repeats is > different from the last two. >=20 > So in the sequence above, e.g. for 7,8,7,8,8,7, at the point of the last > one, we have old repeats 8 and 8, and the new repeat count 7, which in th= at > context looks unique. I was thinking that in 7,8,8 that 7 and 8 be the 2 least recent used values not 8,8 that is, something like: if (old2 =3D=3D new) { FFSWAP(old,old2); } else if (old !=3D new) { old2 =3D old; old =3D new; } but again, iam not sure this will work or just need too much time to gather enough entropy thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Some people wanted to paint the bikeshed green, some blue and some pink. People argued and fought, when they finally agreed, only rust was left. --jolerGjvme+AC0t/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZ6TdjwAKCRBhHseHBAsP q9J9AJ93AXQHOMLRW1erooSsPkUZZm0URQCeN20ZVR0dJ75FlVS3SAOo6vMeZ/k= =Y+Cu -----END PGP SIGNATURE----- --jolerGjvme+AC0t/-- --===============6608439490998882129== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". --===============6608439490998882129==--