Hello,
I've made a new Merge Request in the nettle gitlab repo to provide
RSA-OAEP encryption and decryption:
https://git.lysator.liu.se/nettle/nettle/-/merge_requests/20
It adds 2 new functions:
int
pkcs1_oaep_encrypt (size_t key_size,
void *random_ctx, nettle_random_func *random,
size_t hlen,
size_t label_length, const uint8_t *label,
size_t message_length, const uint8_t *message,
mpz_t m);
int
pkcs1_oaep_decrypt (size_t key_size,
const …
[View More]mpz_t m,
size_t hlen,
size_t label_length, const uint8_t *label,
size_t *length, uint8_t *message);
The parameter hlen is the output length of the SHA function used for
masking data:
- SHA1_DIGEST_SIZE
- SHA256_DIGEST_SIZE
- SHA384_DIGEST_SIZE
- SHA512_DIGEST_SIZE
Is it possible to get feedback for this MR and eventually push it to the
master branch?
Thanks in advance
/Nicolas
[View Less]
I'm looking at implementing elliptic curve point compression a la SEC1
(admittedly, mostly to reduce the number of "feature not supported" code
paths in a library, but it seems like a somewhat useful ability).
Nettle/Hogweed already implements it internally for curve25519, but I want
to implement it for the "secp" curves as well.
Point compression is easy enough, but point decompression requires some
curve math, potentially dependent on the specific curve, and some of it is
redundant …
[View More]with what's already done in ecc_point_set(). So I was thinking
about moving this functionality into Hogweed as a function along the lines
of ecc_point_set_compressed(), which would take, instead of a y-coordinate,
an int containing the sign/parity of the y-coordinate.
So my question for the list and 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?
[View Less]
I made a merge request for optimizing AES modes on s390x architecture, the
patch implements the optimized cores using cipher instructions that have
been added to s390x arch in message security assist extensions. The patch
uses the following functions:
KM-AES-128 (ECB-AES128)
KM-AES-192 (ECB-AES192)
KM-AES-256 (ECB-AES256)
KMC-AES-128 (CBC-AES128)
KMC-AES-192 (CBC-AES192)
KMC-AES-256 (CBC-AES256)
KMAC-AES-128 (CCM-AES128, CMAC-AES128)
KMAC-AES-192 (CCM-AES192)
KMAC-AES-256 (CCM-AES256, CMAC-…
[View More]AES256)
KMF-AES-128 (CFB-AES128, CFB8-AES128)
KMF-AES-192 (CFB-AES192, CFB8-AES192)
KMF-AES-256 (CFB-AES256, CFB8-AES256)
KM-XTS-AES-128 (XTS-AES128)
KM-XTS-AES-256 (XTS-AES256)
KIMD-GHASH (GHASH)
KMCTR-AES-128, KMA-GCM-AES-128 (CTR-AES128)
KMCTR-AES-192, KMA-GCM-AES-192 (CTR-AES192)
KMCTR-AES-256, KMA-GCM-AES-256 (CTR-AES256)
KMA-GCM-AES-128 (GCM-AES128)
KMA-GCM-AES-192 (GCM-AES192)
KMA-GCM-AES-256 (GCM-AES256)
The merge request has also a benchmark that measures the speed of optimized
cores on s390x arch.
I can't set up gitlab CI for automatic testing on s390x arch because qemu
hasn't implemented cipher functions for this arch. However, there is an
easy way to test the patch manually by requesting a free account on the
LinuxONE Community
Cloud, both short-term and long-term access are available.
https://linuxone.cloud.marist.edu/#/register?flag=VM
regards,
Mamone
[View Less]
Hello mailing list,
I am a student at Brno University of Technology at Faculty of Information
Technology and intern at Red Hat Crypto team.
My current project is the implementation of HPKE draft [0]. The first goal
is to implement mode_base.
Example usage for the project is the encrypted hello message in TLS [1].
Do you have interest in merging the code after completion?
[0] https://tools.ietf.org/html/draft-irtf-cfrg-hpke-07
[1] https://gitlab.com/gnutls/gnutls/-/issues/595
Regards
Norbert Pócs
Hello,
I've added a merge request to implement AES key wrap and unwrap in
Nettle [1].
The MR is not complete, because the tests haven't been pushed yet and
the documentation is missing, but if the new functionality is welcome to
Nettle, I'd rather have some feedback on the code first, to make sure it
respects the project guidelines.
I can add tests based on the tests vectors in the RFC [2], but I'm not
sure how the test suites are build, should I need to create test_wrap
functions like …
[View More]in aes-test.c or something else?
Thanks in advance for your help!
/Nicolas
[1] https://tools.ietf.org/html/rfc3394
[2] https://tools.ietf.org/html/rfc3394#section-4
[View Less]
Hi Everyone,
I bumped to Nettle 3.7. The build is resulting in:
gcc -I. -I/export/home/jwalton/tmp/ok2delete/include -DNDEBUG
-DHAVE_CONFIG_H -g2 -O2 -m64 -march=native -fPIC -pthread -ggdb3 -Wall
-W -Wno-sign-compare -Wmissing-prototypes -Wmissing-declarations
-Wstrict-prototypes -Wpointer-arith -Wbad-function-cast
-Wnested-externs -fPIC -MT sha256-compress-2.o -MD -MP -MF
sha256-compress-2.o.d -c sha256-compress-2.s
gcc -I. -I/export/home/jwalton/tmp/ok2delete/include -DNDEBUG
-…
[View More]DHAVE_CONFIG_H -g2 -O2 -m64 -march=native -fPIC -pthread -ggdb3 -Wall
-W -Wno-sign-compare -Wmissing-prototypes -Wmissing-declarations
-Wstrict-prototypes -Wpointer-arith -Wbad-function-cast
-Wnested-externs -fPIC -MT sexp.o -MD -MP -MF sexp.o.d -c sexp.c \
&& true
sha256-compress-2.ssha1-compress-2.s: Assembler messages:
sha1-compress-2.s:73: Error: : no such instruction: `sha1rnds4
$0,%xmm5,%xmm4'Assembler messages:
sha256-compress-2.s:87
: Error: no such instruction: `sha256rnds2 %xmm5,%xmm6'
sha1-compress-2.s:78sha256-compress-2.s: Error: no such instruction:
`sha1nexte %xmm1,%xmm6':89
: Error: no such instruction: `sha256rnds2 %xmm6,%xmm5'sha1-compress-2.s:80
: Error: no such instruction: `sha1rnds4 $0,%xmm6,%xmm4'
sha256-compress-2.ssha1-compress-2.s:96:81: Error: : Error: no such
instruction: `sha1msg1 %xmm1,%xmm0'no such instruction: `sha256rnds2
%xmm5,%xmm6'
sha1-compress-2.s:86sha256-compress-2.s: Error: :98no such
instruction: `sha1nexte %xmm2,%xmm5'
: Error: sha1-compress-2.s:88: no such instruction: `sha256rnds2
%xmm6,%xmm5'Error:
sha256-compress-2.sno such instruction: `sha1rnds4 $0,%xmm5,%xmm4':99
: Error: sha1-compress-2.sno such instruction: `sha256msg1 %xmm2,%xmm1'
:89: Error: no such instruction: `sha1msg1 %xmm2,%xmm1'
sha256-compress-2.s:106: Error: no such instruction: `sha256rnds2 %xmm5,%xmm6'
sha1-compress-2.s:96sha256-compress-2.s: Error: no such instruction:
`sha1nexte %xmm3,%xmm6'
:108sha1-compress-2.s:98: Error: no such instruction: `sha256rnds2 %xmm6,%xmm5':
Error: no such instruction: `sha1msg2 %xmm3,%xmm0'
sha256-compress-2.ssha1-compress-2.s:109:99: : Error: Error: no such
instruction: `sha1rnds4 $0,%xmm6,%xmm4'no such instruction:
`sha256msg1 %xmm3,%xmm2'
sha256-compress-2.s:117: Error: no such instruction: `sha256rnds2 %xmm5,%xmm6'
sha256-compress-2.s:119: Error: no such instruction: `sha256rnds2 %xmm6,%xmm5'
sha256-compress-2.s:123: Error: no such instruction: `sha256msg2 %xmm4,%xmm1'
sha256-compress-2.s:124: sha1-compress-2.sError: no such instruction:
`sha256msg1 %xmm4,%xmm3'
:100: Error: sha256-compress-2.sno such instruction: `sha1msg1 %xmm3,%xmm2'
:129: Error: no such instruction: `sha256rnds2 %xmm5,%xmm6'
sha1-compress-2.s:104: Error: no such instruction: `sha1nexte
%xmm0,%xmm5'sha256-compress-2.s:131: Error:
no such instruction: `sha256rnds2 %xmm6,%xmm5'
sha1-compress-2.s:106sha256-compress-2.s: :135: Error: Error: no such
instruction: `sha1msg2 %xmm0,%xmm1'no such instruction: `sha256msg2
%xmm1,%xmm2'
sha256-compress-2.ssha1-compress-2.s:107:136: : Error: no such
instruction: `sha256msg1 %xmm1,%xmm4'
Error: no such instruction: `sha1rnds4 $0,%xmm5,%xmm4'sha256-compress-2.s
:141: sha1-compress-2.sError: no such instruction: `sha256rnds2 %xmm5,%xmm6'
:108: sha256-compress-2.sError: no such instruction: `sha1msg1 %xmm0,%xmm3':143:
Error: no such instruction: `sha256rnds2 %xmm6,%xmm5'
sha1-compress-2.s:113: Error: sha256-compress-2.s:147: Error: no such
instruction: `sha1nexte %xmm1,%xmm6'no such instruction: `sha256msg2
%xmm2,%xmm3'
sha256-compress-2.ssha1-compress-2.s:148:115: Error: : no such
instruction: `sha256msg1 %xmm2,%xmm1'
Error: sha256-compress-2.sno such instruction: `sha1msg2 %xmm1,%xmm2':153:
Error: no such instruction: `sha256rnds2 %xmm5,%xmm6'
sha256-compress-2.ssha1-compress-2.s:155: Error: :116: no such
instruction: `sha256rnds2 %xmm6,%xmm5'
Error: no such instruction: `sha1rnds4 $1,%xmm6,%xmm4'
sha1-compress-2.s:117: Error: sha256-compress-2.sno such instruction:
`sha1msg1 %xmm1,%xmm0':159: Error:
no such instruction: `sha256msg2 %xmm3,%xmm4'
sha256-compress-2.s:160sha1-compress-2.s: Error: no such instruction:
`sha256msg1 %xmm3,%xmm2'
:121: Error: no such instruction: `sha1nexte %xmm2,%xmm5'sha256-compress-2.s
:165: Error: no such instruction: `sha256rnds2 %xmm5,%xmm6'
sha1-compress-2.ssha256-compress-2.s:123: Error: no such instruction:
`sha1msg2 %xmm2,%xmm3'
sha1-compress-2.s:167: Error: no such instruction: `sha256rnds2 %xmm6,%xmm5':124
: Error: no such instruction: `sha1rnds4 $1,%xmm5,%xmm4'
sha256-compress-2.ssha1-compress-2.s:125:171: : Error: no such
instruction: `sha256msg2 %xmm4,%xmm1'Error: no such instruction:
`sha1msg1 %xmm2,%xmm1'
sha256-compress-2.s:172: Error: sha1-compress-2.s:129no such
instruction: `sha256msg1 %xmm4,%xmm3'
: Error: no such instruction: `sha1nexte %xmm3,%xmm6'sha256-compress-2.s
:177: sha1-compress-2.sError: no such instruction: `sha256rnds2 %xmm5,%xmm6'
:131: Error: sha256-compress-2.sno such instruction: `sha1msg2 %xmm3,%xmm0':179
: Error: no such instruction: `sha256rnds2 %xmm6,%xmm5'sha1-compress-2.s
:132: Error: no such instruction: `sha1rnds4 $1,%xmm6,%xmm4'
sha256-compress-2.s:183: Error: sha1-compress-2.s:133no such
instruction: `sha256msg2 %xmm1,%xmm2'
: sha256-compress-2.sError: :184no such instruction: `sha1msg1 %xmm3,%xmm2'
: Error: no such instruction: `sha256msg1 %xmm1,%xmm4'
sha1-compress-2.s:137: Error: no such instruction: `sha1nexte %xmm0,%xmm5'
sha1-compress-2.s:139: sha256-compress-2.sError: no such instruction:
`sha1msg2 %xmm0,%xmm1':189:
Error: no such instruction: `sha256rnds2 %xmm5,%xmm6'
sha1-compress-2.s:140sha256-compress-2.s:191: : Error: no such
instruction: `sha256rnds2 %xmm6,%xmm5'Error: no such instruction:
`sha1rnds4 $1,%xmm5,%xmm4'
sha1-compress-2.ssha256-compress-2.s:141: :195: Error: Error: no such
instruction: `sha1msg1 %xmm0,%xmm3'no such instruction: `sha256msg2
%xmm2,%xmm3'
sha256-compress-2.s:196sha1-compress-2.s:145: : Error: no such
instruction: `sha256msg1 %xmm2,%xmm1'
Error: no such instruction: `sha1nexte %xmm1,%xmm6'
sha256-compress-2.s:201: Error: no such instruction: `sha256rnds2
%xmm5,%xmm6'sha1-compress-2.s:147
: Error: sha256-compress-2.s:203: Error: no such instruction:
`sha1msg2 %xmm1,%xmm2'no such instruction: `sha256rnds2 %xmm6,%xmm5'
sha256-compress-2.ssha1-compress-2.s:148:207: : Error: Error: no such
instruction: `sha256msg2 %xmm3,%xmm4'
sha256-compress-2.s:208: Error: no such instruction: `sha256msg1 %xmm3,%xmm2'
sha256-compress-2.s:213: Error: no such instruction: `sha256rnds2 %xmm5,%xmm6'
sha256-compress-2.s:215: Error: no such instruction: `sha256rnds2 %xmm6,%xmm5'
sha256-compress-2.s:219: Error: no such instruction: `sha256msg2 %xmm4,%xmm1'
sha256-compress-2.s:220: Error: no such instruction: `sha256msg1 %xmm4,%xmm3'
sha256-compress-2.s:225: Error: no such instruction: `sha256rnds2 %xmm5,%xmm6'
sha256-compress-2.s:227: Error: no such instruction: `sha256rnds2 %xmm6,%xmm5'
sha256-compress-2.s:231: Error: no such instruction: `sha256msg2 %xmm1,%xmm2'
sha256-compress-2.s:232: Error: no such instruction: `sha256msg1 %xmm1,%xmm4'
sha256-compress-2.s:237: Error: no such instruction: `sha256rnds2 %xmm5,%xmm6'
sha256-compress-2.s:239: Error: no such instruction: `sha256rnds2 %xmm6,%xmm5'
sha256-compress-2.s:243: Error: no such instruction: `sha256msg2 %xmm2,%xmm3'
sha256-compress-2.s:247: Error: no such instruction: `sha256rnds2 %xmm5,%xmm6'
sha256-compress-2.s:249: Error: no such instruction: `sha256rnds2 %xmm6,%xmm5'
sha256-compress-2.s:253: Error: no such instruction: `sha256msg2 %xmm3,%xmm4'
sha256-compress-2.s:257: Error: no such instruction: `sha256rnds2 %xmm5,%xmm6'
sha256-compress-2.s:259: Error: no such instruction: `sha256rnds2 %xmm6,%xmm5'
no such instruction: `sha1rnds4 $1,%xmm6,%xmm4'
sha1-compress-2.s:149: Error: no such instruction: `sha1msg1 %xmm1,%xmm0'
sha1-compress-2.s:154: Error: no such instruction: `sha1nexte %xmm2,%xmm5'
sha1-compress-2.s:156: Error: no such instruction: `sha1msg2 %xmm2,%xmm3'
sha1-compress-2.s:157: Error: no such instruction: `sha1rnds4 $2,%xmm5,%xmm4'
sha1-compress-2.s:158: Error: no such instruction: `sha1msg1 %xmm2,%xmm1'
sha1-compress-2.s:162: Error: no such instruction: `sha1nexte %xmm3,%xmm6'
sha1-compress-2.s:164: Error: no such instruction: `sha1msg2 %xmm3,%xmm0'
sha1-compress-2.s:165: Error: no such instruction: `sha1rnds4 $2,%xmm6,%xmm4'
sha1-compress-2.s:166: Error: no such instruction: `sha1msg1 %xmm3,%xmm2'
sha1-compress-2.s:170: Error: no such instruction: `sha1nexte %xmm0,%xmm5'
sha1-compress-2.s:172: Error: no such instruction: `sha1msg2 %xmm0,%xmm1'
sha1-compress-2.s:173: Error: no such instruction: `sha1rnds4 $2,%xmm5,%xmm4'
sha1-compress-2.s:174: Error: no such instruction: `sha1msg1 %xmm0,%xmm3'
sha1-compress-2.s:178: Error: no such instruction: `sha1nexte %xmm1,%xmm6'
sha1-compress-2.s:180: Error: no such instruction: `sha1msg2 %xmm1,%xmm2'
sha1-compress-2.s:181: Error: no such instruction: `sha1rnds4 $2,%xmm6,%xmm4'
sha1-compress-2.s:182: Error: no such instruction: `sha1msg1 %xmm1,%xmm0'
sha1-compress-2.s:186: Error: no such instruction: `sha1nexte %xmm2,%xmm5'
sha1-compress-2.s:188: Error: no such instruction: `sha1msg2 %xmm2,%xmm3'
sha1-compress-2.s:189: Error: no such instruction: `sha1rnds4 $2,%xmm5,%xmm4'
sha1-compress-2.s:190: Error: no such instruction: `sha1msg1 %xmm2,%xmm1'
sha1-compress-2.s:195: Error: no such instruction: `sha1nexte %xmm3,%xmm6'
sha1-compress-2.s:197: Error: no such instruction: `sha1msg2 %xmm3,%xmm0'
sha1-compress-2.s:198: Error: no such instruction: `sha1rnds4 $3,%xmm6,%xmm4'
sha1-compress-2.s:199: Error: no such instruction: `sha1msg1 %xmm3,%xmm2'
sha1-compress-2.s:203: Error: no such instruction: `sha1nexte %xmm0,%xmm5'
sha1-compress-2.s:205: Error: no such instruction: `sha1msg2 %xmm0,%xmm1'
sha1-compress-2.s:206: Error: no such instruction: `sha1rnds4 $3,%xmm5,%xmm4'
sha1-compress-2.s:207: Error: no such instruction: `sha1msg1 %xmm0,%xmm3'
sha1-compress-2.s:211: Error: no such instruction: `sha1nexte %xmm1,%xmm6'
sha1-compress-2.s:213: Error: no such instruction: `sha1msg2 %xmm1,%xmm2'
sha1-compress-2.s:214: Error: no such instruction: `sha1rnds4 $3,%xmm6,%xmm4'
sha1-compress-2.s:217: Error: no such instruction: `sha1nexte %xmm2,%xmm5'
sha1-compress-2.s:219: Error: no such instruction: `sha1msg2 %xmm2,%xmm3'
sha1-compress-2.s:220: Error: no such instruction: `sha1rnds4 $3,%xmm5,%xmm4'
sha1-compress-2.s:222: Error: no such instruction: `sha1nexte %xmm3,%xmm6'
sha1-compress-2.s:224: Error: no such instruction: `sha1rnds4 $3,%xmm6,%xmm4'
sha1-compress-2.s:226: Error: no such instruction: `sha1nexte %xmm8,%xmm5'
gmake[1]: *** [sha1-compress-2.o] Error 1
gmake[1]: *** Waiting for unfinished jobs....
Jeff
[View Less]
Hi Everyone,
Here's the result of building Nettle 3.7.2 on Solaris 11.3, i86pc:
/bin/gcc -I. -I/opt/ssh/include -DNDEBUG -DHAVE_CONFIG_H -g2 -O2 -m64
-march=native -fPIC -pthread -ggdb3 -Wall -W -Wno-sign-compare
-Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes
-Wpointer-arith -Wbad-function-cast -Wnested-externs -fPIC -MT
sexp-format.o -MD -MP -MF sexp-format.o.d -c sexp-format.c \
&& true
sha256-compress-2.s: Assembler messages:
sha256-compress-2.s:87: Error: no such …
[View More]instruction: `sha256rnds2 %xmm5,%xmm6'
sha256-compress-2.s:89: Error: no such instruction: `sha256rnds2 %xmm6,%xmm5'
sha256-compress-2.s:96: Error: no such instruction: `sha256rnds2 %xmm5,%xmm6'
sha256-compress-2.s:98: Error: no such instruction: `sha256rnds2 %xmm6,%xmm5'
--enable-aes, --enable-sha, --enable-fat were _not_ provided to configure.
Attached is config.log.
Jeff
[View Less]
This is building Nettle 3.7.2 on a PowerMac with OS X 10.5:
/usr/bin/cc -I. -I/usr/local/include -DNDEBUG -DHAVE_CONFIG_H -g2 -O2
-mlong-double-64 -fno-common -maltivec -fPIC -pthread -ggdb3
-Wno-pointer-sign -Wall -W -Wmissing-prototypes
-Wmissing-declarations -Wstrict-prototypes -Wpointer-arith
-Wbad-function-cast -Wnested-externs -fPIC -MT xts-aes128.o -MD -MP
-MF xts-aes128.o.d -c xts-aes128.c \
&& true
xts.c: In function ‘xts_shift’:
xts.c:59: warning: integer constant …
[View More]is too large for ‘long’ type
xts.c:59: warning: integer constant is too large for ‘long’ type
xts.c:60: warning: integer constant is too large for ‘long’ type
xts.c:60: warning: integer constant is too large for ‘long’ type
xts.c:60: warning: integer constant is too large for ‘long’ type
On OS X 10.5, you have to use unsigned long long and the ull suffix.
Maybe you should add a configure test to see whether you need the ull suffix.
Jeff
[View Less]
It looks like Nettle is no longer building or installing hogweed on
some Apple platforms.
This is from a PowerMac G5 running OS X 10.5:
$ ls /usr/local/lib | grep -E 'gmp|nettle|hogweed'
libgmp.10.dylib
libgmp.a
libgmp.dylib
libgmp.la
libnettle.8.2.dylib
libnettle.8.3.dylib
libnettle.8.dylib
libnettle.a
libnettle.dylib
libpari-gmp.dylib
It is causing a failure in GnuTLS:
checking for NETTLE... yes
checking for HOGWEED... no
configure: error:
***
*** Libhogweed (nettle's companion …
[View More]library) 3.4.1 was not found.
Note that you must compile nettle with gmp support.
Jeff
[View Less]
Ludovic Courtès <ludo(a)gnu.org> writes:
> Are there plans to make a new 3.5 release including these fixes?
No, I don't plan any 3.5.x release.
> Alternatively, could you provide guidance as to which commits should be
> cherry-picked in 3.5 for downstream distros?
Look at the branch release-3.7-fixes
(https://git.lysator.liu.se/nettle/nettle/-/commits/release-3.7-fixes/).
The commits since 3.7.1 are the ones you need.
Changes to gostdsa and ed448 will not apply, since those …
[View More]curves didn't
exist in nettle-3.5. Changes to ed25519 might not apply cleanly, due to
refactoring when adding ed448.
> I’m asking because in Guix, the easiest way for us to deploy the fixes
> on the ‘master’ branch would be by “grafting” a new Nettle variant
> ABI-compatible with 3.5.1, which is the one packages currently depend on.
I still recommend upgrading to the latest version. There were an abi
break in 3.6 (so you'd need to recompile lots of guix packages), but no
incompatible changes to the (source level) api.
Regards,
/Niels
--
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.
[View Less]