Re: charset parameter for https://www.lysator.liu.se/~nisse/nettle/nettle.html causing mojibake

2019-10-23 Thread Niels Möller
Daniel Kahn Gillmor writes: > i notice that https://www.lysator.liu.se/~nisse/nettle/nettle.html is > served with the HTTP header: > > Content-Type: text/html; charset=iso-8859-1 > > but it contains non-ASCII text -- your name "Niels Möller", but it is >

Re: Dead links to bindings

2019-10-05 Thread Niels Möller
! > Btw, I just noticed that the links to the Pike, PostgreSQL, and R6RS > Scheme bindings are dead. Pike is alive, I've updated the link. The Postgres and scheme bindings, I don't know, anyone else? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet

Re: [PATCH] cfb8: don't truncate output IV if input is shorter than block size

2019-10-01 Thread Niels Möller
am (#if:ed out, not sure if it's worth reviving). > > Indeed, thank you for the suggestion. I'm attaching updated patches. Pushed now, with a few additional fixes for the test. Thanks! /Niels Möller -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is s

Re: [PATCH] cfb8: don't truncate output IV if input is shorter than block size

2019-09-30 Thread Niels Möller
b8_*crypt, in several ways. And check they all give the same result. A bit like it's done in arcfour-test.c, or the test_cipher_stream (#if:ed out, not sure if it's worth reviving). What do you think? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email i

Re: Rust bindings

2019-09-26 Thread Niels Möller
x.html Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs mailing list nettle-bugs@lists.lysator.liu.se http://lists.lysator.liu.se/mailman/li

Re: [PATCH] Curve point decompression

2019-09-26 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: > Not sure in which order to do things. Maybe it will be best to first add > the square root routines, with tests, and then add functions for > converting between points and octet strings (and related utilities, if > needed). I've now

Re: ANNOUNCE: Nettle-3.5

2019-09-24 Thread Niels Möller
ing separate functions for aes128, aes192 and aes256. To enable that, it's best to have separate functions all the way. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government

Re: [PATCH] Curve point decompression

2019-09-24 Thread Niels Möller
would consider adding asserts for such conditions, to ensure that the library fails promptly and in a controlled fashion in case assumptions turn out to be wrong. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to who

Re: [PATCH v2 0/6] Add meta interface for MAC algorithms

2019-09-17 Thread Niels Möller
tle, but I doubt they have the resources to do a thorough investigation. If you know the patent holders, you could mail and ask them, or check if there's any general patent policy for 3GPP members. Reviewing any licensing terms they offer should be an easier task for FSF lawyers than a more op

Re: [PATCH v2 1/6] Start separating GOST 28147-89 from GOST R 34.11-94

2019-09-15 Thread Niels Möller
t file and move the declarations of gost28147_param_* over to gost28147-internal.h. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs mailin

Re: [PATCH v2 0/6] Add meta interface for MAC algorithms

2019-09-14 Thread Niels Möller
sh several messages with the same key using a sequence of ->update and ->digest calls. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-b

Re: [PATCH v2 1/6] Start separating GOST 28147-89 from GOST R 34.11-94

2019-09-14 Thread Niels Möller
rds, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs mailing list nettle-bugs@lists.lysator.liu.se http://lists.lysator.liu.se/mailman/listinfo/net

Re: [PATCH v2 3/6] gosthash94: switch to using MD_UPDATE() macro

2019-09-14 Thread Niels Möller
se I was guided by the findings of "git grep block". Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs mailing list nettle-bugs

Re: [PATCH v2 3/4] gcm: move block shifting function to block-internal.h

2019-09-04 Thread Niels Möller
dbarysh...@gmail.com writes: > From: Dmitry Eremin-Solenikov > > Move GCM's block shift function to block-internal.h. This concludes > moving of all Galois mul-by-2 to single header. I've merged patch 1-3 to the master-updates branch. Thanks! Regards, /Niels -- Niels Möller. P

Re: [PATCH v2 4/4] gcm: drop intermediate GCM_TABLE_BITS == 4 case

2019-09-04 Thread Niels Möller
and for ecc there are both constant tables, for ecc_mul_g, and run-time tables for ecc_mul_a. Is there any interest in improving support for low-end embedded devices? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government

Re: [PATCH 4/5] block modes: move Galois shifts to block-internal.h

2019-09-03 Thread Niels Möller
amp; 0x8080808080808080) >> 15)) > -void > +static inline void > _cmac128_block_mulx(union nettle_block16 *dst, > const union nettle_block16 *src) > { > - uint64_t carry = (src->u64[0] & 0x80) >> 7; &g

Re: [PATCH 3/5] block-internal: add block XORing functions

2019-09-03 Thread Niels Möller
) >for (j = 0; j < 8; j++, b <<= 1) > { > if (b & 0x80) > - gcm_gf_add(, , ); > + block16_xor3(, , ); This and few other calls below can be block16_xor rather than block16_xor3. Regards, /Niels -- Niels Möller. PGP-en

Re: Some .stamp files slipped into the tarball

2019-07-30 Thread Niels Möller
That should mean that as long as bar is more recent than foo.c, there's no need to remake bar, and no need to remake foo, no matter if foo happens to be out-of-date or non-existent. The stamp file is a workaround, and as you noticed, it's not perfect. Is there a better way? Regards, /Niels -- Nie

Re: [PATCH] cmac: add 64-bit mode CMAC

2019-07-22 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: > I've now merged this and the cmac_des3 patch onto a branch "cmac64". And now pushed to master, together with the documentation update. Thanks, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet ema

Re: Some .stamp files slipped into the tarball

2019-07-17 Thread Niels Möller
y with cp -a, which ensures that you won't attempt to rebuild *any* of the generated files in the tarball, including config.h.in and configure. Might also help a bit to reorder the files in the tarball, but I wouldn't recommend depending on that. Regards, /Niels -- Niels Möller. PGP-encrypted email is

Re: Rust bindings

2019-07-17 Thread Niels Möller
would be useful with some level of pgp-support in the Nettle library? Regarding the Rust bindings, what's the best place to point other Rust users? https://crates.io/crates/nettle, or https://sequoia-pgp.gitlab.io/nettle-rs/nettle/, or somewhere else? Regards, /Niels -- Niels Möller. PGP-encrypted ema

Re: Some .stamp files slipped into the tarball

2019-07-17 Thread Niels Möller
Some stamp files are included intentionally, to avoid precisely that type of problems. See the note on stamp-h.in in the autoconf manual for one well documented example: https://www.gnu.org/software/autoconf//manual/autoconf-2.64/html_node/Automatic-Remaking.html Regards, /Niels -- Niels

Re: nettle-meta interface for MACs

2019-07-17 Thread Niels Möller
s it common to use hmac, without context implying a fix key size ? Slightly related: HMAC is defined as allowing very long keys, by hashing the key in case it's larger than the block size (e.g., 512 bits for hmac-sha1 and hmac-sha256). That seems a bit obscure to me. Are there any applications or protoco

Re: [PATCH] cmac: add 64-bit mode CMAC

2019-07-10 Thread Niels Möller
FC4493 doesn't seem quite right. Is it NIST SP 800-38B, mentioned in a comment with the tests? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs

Re: [PATCH 1/6] Start separating GOST 28147-89 from GOST R 34.11-94

2019-07-08 Thread Niels Möller
nst uint32_t *in, uint32_t *out); Same here: if internal, shouldn't be in an installed header file. And "simple" looks a bit odd. Should the sbox argument be of type const gost28147_param * ? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Interne

Re: [PATCH] cmac: add 64-bit mode CMAC

2019-07-08 Thread Niels Möller
the implementation shared with cmac128? I think it would be nice to move it to a separate source file cmac64.c. Sharing the cmac.h header file is fine. BTW, I'm sorry for the duplicated effort on nettle_block16 w; I'm traveling and online only sporadically, so I gave it a try without being up to dat

Re: [PATCH 2/3] gcm: drop w field from nettle_block16

2019-07-08 Thread Niels Möller
le to rearrange it to use a different bit order without explicit bit reversal of the input. At least, not an easy change. I'm thinking of some shared macros or inline functions to abstract the left shift operations, say block16_mulx_be, block16_mulx_le. Regards, /Niels -- Niels Möller. PGP-encrypt

Re: [PATCH] nettle-types: drop w field from nettle_block16

