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 ESMTP id D36DB460DE for ; Wed, 5 Jul 2023 10:24:32 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2404268C5BC; Wed, 5 Jul 2023 13:24:29 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 722C368C561 for ; Wed, 5 Jul 2023 13:24:23 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id F35452404EC for ; Wed, 5 Jul 2023 12:24:22 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id hoM4B6v_nvzo for ; Wed, 5 Jul 2023 12:24:22 +0200 (CEST) Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 009C32404EA for ; Wed, 5 Jul 2023 12:24:21 +0200 (CEST) Received: by lain.khirnov.net (Postfix, from userid 1000) id D25BA1601B2; Wed, 5 Jul 2023 12:24:21 +0200 (CEST) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <20230704232614.2785-2-jamrial@gmail.com> References: <20230704232614.2785-1-jamrial@gmail.com> <20230704232614.2785-2-jamrial@gmail.com> Mail-Followup-To: FFmpeg development discussions and patches Date: Wed, 05 Jul 2023 12:24:21 +0200 Message-ID: <168855266183.542.7703623237832964766@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH v3 2/3] avutil/random_seed: add av_random_bytes() 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Quoting James Almer (2023-07-05 01:26:13) > diff --git a/libavutil/random_seed.h b/libavutil/random_seed.h > index 0462a048e0..8df37da8f8 100644 > --- a/libavutil/random_seed.h > +++ b/libavutil/random_seed.h > @@ -36,6 +36,18 @@ > */ > uint32_t av_get_random_seed(void); > > +/** > + * Generate cryptographically secure random data, i.e. suitable for use as > + * encryption keys and similar. > + * > + * @param buf buffer into which the random data will be written > + * @param len size of buf in bytes > + * > + * @retval 0 success, and len bytes of random data was written into buf, or > + * a negative AVERROR code if random data could not be generated. @retval declares behavior for a specific return value out of several, so there should be a separate @retval for each of those See e.g. doxy for avcodec_send_packet() [1] for an example of what it looks like. [1] http://ffmpeg.org/doxygen/trunk/group__lavc__decoding.html#ga58bc4bf1e0ac59e27362597e467efff3 -- Anton Khirnov _______________________________________________ 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".