Showing posts with label gnu. Show all posts
Showing posts with label gnu. Show all posts

Thursday, January 12, 2012

GnuPG MPILIB

Looks like the linux kernel 3.3 will have GnuPG MPILIB within.

Multiprecision maths library (MPILIB) [N/m/y/?] (NEW) ?

CONFIG_MPILIB:

Multiprecision maths library from GnuPG.
It is used to implement RSA digital signature verification,
which is used by IMA/EVM digital signature extension.

Symbol: MPILIB [=n]
Type  : tristate
Prompt: Multiprecision maths library
  Defined at lib/Kconfig:288
  Location:
    -> Library routines
  Selected by: DIGSIG [=n] && KEYS [=y]


In-kernel signature checker (DIGSIG) [N/m/y/?] (NEW) ?

CONFIG_DIGSIG:

Digital signature verification. Currently only RSA is supported.
Implementation is done using GnuPG MPI library

Symbol: DIGSIG [=n]
Type  : tristate
Prompt: In-kernel signature checker
  Defined at lib/Kconfig:305
  Depends on: KEYS [=y]
  Location:
    -> Library routines
  Selects: MPILIB [=m]
  Selected by: INTEGRITY_DIGSIG [=n] && INTEGRITY [=n] && KEYS [=y]

Tuesday, November 22, 2011

GCC 4.7.0: transactional memory

Eventually GCC 4.7.0 will have transactional memory, which has been
merged several days ago. Draft of still-in-progress design document can
be found here.

In short, (atomic) transaction is something similar to this:

    __transaction_atomic { x++; }
 
Any operation performed within the __transaction_atomic block will be atomic and
isolated from other transactions, operations within __transaction {} either be visible to other threads in its entirety or not at all.

Quote from lwn
Details on the specific implementation are scarce; it appears that, in the current patch set,
transactions will be implemented using a global lock. GCC developers debated for a bit over
whether this code was ready for merging or not. In the end, though, the possibility of being
the first to support an interesting new feature seemed to win out. Current plans are to
release 4.7.0 sometime around next April.

Refer to gcc.gnu.org (or gcc 4.7 svn repository) for details.

Tuesday, June 7, 2011

GNU C Family Extensions

Some time ago I met confusing C ternary operator usage

return timeout ?: 1;


It turned out to be a GNU "Conditionals with Omitted Operands

C extension. The list of "Extensions to the C Language Family" can be found here.

This page is worth reading. For example, getting
the address of a label defined in the current function (or a containing
function) with the unary operator `&&'. The value has type void *. This value
is a constant and can be used wherever a constant of that type is valid.
For example:
     void *ptr;
     /* ... */
     ptr = &&foo;
To use these values, you need to be able to jump to one. This is done with
the computed goto statement, goto *exp;.
For example,
     goto *ptr;