FAQ
It probably would be a net loss. But the return values should be
documented somehow. Maybe there is a better wording.

Also I think it should be documented, that the capacity of the out
argument has to be big enough to hold message (and poly1305.TagSize more
bytes).
Otherwise append might reallocate changing only the local copy of the
reference to out. E.g. http://play.golang.org/p/YGbsHyBjND




https://codereview.appspot.com/9687046/

--

---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Sfrithjof at Jun 6, 2013 at 9:20 am
    Another point is that the test cases don't use the argument out by
    always using the pattern
          box = Seal(box[:0], message, &nonce, &key)

    Would you agree with such changes?

    https://codereview.appspot.com/9687046/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Adam Langley at Jun 6, 2013 at 2:47 pm

    On Thu, Jun 6, 2013 at 5:06 AM, wrote:
    Also I think it should be documented, that the capacity of the out
    argument has to be big enough to hold message (and poly1305.TagSize more
    bytes).
    Otherwise append might reallocate changing only the local copy of the
    reference to out. E.g. http://play.golang.org/p/YGbsHyBjND
    The functions are designed to work like append() - they take a
    (possibly nil) buffer and return the updated value. That value may
    alias the argument, if there was sufficient capacity, or may be a
    fresh buffer.

    Perhaps the arguments are confusingly named?


    Cheers

    AGL

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Frithjof Schulze at Jun 6, 2013 at 7:03 pm
    The arguments are fine; I just managed to confuse myself.
    Still, if I understand correctly this program
    http://play.golang.org/p/SRq2AqA4Dz
    should print 'FirstPart SecondPart', but it prints 'SecondPart'.

    Best, Frithjof

    On Thu, Jun 6, 2013 at 4:47 PM, Adam Langley wrote:
    On Thu, Jun 6, 2013 at 5:06 AM, wrote:
    Also I think it should be documented, that the capacity of the out
    argument has to be big enough to hold message (and poly1305.TagSize more
    bytes).
    Otherwise append might reallocate changing only the local copy of the
    reference to out. E.g. http://play.golang.org/p/YGbsHyBjND
    The functions are designed to work like append() - they take a
    (possibly nil) buffer and return the updated value. That value may
    alias the argument, if there was sufficient capacity, or may be a
    fresh buffer.

    Perhaps the arguments are confusingly named?


    Cheers

    AGL
    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Adam Langley at Jun 6, 2013 at 8:32 pm

    On Thu, Jun 6, 2013 at 3:03 PM, Frithjof Schulze wrote:
    The arguments are fine; I just managed to confuse myself.
    Still, if I understand correctly this program
    http://play.golang.org/p/SRq2AqA4Dz
    should print 'FirstPart SecondPart', but it prints 'SecondPart'.
    I've just looked over the secretbox code again and it's clearly nonsense. Sorry!

    Will be fixed with https://codereview.appspot.com/10099043


    Cheers

    AGL

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedJun 6, '13 at 9:06a
activeJun 6, '13 at 8:32p
posts5
users2
websitegolang.org

2 users in discussion

Frithjof Schulze: 3 posts Adam Langley: 2 posts

People

Translate

site design / logo © 2022 Grokbase