2019-07-04 Thread Niels Möller
that part of the change has to wait. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs mailing list nettle-bugs@lists.lysator.liu.se http://lists.lysat

Re: [PATCH 2/4] cmac: add 64-bit mode CMAC

2019-07-02 Thread Niels Möller
didn't use uint64_t). Maybe one could do without this union and simply use uint64_t, but then one would need some casts to (uint8_t *). So a union may be clearer. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to whole

Re: [PATCH 1/4] Move MAC testing code to generic place from cmac-test

2019-07-02 Thread Niels Möller
hmac and umac tests, but that wasn't as easy as I hoped. For hmac, the variable key size doesn't fit the struct nettle_mac. For umac, key size is fixed, but one also has a nonce and nonce auto-increment. Regards, /Niels -- Niels Möller. PGP-encrypted email is prefe

Re: Add check for ECC at point 0

2019-07-02 Thread Niels Möller
Simo Sorce writes: > On Wed, 2019-05-15 at 10:48 -0400, Simo Sorce wrote: >> On Wed, 2019-05-15 at 11:42 +0200, Niels Möller wrote: >> > Simo Sorce writes: >> > >> > > Attached find patch that adds points checks to the ECDH test case. >> > >

Re: SIV-CMAC

2019-07-02 Thread Niels Möller
u? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs mailing list nettle-bugs@lists.lysator.liu.se http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs

Re: Changes after 3.5.1

2019-07-02 Thread Niels Möller
Can you resend links for the first two or thee changes, or resend latest patches? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs mailing l

ANNOUNCE: Nettle-3.5.1

2019-06-27 Thread Niels Möller
improvements contributed by Jay Foad. * The "example" program examples/eratosthenes.c has been deleted. * The contents of hash context structs, and the deprecated aes_ctx struct, have been reorganized, to enable later optimizations. -- Niels M

Re: [PATCH 1/3] build: allow overriding the debug flags

2019-06-26 Thread Niels Möller
en any related multiarch improvements in autoconf's default behavior recently. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs mailing list

Re: ANNOUNCE: Nettle-3.5

2019-06-26 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: > Nikos Mavrogiannopoulos writes: > >> The x86_64/sha_ni directory is not included in the distribution, and >> thus compilation fails when --enable-fat is provided. I update my >> previous patch to add `make distcheck` t

Re: [PATCH 2/3] build: add --disable-libdir-abi-detection

2019-06-26 Thread Niels Möller
mewhat unlikely to be used on the command line. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs mailing list nettle-bugs@lists.lysator.

Re: [PATCH 2/3] build: add --disable-libdir-abi-detection

2019-06-26 Thread Niels Möller
d also, please don't use the term "autotools" if you want to say anything specific; autotools is a very loose term refering to a couple of very different tools each with their own particular quirks). Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Inte

Re: [PATCH 2/3] build: add --disable-libdir-abi-detection

2019-06-26 Thread Niels Möller
tively if --prefix or --libdir were present on the command line, which is why I compare libdir to the default value instead. And I really don't understand why you'd prefer a nettle specific --disable-... argument over the GNU standard --libdir=/usr/lib/whatever. Regards, /Niels -- Niels Möller. P

Re: [PATCH 1/3] build: allow overriding the debug flags

2019-06-26 Thread Niels Möller
, perhaps to try out a modification of her own. If you have a packaging framework that runs configure for you, it's expected that package configuration needs to add a couple of explicit arguments to override the defaults. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid

Re: [PATCH 2/3] build: add --disable-libdir-abi-detection

2019-06-26 Thread Niels Möller
oo} have the same meaning in make (and this is quoted from the shell). A think it's an improvement to change ${} to $() here, for consistency with other nerby make references, but I take it you intend to do something more than an aesthetic change? Am I missing something? Regards, /Ni

Re: [PATCH 1/3] build: allow overriding the debug flags

2019-06-26 Thread Niels Möller
stency with other packages using autoconf. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs mailing list nettle-bugs@lists.lysator.liu.s

Re: ANNOUNCE: Nettle-3.5

2019-06-26 Thread Niels Möller
Alon Bar-Lev writes: > I sent three patches to cleanup our gentoo downstream patches, can you > please consider them for the release so we have zero patching? Not for this release, sorry. I'll send comments on the patches separately. Regards, /Niels -- Niels Möller. PGP-encrypted

