unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ted Zlatanov <tzz@lifelogs.com>
Cc: emacs-devel@gnu.org
Subject: Re: libnettle/libhogweed WIP
Date: Wed, 17 May 2017 19:22:13 +0300	[thread overview]
Message-ID: <83d1b75u8a.fsf@gnu.org> (raw)
In-Reply-To: <87ziedpyy1.fsf@lifelogs.com> (message from Ted Zlatanov on Mon,  15 May 2017 17:55:34 -0400)

> From: Ted Zlatanov <tzz@lifelogs.com>
> Date: Mon, 15 May 2017 17:55:34 -0400
> 
> On Fri, 21 Apr 2017 09:14:02 +0300 Eli Zaretskii <eliz@gnu.org> wrote: 

It's hard to have a dialog with 4 weeks between responses ;-)

> EZ> I think both this and the other sub-thread arrived at a point where it
> EZ> is important to present a list of use cases we envision and would like
> EZ> to support, because these kinds of decisions are prone to errors if we
> EZ> don't hold the use cases in our minds.
> 
> EZ> So could you please present such a list, describing the source of the
> EZ> text to be encrypted/decrypted/hashed, the purpose of the operation
> EZ> (i.e. some higher-level context), and the destination where the
> EZ> encrypted/decrypted/hashed text will go?  The list doesn't have to be
> EZ> exhaustive, but it should include the most important use cases.
> 
> Right now, I am mirroring the GnuTLS API. That API is in wide use. So I
> think the use cases are a large subset of the general GnuTLS use cases;
> we're enabling the same things.

I don't think this could be the case.  We are talking about using
these APIs in Emacs Lisp programs, where objects being manipulated
aren't C strings, and where file I/O is relatively rare and mostly
implied.  The use cases I was asking about are use cases for Lisp
programs.

> 
> On Fri, 21 Apr 2017 09:21:14 +0300 Eli Zaretskii <eliz@gnu.org> wrote: 
> 
> >> From: Ted Zlatanov <tzz@lifelogs.com>
> >> Date: Thu, 20 Apr 2017 17:54:32 -0400
> >> 
> >> The KEY is secret and ideally would come from a file and never be
> >> seen at the Lisp level. But tests and other use cases may need it from a
> >> buffer (more secure but still accessible to Lisp) or a string (visible
> >> to all as a function parameter).
> 
> EZ> For testing, we could always write the key to a file before using it.
> EZ> What other use cases would need the key from other sources?
> 
> I think if the key is not on disk, we shouldn't force it to disk just to
> fit a always-a-file usage model.

My point was that the test suite cannot be a use case that drives our
design, because we can tweak any test to fit into any usage pattern we
want.  Valid and interesting use cases should come from outside the
test suite, they should come from real-life uses of these features by
Lisp programs.

> >> Getting the INPUT from a file enables large files (not in the first
> >> version probably) and other interesting use cases.
> 
> EZ> What other cases?  Large files is only theoretically useful, since
> EZ> generally Emacs cannot do useful things on files larger than
> EZ> most-positive-fixnum, and on 64-bit machines that is far enough to not
> EZ> care.
> 
> I think anything over 1 MB is pretty big.

Not for Emacs.  1MB is actually pretty small, and shouldn't even
bother us.  A system that cannot spare 1MB is already in trouble.

> There also pipes (pretty easy to fit the file model)

How do you fit a pipe into the (file "FOO") model?

> and network streams (probably a separate spec).

Well, this part of the discussion was specifically about the
(file "FOO") specs, so additional specs are a separate discussion.

OTOH, all of these are readable into a buffer, so the buffer model
could easily cover them all, no?

> EZ> I think we need to weigh flexibility against the complexity, and find
> EZ> the optimal balance.  So making the interfaces too complicated for use
> EZ> cases that will happen only very rarely, if at all, should be avoided.
> 
> I agree in general, BUT these are not end-user APIs. They are for
> application developers. They have to be flexible so we don't have to
> bolt-on these things later.

They have to be flexible enough, but not more flexible.  We are
talking about where to draw the line.

> EZ> The data will always leave traces, because doing the above involves
> EZ> reallocation of memory, so you are likely to leave traces in the page
> EZ> file and in memory.  But I don't think you can avoid that, whatever
> EZ> you do: as long as data needs to be read into memory to process it, it
> EZ> will always leave traces.
> 
> Would you agree the tight loop that overwrites the read block will leave
> fewer traces and offer fewer exposure opportunities?

I don't know, I'm not a specialist on how these usage patterns affect
VM and swap.  Maybe you are right.

