Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • 59d5a97
  • /
  • doc
  • /
  • crypto
  • /
  • OPENSSL_instrument_bus.pod
Raw File
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:4ed83e4950b7104c48908818b28b8162a546b277
directory badge Iframe embedding
swh:1:dir:5e9a7b2f755109b19d8346547fdf285360c78427
OPENSSL_instrument_bus.pod
=pod

=head1 NAME

OPENSSL_instrument_bus, OPENSSL_instrument_bus2 - instrument references to memory bus

=head1 SYNOPSIS

 #ifdef OPENSSL_CPUID_OBJ
 size_t OPENSSL_instrument_bus (int *vector,size_t num);
 size_t OPENSSL_instrument_bus2(int *vector,size_t num,size_t max);
 #endif

=head1 DESCRIPTION

It was empirically found that timings of references to primary memory
are subject to irregular, apparently non-deterministic variations. The
subroutines in question instrument these references for purposes of
gathering entropy for random number generator. In order to make it
bus-bound a 'flush cache line' instruction is used between probes. In
addition probes are added to B<vector> elements in atomic or
interlocked manner, which should contribute additional noise on
multi-processor systems. This also means that B<vector[num]> should be
zeroed upon invocation (if you want to retrieve actual probe values).

OPENSSL_instrument_bus performs B<num> probes and records the number of
oscillator cycles every probe took.

OPENSSL_instrument_bus2 on the other hand B<accumulates> consecutive
probes with the same value, i.e. in a way it records duration of
periods when probe values appeared deterministic. The subroutine
performs at most B<max> probes in attempt to fill the B<vector[num]>,
with B<max> value of 0 meaning "as many as it takes."

=head1 RETURN VALUE

Return value of 0 indicates that CPU is not capable of performing the
benchmark, either because oscillator counter or 'flush cache line' is
not available on current platform. For reference, on x86 'flush cache
line' was introduced with the SSE2 extensions.

Otherwise number of recorded values is returned.

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top