From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: libnettle/libhogweed WIP Date: Sat, 15 Jul 2017 14:40:37 -0400 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87r2xhfsre.fsf@lifelogs.com> References: <874lxmtxyy.fsf@lifelogs.com> <87r30prvwt.fsf@lifelogs.com> <8337d4csez.fsf@gnu.org> <87r30nq9el.fsf@lifelogs.com> <83inlyc1k2.fsf@gnu.org> <87inlyrfni.fsf@lifelogs.com> <837f2eb845.fsf@gnu.org> <87ziedpyy1.fsf@lifelogs.com> <83d1b75u8a.fsf@gnu.org> <87r2znntaq.fsf@lifelogs.com> <87o9u8q4a5.fsf@lifelogs.com> <83tw3xbklg.fsf@gnu.org> <87zictm415.fsf@lifelogs.com> <83podoqchd.fsf@gnu.org> <87podnnbi2.fsf@lifelogs.com> <8760ewi3rw.fsf@lifelogs.com> <87r2xjgilq.fsf@lifelogs.com> <83iniug7ql.fsf@gnu.org> <87fudyhkhy.fsf@lifelogs.com> <8360euf4d3.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1500144071 3197 195.159.176.226 (15 Jul 2017 18:41:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 15 Jul 2017 18:41:11 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 15 20:41:03 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dWRzy-0000Fv-8i for ged-emacs-devel@m.gmane.org; Sat, 15 Jul 2017 20:41:02 +0200 Original-Received: from localhost ([::1]:42984 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dWS02-0007NI-9B for ged-emacs-devel@m.gmane.org; Sat, 15 Jul 2017 14:41:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dWRzv-0007Mv-Hb for emacs-devel@gnu.org; Sat, 15 Jul 2017 14:41:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dWRzq-0001CI-Nd for emacs-devel@gnu.org; Sat, 15 Jul 2017 14:40:59 -0400 Original-Received: from [195.159.176.226] (port=44580 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dWRzq-0001BP-HG for emacs-devel@gnu.org; Sat, 15 Jul 2017 14:40:54 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dWRzb-0007dJ-BX for emacs-devel@gnu.org; Sat, 15 Jul 2017 20:40:39 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 42 Original-X-Complaints-To: usenet@blaine.gmane.org X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Copies-To: never Cancel-Lock: sha1:1i01r2uvK99jmKaRBGgUbhm/m5U= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:216700 Archived-At: On Sat, 15 Jul 2017 12:15:20 +0300 Eli Zaretskii wrote: EZ> What I see (without really understanding what should happen) is that EZ> gnutls-symmetric-decrypt returns a string that is 32-byte long, EZ> whereas the original input before encryption was a 16-byte string. In EZ> the decrypted string, the first 16 bytes are identical to the input EZ> before encryption, the rest seem to be binary garbage. When the EZ> original 16-byte input is encrypted by gnutls-symmetric-encrypt, the EZ> result is a 32-byte string. All of this happens in the first call to EZ> encryption and decryption functions produced by the loop in EZ> test-gnutls-005-aead-ciphers. Does this makes sense and/or ring any EZ> bells? Do you need me to provide any further information? EZ> The version of GnuTLS library I have here is 3.4.15, btw. The size of the output is determined by the cipher's parameters. So we need to know the parameters, which are in cplist. Can you capture the full parameters and memory buffers passed into the GnuTLS functions? Here's the sequence we expect in the test, this in a let* form: 1. The IV may be actual data or it may be a list of 'iv-auto and ivsize which tells extract_data_from_object() to generate a random IV (which is returned as the second element by `gnutls-symmetric-encrypt'). 2. We call (gnutls-symmetric-encrypt cplist (copy-sequence key) iv input (copy-sequence auth)) 3. We need to make sure the cplist, key, iv, input, and auth make it down to the GnuTLS C functions. 4. We need to look at the output returned from the GnuTLS C function and make sure it makes it to the return of `gnutls-symmetric-encrypt' together with the actual IV used. 5. We need to do the same as steps 1-4 for decryption. If you can provide a recipe for testing your case, that would be helpful. I may be able to duplicate it in a Docker container. Ted