Re: ANNOUNCE: Nettle-3.5

2019-06-26 Thread Niels Möller
--enable-fat happens to make it visible at compile time. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs mailing list nettle-bugs@lists.ly

nettle-3.5rc1

2019-06-15 Thread Niels Möller
EWS-worthy that I have missed, speak up. Or if there are some additional improvements that really ought to get into the 3.5 release. I aim to have the release happen in a week or two. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to

Re: [PATCH] Fix some typos in the documentation

2019-06-15 Thread Niels Möller
s text attachments is more robust. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs mailing list nettle-bugs@lists.lysator.liu.s

Re: curve448 branch

2019-06-06 Thread Niels Möller
0,0 +1,51 @@ +/* hmac-internal.h + + HMAC message authentication code (RFC-2104). + + Copyright (C) 2001, 2002, 2019 Niels Möller + + This file is part of GNU Nettle. + + GNU Nettle is free software: you can redistribute it and/or + modify it under the terms of either: + + * the GNU Lesse

Re: siv and cmac

2019-06-06 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: > I think the siv code could benefit from a funtion to create a cmac > digest in one step, without the update/digest split and the intermediate > buffer. That would be something like > > cmac128_message(const struct cmac128_key *key, con

Re: siv and cmac

2019-06-03 Thread Niels Möller
nal for now? For siv, we would need some variant of cmac_set_key function that takes only a cmac128_key argument, not a cmac128_ctx, and the new cmac128_message. These could be internal or public. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email

Re: Does SHA-1 switch to accelerated automatically?

2019-06-03 Thread Niels Möller
opment version (to be nettle-3.5) can use sha_ni instructions on x86_64, for both sha1 and sha256. There isn't yet any assembly code for ARMv8. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government survei

siv and cmac

2019-06-01 Thread Niels Möller
9b41e3b82b567abb68c1b7fc3b1e6b1a4ed87b26 Author: Niels Möller Date: 2019-06-01 10:30:29 +0200 New struct cmac128_key. diff --git a/ChangeLog b/ChangeLog index 53cdc41d..a7a4355f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2019-06-01 Niels Möller + + * cmac.h (struct cmac128_key): New struct

Re: Curve point decompression

2019-05-23 Thread Niels Möller
for the maintainers is, is this a > reasonable API to add to Hogweed? Is there interest in including it in > Hogweed if I were to take the time to turn it into a tidy patch? It could make sense. Do you have any concrete use cases? Regards, /Niels -- Niels Möller. PGP-encrypted email is

Re: Add check for ECC at point 0

2019-05-15 Thread Niels Möller
test_public_key ( > +"(P,0) with secp-192r1", &_nettle_secp_192r1, > +"6277101735386680763835789423207666416083908700390324961279", > + "0", 0); Any particular reason the tests are all for secp_192r1 ? Regards, /Niels -- Niels Möller.

Re: [PATCH 3/3] GOST curves generate larger overflows in mod arithmetics

2019-05-12 Thread Niels Möller
useful, you need to add random seeding, see ecc-mod-test.c for an example to how to do it, enabled by the NETTLE_TEST_SEED environment variable. Used like while NETTLE_TEST_SEED=0 ./testsuite/ecc-mod-test ; do : ; done Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Ke

Re: Release?

2019-05-12 Thread Niels Möller
viking), see https://codesearch.debian.net/search?q=md5-compat.h, so I think we should keep it around; it's very simple and testing is better than for des-compat.h. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesal

Release? (was: Re: curve448 branch)

2019-05-11 Thread Niels Möller
happy with the > way code looks in my tree. I've committed changes to move buffers last in the hash context structs. That should make it a bit easier, but probably still not so pretty. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to

Re: [PATCH 3/3] GOST curves generate larger overflows in mod arithmetics

2019-05-11 Thread Niels Möller
oint functions. Could consider doing these operations (or part of them) using indirection via some new function pointer in struct ecc_modulo. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale go

Re: [PATCH 3/3] GOST curves generate larger overflows in mod arithmetics

2019-05-11 Thread Niels Möller
after cnd_add_1. Unfortunately, "nearly always" isn't enough; it means that some inputs will result in a value of hi making the code branch differently, and that information then leaks through cache and/or timing. If it's likely to be exploitable, I can't say, but current ecc code is w

Re: [PATCH 3/3] GOST curves generate larger overflows in mod arithmetics

2019-05-11 Thread Niels Möller
nding on hi (except for asserts, since they always branch the same way in a non-crashing program). The adjustmenst can only do unconditional calls to functions like mpn_add_mul_1 and cnd_add_1. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is

Re: curve448 branch

2019-05-11 Thread Niels Möller
, or if I ought to focus on getting 3.5 out asap. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs mailing list nettle-bugs@lists.lysator.li

Re: Add check for ECC at point 0

2019-05-11 Thread Niels Möller
o add a test case to check that ecc_point_set rejects (0,0) ? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs mailing list

Re: SIV-CMAC

2019-05-11 Thread Niels Möller
ive approach: support for empty nonce, however that should behave, can be added later. Opinions? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-

Re: SIV-CMAC

2019-05-06 Thread Niels Möller
tal (but still allow it), and dropped some macros and unrelated changes (which would belong on a different branch). Please have a look, and say if I've messed up something. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale governm

Re: Intel CET protection

2019-04-27 Thread Niels Möller
6) > PROLOGUE(nettle_sha3_permute) > W64_ENTRY(1, 16) This placement between .text and the prologue depends on .pushsection / .popsection. I think it should be moved last, just like in the other files, either explicitly or by means of a divert in some of the included m4 files. Regard

Re: Intel CET protection

2019-04-27 Thread Niels Möller
ed on the earlier patches in the series, which I didn't want to apply right away. Old-fashioned patch -p1 could apply the patch, with "fuzz 2". So are there any other options to make the git patching tools a bit more tolerant or fuzzy? Regards, /Niels -- Niels Möller. PGP-encrypted email i

Re: Intel CET protection

2019-04-26 Thread Niels Möller
e symbolic names to compose the 0x03 value and for the > 0xc002 values, the rest are just label arithmetic. > > I will change in next submission. I see, I was hoping for something more similar to .section .note.GNU-stack,"",TYPE_PROGBITS I'm still curious as to what it loo

Re: Intel CET protection

2019-04-26 Thread Niels Möller
> C _aes_decrypt(unsigned rounds, const uint32_t *keys, > C const struct aes_table *T, > C size_t length, uint8_t *dst, > @@ -70,6 +70,7 @@ define(,<%rbp>) > .text > ALIGN(16) > PROLOGUE(_nettle_aes_decrypt) > +

Re: SIV-CMAC

2019-04-17 Thread Niels Möller
s. I > have kept the union Maybe it would be easier without using the CMAC macros. They're intended for convenience, so there's little point in using them where it doesn't bring any convenience. > The attached version should address the comments so far and also > changes cmac128_set_key t

Re: SIV-CMAC

2019-04-15 Thread Niels Möller
Nikos Mavrogiannopoulos writes: > On Sun, 2019-04-14 at 09:33 +0200, Niels Möller wrote: >> > +typedef int >> > +nettle_decrypt_message(void *ctx, >> > + size_t nlength, const uint8_t *nonce, >> > +

Re: [PATCH][v2] fat-arm.c: prefer getauxval() over /proc/cpuinfo parsing

2019-04-14 Thread Niels Möller
"Yuriy M. Kaminskiy" writes: > On 14.03.2019 08:41, Niels Möller wrote: >> "Yuriy M. Kaminskiy" writes: >> >>> When compiled for armv6+ and getauxval() is present (glibc 2.16+), >>> avoid slow and unreliable /proc/cpuinfo parsing. >

Re: SIV-CMAC

2019-04-14 Thread Niels Möller
; + unsigned skey_size = nc->key_size; > + > + assert(skey_size <= SIV_MAX_KEY_SIZE/2); > + memcpy(ctx->s2vk, key, skey_size); I think this function should do the underlying key setup also for the cipher instance used for s2v, not just store the key for late

Re: [PATCH] nettle-pbkdf2.c: change the initialization for salt

2019-04-12 Thread Niels Möller
e. So when I wrote this tool, always allocating a writable copy, and calling free unconditionally, seemed nice and easy, Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. __

Re: nettle-pbkdf2 Segmentation fault

2019-04-10 Thread Niels Möller
trlen(argv[0]); if (hex_salt) >>>> What kind of machine, operating system, and compiler are you using? >>>> Since the testsuite passes on the test systems (including x86_64 and >>> >>> I work on x86_64 and use gcc for compiler. A

Re: nettle-pbkdf2 Segmentation fault

2019-04-10 Thread Niels Möller
compiler are you using? Since the testsuite passes on the test systems (including x86_64 and cross-compile setup for arm and mips), I imagine it's something somewhat unusual. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet ema

Re: nettle-pbkdf2 Segmentation fault

2019-04-09 Thread Niels Möller
et a backtrace? (start "gdb nettle-pbkdf2", at the gdb prompt type "run -i 1 -l 16", if it crashes, type "bt" for backtrace). Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveilla

Re: [WIP] aes arm asm from libgcrypt

2019-03-24 Thread Niels Möller
ferent temporaries. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs mailing list nettle-bugs@lists.lysator.liu.se http://lists.lysator.li

Re: Implement XTS block cipher mode

2019-03-24 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: > Simo Sorce writes: > >> I am attaching all 3 patches anew as I also fixed the other issues you >> mentioned in a previous email. > > Thanks. I'm about to merge. I've run cross-compile+qemu tests also on > big-endian mips

Re: Implement XTS block cipher mode

2019-03-24 Thread Niels Möller
s_aes128_ctx} > +Holds state corresponding to the AES-128 block cipher. > +@end deftp > + > +@deftp {Context struct} {struct xts_aes256_ctx} > +Holds state corresponding to the AES-256 block cipher. > +@end deftp These structs were renamed from _ctx to _key, right? Regards, /Niel

Re: Implement XTS block cipher mode

2019-03-20 Thread Niels Möller
hould use __builtin_bswap64 when provided by gcc or its look-alikes. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs mailing list ne

Re: Implement XTS block cipher mode

2019-03-19 Thread Niels Möller
he buffer contains sensitive data (like the clear text for >> > inplace >> > + * encryption) */ >> > + if (length < XTS_BLOCK_SIZE) >> > +memxor(dst, dst, length); >> > +} Why memxor rather than memset? Regar