> So how about a compromise for now: I can leave the `(file "foo")'
> capability out. I'll adjust the docs to remove mentions of it. Then,
> after the main patch is done, I can propose a followup patch to
> implement `(file "foo")' and we can decide if it's good or bad.
> 
> That will get the GnuTLS API integration working, and we can have a
> separate discussion about `(file "foo")' later. Lars, Eli, would that be
> acceptable?

I think this should be fine, thanks.



  parent reply	other threads:[~2017-05-17 16:22 UTC|newest]

Thread overview: 128+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20 10:00 How to ship native modules? Elias Mårtenson
2017-02-20 15:27 ` Eli Zaretskii
2017-02-20 16:01   ` Elias Mårtenson
2017-02-20 16:30     ` Eli Zaretskii
2017-02-21  2:48       ` Elias Mårtenson
2017-02-21  3:41         ` Eli Zaretskii
2017-02-21  4:13           ` Elias Mårtenson
2017-02-21 16:48             ` Eli Zaretskii
2017-02-21 20:06               ` John Wiegley
2017-02-21 14:44       ` Stefan Monnier
     [not found]         ` <CADtN0WLjNcFRLCsJNZX+XfqOcq+veTaoGkwHQCV9bjvuQoEORA@mail.gmail.com>
2017-02-21 15:48           ` Elias Mårtenson
2017-02-21 17:14             ` Stefan Monnier
2017-02-21 16:59         ` Eli Zaretskii
2017-03-02 14:59   ` request to reconsider libnettle/libhogweed (was: How to ship native modules?) Ted Zlatanov
2017-03-02 15:19     ` request to reconsider libnettle/libhogweed Stefan Monnier
2017-03-02 15:55     ` request to reconsider libnettle/libhogweed (was: How to ship native modules?) Eli Zaretskii
2017-03-15 21:19       ` libnettle/libhogweed WIP (was: request to reconsider libnettle/libhogweed) Ted Zlatanov
2017-03-16 15:28         ` Eli Zaretskii
2017-03-17 22:46           ` libnettle/libhogweed WIP Ted Zlatanov
2017-03-18  8:12             ` Eli Zaretskii
2017-03-20 18:45           ` Ted Zlatanov
2017-04-11 20:05           ` Ted Zlatanov
2017-04-14 20:48             ` Ted Zlatanov
2017-04-15  9:32               ` Eli Zaretskii
2017-04-15 14:27                 ` Ted Zlatanov
2017-04-15 14:55                   ` Eli Zaretskii
2017-04-16  2:39                     ` Ted Zlatanov
2017-04-16  6:25                       ` Eli Zaretskii
2017-04-16  6:51                       ` Eli Zaretskii
2017-04-17 16:23                         ` Ted Zlatanov
2017-04-17 16:34                           ` Eli Zaretskii
2017-04-17 16:55                             ` Ted Zlatanov
2017-04-17 17:11                               ` Eli Zaretskii
2017-04-17 17:34                                 ` Ted Zlatanov
2017-04-17 17:46                                   ` Ted Zlatanov
2017-04-17 18:11                                   ` Eli Zaretskii
2017-04-17 20:50                               ` Ted Zlatanov
2017-04-17 21:19                                 ` Noam Postavsky
2017-04-17 23:29                                   ` Ted Zlatanov
2017-04-19  2:08                                     ` Ted Zlatanov
2017-04-19  2:42                                       ` Noam Postavsky
2017-04-19 15:24                                       ` Davis Herring
2017-04-19 15:45                                       ` Eli Zaretskii
2017-04-20 17:24                                         ` Ted Zlatanov
2017-04-20 19:38                                           ` Eli Zaretskii
2017-04-20 20:24                                             ` Ted Zlatanov
2017-04-20 20:42                                               ` Lars Ingebrigtsen
2017-04-20 21:54                                                 ` Ted Zlatanov
2017-04-21  6:21                                                   ` Eli Zaretskii
2017-04-21 18:45                                                   ` Lars Ingebrigtsen
2017-04-21 19:15                                                     ` Eli Zaretskii
2017-04-21  6:14                                               ` Eli Zaretskii
2017-05-15 21:55                                                 ` Ted Zlatanov
2017-05-16 22:19                                                   ` Ted Zlatanov
2017-05-17 16:22                                                   ` Eli Zaretskii [this message]
2017-05-17 20:05                                                     ` Ted Zlatanov
2017-05-31 18:17                                                       ` Ted Zlatanov
2017-06-03  7:23                                                         ` Eli Zaretskii
2017-06-03  9:00                                                           ` Andreas Schwab
2017-06-03 10:01                                                             ` Eli Zaretskii
2017-06-03 10:09                                                               ` Andreas Schwab
2017-06-03 10:47                                                                 ` Eli Zaretskii
2017-06-27 22:58                                                           ` Ted Zlatanov
2017-06-28 16:54                                                             ` Eli Zaretskii
2017-06-28 19:44                                                               ` Ted Zlatanov
2017-07-13 18:35                                                                 ` Ted Zlatanov
2017-07-14 15:10                                                                   ` Ted Zlatanov
2017-07-14 19:04                                                                     ` Eli Zaretskii
2017-07-14 19:43                                                                       ` Ted Zlatanov
2017-07-14 20:04                                                                         ` Eli Zaretskii
2017-07-15 18:30                                                                           ` Ted Zlatanov
2017-07-15  9:15                                                                         ` Eli Zaretskii
2017-07-15 18:40                                                                           ` Ted Zlatanov
2017-07-15 19:12                                                                             ` Eli Zaretskii
2017-07-22  9:10                                                                               ` Eli Zaretskii
2017-07-26  6:58                                                                                 ` Ted Zlatanov
2017-07-26 14:52                                                                                   ` Eli Zaretskii
2017-07-26 15:34                                                                                     ` Ted Zlatanov
2017-07-26 15:49                                                                                       ` Eli Zaretskii
2017-07-26 16:08                                                                                         ` Ted Zlatanov
2017-07-26 18:51                                                                                           ` Eli Zaretskii
2017-07-26 20:48                                                                                             ` Ted Zlatanov
2017-07-27  0:19                                                                                   ` Paul Eggert
2017-07-27  2:34                                                                                     ` Eli Zaretskii
2017-07-27  4:36                                                                                       ` Paul Eggert
2017-07-27 15:56                                                                                         ` Ted Zlatanov
2017-08-03 19:52                                                                                           ` Ted Zlatanov
2017-08-03  8:02                                                                                         ` Paul Eggert
2017-08-03 16:49                                                                                           ` Eli Zaretskii
2017-04-18 17:44                                 ` Ted Zlatanov
2017-04-19 12:22                               ` Stefan Monnier
2017-04-19 13:38                                 ` Ted Zlatanov
2017-04-19 14:16                                 ` Lars Ingebrigtsen
2017-04-19 14:48                                   ` Stefan Monnier
2017-04-19 14:41                                 ` Eli Zaretskii
2017-04-19 14:54                                   ` Stefan Monnier
2017-04-19 15:31                                     ` Eli Zaretskii
2017-04-19 15:48                                   ` Ted Zlatanov
2017-04-19 16:49                                     ` Lars Ingebrigtsen
2017-04-19 17:24                                       ` Eli Zaretskii
2017-04-19 19:53                                         ` Stefan Monnier
2017-04-20  2:30                                           ` Eli Zaretskii
2017-04-20  3:36                                             ` Stefan Monnier
2017-04-20 15:46                                               ` Eli Zaretskii
2017-04-20 15:59                                                 ` Lars Ingebrigtsen
2017-04-20 16:24                                                   ` Eli Zaretskii
2017-04-20 17:25                                                     ` Stefan Monnier
2017-04-20 19:40                                                       ` Lars Ingebrigtsen
2017-04-20 20:31                                                         ` Eli Zaretskii
2017-04-20 19:58                                                       ` Eli Zaretskii
2017-04-20 20:36                                                         ` Eli Zaretskii
2017-04-20 17:14                                                 ` Stefan Monnier
2017-04-20 19:29                                                   ` Eli Zaretskii
2017-04-19 19:49                                       ` Stefan Monnier
2017-04-17 16:00                       ` rename STRING_SET_CHARS to STRING_SET_SIZE (was: libnettle/libhogweed WIP) Ted Zlatanov
2017-04-17 16:24                         ` rename STRING_SET_CHARS to STRING_SET_SIZE Eli Zaretskii
2017-04-17 16:29                         ` Stefan Monnier
2017-04-17 16:34                           ` Ted Zlatanov
2017-04-16  3:37                     ` libnettle/libhogweed WIP Stefan Monnier
2017-04-16  6:19                       ` Eli Zaretskii
2017-04-16 13:20                         ` Stefan Monnier
2017-04-16  7:47               ` Toon Claes
2017-03-02 17:58     ` request to reconsider libnettle/libhogweed Paul Eggert
2017-03-02 18:33       ` Ted Zlatanov
2017-02-20 15:33 ` How to ship native modules? Aurélien Aptel
2017-02-21  4:50 ` Andreas Politz
2017-02-21  5:12   ` Elias Mårtenson
2017-02-21  5:23     ` Andreas Politz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83d1b75u8a.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=tzz@lifelogs.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).