Re: [PowerPC] GCM optimization

2020-11-27 Thread Maamoun TK
I made a pull request in the repository.

regards,
Mamone

On Thu, Nov 26, 2020 at 11:41 PM Niels Möller  wrote:

> Maamoun TK  writes:
>
> > To suppress these warnings we need to declare a prototype for
> > _nettle_gcm_init_key() and _nettle_gcm_hash() if
> "HAVE_NATIVE_gcm_init_key"
> > and "HAVE_NATIVE_gcm_hash" are defined respectively.
>
> Could be fixed in the new gcm-internal.h file. (I don't quite like that
> it needs any ifdefs around the declarations; the reason I had to add
> that was that I'd like to have the definitions be static in the case
> that it's all defined in C, and then it conflicts with non-static
> declarations in this file).
>
> > Also, I think an error will pop up in x86_64 build if gcm_hash8 is
> enabled,
> > we can fix this error by replacing the line 156 "#define gcm_hash
> > _nettle_gcm_hash8" with "#define _nettle_gcm_hash _nettle_gcm_hash8"
>
> You're right, it's broken on x86_64.
>
> > Let me know if you want me to make a pull request for these changes.
>
> If you can help out with that, that's much appreciated.
>
> 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: [PowerPC] GCM optimization

2020-11-27 Thread Niels Möller
Maamoun TK  writes:

> I made a pull request in the repository.

Merged, thanks! I wonder if gcm-internal.h can be cut down a bit, to 

  /* Functions available only in some configurations */
  void
  _nettle_gcm_init_key (union nettle_block16 *table);
  
  void
  _nettle_gcm_hash(const struct gcm_key *key, union nettle_block16 *x,
   size_t length, const uint8_t *data);
  
  #if HAVE_NATIVE_fat_gcm_init_key
  void
  _nettle_gcm_init_key_c (union nettle_block16 *table);
  #endif
  
  #if HAVE_NATIVE_fat_gcm_hash
  void
  _nettle_gcm_hash_c (const struct gcm_key *key, union nettle_block16 *x,
  size_t length, const uint8_t *data);
  #endif

(it's only the _c-functions that are static in some configurations, and
need ifdefs). I've tested on gcc112, configurations
--enable-power-crypto-ext, --enable-fat, and --disable-assembly, and I
see no warnings or errors.

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: [PowerPC] GCM optimization

2020-11-27 Thread Maamoun TK
On Fri, Nov 27, 2020 at 8:13 PM Niels Möller  wrote:

> I wonder if gcm-internal.h can be cut down a bit, to
>
>   /* Functions available only in some configurations */
>   void
>   _nettle_gcm_init_key (union nettle_block16 *table);
>
>   void
>   _nettle_gcm_hash(const struct gcm_key *key, union nettle_block16 *x,
>size_t length, const uint8_t *data);


But if HAVE_NATIVE_gcm_init_key and HAVE_NATIVE_gcm_hash are not defined,
there are no definitions for _nettle_gcm_init_key() and _nettle_gcm_hash()
respectively. Maybe it doesn't yield a warning or error because it's ok for
the compiler to have a prototype declaration without function definition.
___
nettle-bugs mailing list
nettle-bugs@lists.lysator.liu.se
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs