Re: Preparing for Nettle-3.9

2023-05-08 Thread Niels Möller
Justus Winter  writes:

> Most appreciated!  I read the documentation and found only two minor
> issues (patches sent).  The interface looks good.

Thanks, both patches applied.

> We have quite a few
> tests: we instantiate it with every compatible cipher and do a roundtrip
> test, we have the test vectors from RFC7253, we have an additional set
> of test vectors with 15 byte nonces published by dkg, 

Do you have any testvectors with a dozen or so blocks? Nettle's
testsuite/ocb-text.c includes some home-made test vectors with 16
blocks, to verify the code paths that tries to handle multiple blocks
more efficiently. See
https://git.lysator.liu.se/nettle/nettle/-/blob/master/testsuite/ocb-test.c#L222
and below.

Regards,
/Niels

-- 
Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677.
Internet email is subject to wholesale government surveillance.
___
nettle-bugs mailing list -- nettle-bugs@lists.lysator.liu.se
To unsubscribe send an email to nettle-bugs-le...@lists.lysator.liu.se


Re: Preparing for Nettle-3.9

2023-05-08 Thread Justus Winter
Hi Niels :)

Niels Möller  writes:

>   * Support for OCB authenticated encryption mode.

Most appreciated!  I read the documentation and found only two minor
issues (patches sent).  The interface looks good.

I have added support for OCB in our Rust bindings on 2022-02-03 in a
feature branch.  I don't think that the interface changed since (note
we're only using the streaming general interface).  We have quite a few
tests: we instantiate it with every compatible cipher and do a roundtrip
test, we have the test vectors from RFC7253, we have an additional set
of test vectors with 15 byte nonces published by dkg, all kinds of tests
higher up in our OpenPGP implementation including test vectors from the
upcoming OpenPGP revision.  I'm reasonable confident that bindings and
underlying implementation behave as expected.

Best,
Justus


signature.asc
Description: PGP signature
___
nettle-bugs mailing list -- nettle-bugs@lists.lysator.liu.se
To unsubscribe send an email to nettle-bugs-le...@lists.lysator.liu.se


[PATCH 1/2] Fix function prototype in the documentation.

2023-05-08 Thread justus
From: Justus Winter 

Without the space, texinfo seems to mis-parse the definition.
---
 nettle.texinfo | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/nettle.texinfo b/nettle.texinfo
index e26d7187..fafd3930 100644
--- a/nettle.texinfo
+++ b/nettle.texinfo
@@ -3779,19 +3779,19 @@ each message @emph{must} use a length that is a 
multiple of the block
 size.
 @end deftypefun
 
-@deftypefun void ocb_aes128_encrypt(struct ocb_ctx *@var{ctx}, const struct 
ocb_aes128_encrypt_key *@var{key}, size_t @var{length}, uint8_t *@var{dst}, 
const uint8_t *@var{src})
+@deftypefun void ocb_aes128_encrypt (struct ocb_ctx *@var{ctx}, const struct 
ocb_aes128_encrypt_key *@var{key}, size_t @var{length}, uint8_t *@var{dst}, 
const uint8_t *@var{src})
 Encrypts the data of a message. All but the last call for each message
 @emph{must} use a length that is a multiple of the block size.
 @end deftypefun
 
-@deftypefun void ocb_aes128_decrypt(struct ocb_ctx *@var{ctx}, const struct 
ocb_aes128_encrypt_key *@var{key}, const struct aes128_ctx *@var{decrypt}, 
size_t @var{length}, uint8_t *@var{dst}, const uint8_t *@var{src})
+@deftypefun void ocb_aes128_decrypt (struct ocb_ctx *@var{ctx}, const struct 
ocb_aes128_encrypt_key *@var{key}, const struct aes128_ctx *@var{decrypt}, 
size_t @var{length}, uint8_t *@var{dst}, const uint8_t *@var{src})
 Decrypts the data of a message. @var{decrypt} is an AES context
 initialized for decryption using the same key. All but the last call for
 each message @emph{must} use a length that is a multiple of the block
 size.
 @end deftypefun
 
-@deftypefun void ocb_aes128_digest(struct ocb_ctx *@var{ctx}, const struct 
ocb_aes128_encrypt_key *@var{key}, size_t @var{length}, uint8_t *@var{digest})
+@deftypefun void ocb_aes128_digest (struct ocb_ctx *@var{ctx}, const struct 
ocb_aes128_encrypt_key *@var{key}, size_t @var{length}, uint8_t *@var{digest})
 Extracts the message digest (also known ``authentication tag''). This is
 the final operation when processing a message. The @var{length} value
 @emph{should} be the same as the tag length passed to the preceding
-- 
2.39.2

___
nettle-bugs mailing list -- nettle-bugs@lists.lysator.liu.se
To unsubscribe send an email to nettle-bugs-le...@lists.lysator.liu.se


[PATCH 2/2] Fix reference to the corresponding set_nonce function.

2023-05-08 Thread justus
From: Justus Winter 

---
 nettle.texinfo | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nettle.texinfo b/nettle.texinfo
index fafd3930..a73f1635 100644
--- a/nettle.texinfo
+++ b/nettle.texinfo
@@ -3795,7 +3795,7 @@ size.
 Extracts the message digest (also known ``authentication tag''). This is
 the final operation when processing a message. The @var{length} value
 @emph{should} be the same as the tag length passed to the preceding
-@code{ocb_set_nonce} call (using a different length is possible, but
+@code{ocb_aes128_set_nonce} call (using a different length is possible, but
 incompatible with @cite{RFC 7253}).
 @end deftypefun
 
-- 
2.39.2

___
nettle-bugs mailing list -- nettle-bugs@lists.lysator.liu.se
To unsubscribe send an email to nettle-bugs-le...@lists.lysator.liu.se