Re: Implement XTS block cipher mode

2019-03-19 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: > 3. Big-endian system, no __builtin_bswap64. Here we can either use the >current code, with byte accesses only. Or attempt to define byteswap >without builtins and follow 2. I'd lean towards using the current >code, unless

Re: Implement XTS block cipher mode

2019-03-19 Thread Niels Möller
back from memory to registers. That has been a significant optimization for both ctr mode and cbc decrypt. I haven't reviewed the new version of the patch yet, I hope to get to that in a day or two. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email i

Re: Implement XTS block cipher mode

2019-03-19 Thread Niels Möller
128 */ > +struct xts_aes128_ctx { > +struct aes128_ctx cipher; > +struct aes128_ctx tweak_cipher; > +}; Could consider renaming it to xts_aes128_key, somewhat analogous to struct eax_key and struct gcm_key. This represents message-independent data, and then the name xts_aes128_ctx

Re: [WIP] aes arm asm from libgcrypt

2019-03-17 Thread Niels Möller
ese .cfi_* pseudoops essential? I'm afraid I'm ignorant of the fine details here; I just see from the gas manual that they appear to be related to stack unwinding. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government

Re: Implement XTS block cipher mode

2019-03-15 Thread Niels Möller
READ/WRITE_UINT macros are adequate in most places where unaligned application data is read and written by C code. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs mailing list nettle-bugs@lists.lysator.liu.se http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs

Re: Implement XTS block cipher mode

2019-03-15 Thread Niels Möller
arguments are aligned. It would be preferable to load 64-bit values and use __builtin_bswap64 when needed and available (see ctr.c for a similar hack). But that's an independent improvement. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. In

Re: Implement XTS block cipher mode

2019-03-15 Thread Niels Möller
/* P -> PP */ > + XTSENC(enc_ctx, C, P); /* CC */ > + XTSXOR(C, T); /* CC -> C */ I think it would be clearer with encf being an explicit argument to the macros that need it (or maybe do it without the macros, if they expand to only a single call each). Regards,

Re: [WIP][PATCH][v2] Add fast constant-time ARM NEON ghash/gcm

2019-03-13 Thread Niels Möller
ason uses different bitorder, I hope it should be possible to do any needed bit reversal at key-setup only. > +.macro MUL64k3t4 rq rl rh ad bd k16 k32 k48 t0q t0l t0h t1q t1l t1h t2q t2l > t2h t3q t3l t3h Could you do these as m4 macros, like in the rest of the Nettle asm code? Regards,

Re: [PATCH] fat-arm.c: prefer getauxval() over /proc/cpuinfo parsing

2019-03-13 Thread Niels Möller
e docs (https://github.com/torvalds/linux/blob/master/arch/arm/include/uapi/asm/hwcap.h) I don't see anything corresponding to the "CPU arcitecture" line in /proc/cpuinfo. I'd be happier about getauxval if we could find a way to also get the arch version without reading /proc/cpuinfo.

Re: nettle-stdint.h

2019-02-01 Thread Niels Möller
t! And now the gnutls build in nettle's gitlab ci succeed. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs mailing list nettle-bug

gitlab-ci builds (was: Re: Nettle-3.4.1rc1, addressing PKCS#1 side-channel leaks)

2019-01-22 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: > I'm also considering adding a few more configurations to the ci, > including "CC=gcc -std=c89", CPPFLAGS=-DNODEBUG and --disable-assembler. Done (but with -DNDEBUG, not -DNODEBUG). Seems to pass. For the fat builds, it would make s

Re: sec_powm.c:293: GNU MP assertion failed: enb >= windowsize

2019-01-22 Thread Niels Möller
ni...@lysator.liu.se (Niels Möller) writes: > That said, I'm about to delete nettle-stdint.h, and require that the > compiler supplies a (as was discussed quite a while ago). I've now merged changes to do that to the master-updates branch. It breaks the gnutls build, see https://gitl

Re: [repost] [PATCH] Add --enable-fat support for arm neon chacha20

2019-01-19 Thread Niels Möller
e. If I delete them, this works fine using debian's cross compilers and qemu. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs maili

Re: [repost] [PATCH] Add --enable-fat support for arm neon chacha20

2019-01-19 Thread Niels Möller
"Yuriy M. Kaminskiy" writes: > [PATCH] Add --enable-fat support for arm neon chacha20 Thanks, applied! Just pushed to the master-updates branch. When the currrent ARM assembly was written, it was benchmarked on cortex a9 and a15. Regards, /Niels -- Niels Möller. PGP-en

Re: Nettle-3.4.1rc1, addressing PKCS#1 side-channel leaks

2019-01-13 Thread Niels Möller
Jeffrey Walton writes: > My bad, I was speaking to the proposed -DNODEBUG macro presented earlier: Sorry for that typo; I intended to use the standard assert.h facility, i.e., -DNDEBUG. Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet em

Re: Nettle-3.4.1rc1, addressing PKCS#1 side-channel leaks

2019-01-12 Thread Niels Möller
ug effects, one may well want that extra correctness assurance also when using the installed program in a "release" build). Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance.

Re: Nettle-3.4.1rc1, addressing PKCS#1 side-channel leaks

2019-01-12 Thread Niels Möller
remaining complaints on eccdata.c. I'm also considering adding a few more configurations to the ci, including "CC=gcc -std=c89", CPPFLAGS=-DNODEBUG and --disable-assembler. Anything I have to keep in mind (e.g., limits on builder resources?) Regards, /Niels -- Niels Möller. PGP-encrypted

Re: sec_powm.c:293: GNU MP assertion failed: enb >= windowsize

2019-01-07 Thread Niels Möller
ler supplies a (as was discussed quite a while ago). Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs mailing list nettle-b

Re: sec_powm.c:293: GNU MP assertion failed: enb >= windowsize

2019-01-06 Thread Niels Möller
elease fixing these problems? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs mailing list nettle-bugs@lists.lysator.liu.se http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs

Re: sec_powm.c:293: GNU MP assertion failed: enb >= windowsize

2018-12-30 Thread Niels Möller
ng to some memory overwrite. Try running the test program under valgrind and/or asan? Regards, /Niels -- Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677. Internet email is subject to wholesale government surveillance. ___ nettle-bugs maili

<    2   3   4   5   6   7   8   9   10   11   >