xref: /minix3/crypto/external/bsd/openssl/dist/doc/crypto/RSA_blinding_on.pod (revision ebfedea0ce5bbe81e252ddf32d732e40fb633fae)
1*ebfedea0SLionel Sambuc=pod
2*ebfedea0SLionel Sambuc
3*ebfedea0SLionel Sambuc=head1 NAME
4*ebfedea0SLionel Sambuc
5*ebfedea0SLionel SambucRSA_blinding_on, RSA_blinding_off - protect the RSA operation from timing attacks
6*ebfedea0SLionel Sambuc
7*ebfedea0SLionel Sambuc=head1 SYNOPSIS
8*ebfedea0SLionel Sambuc
9*ebfedea0SLionel Sambuc #include <openssl/rsa.h>
10*ebfedea0SLionel Sambuc
11*ebfedea0SLionel Sambuc int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
12*ebfedea0SLionel Sambuc
13*ebfedea0SLionel Sambuc void RSA_blinding_off(RSA *rsa);
14*ebfedea0SLionel Sambuc
15*ebfedea0SLionel Sambuc=head1 DESCRIPTION
16*ebfedea0SLionel Sambuc
17*ebfedea0SLionel SambucRSA is vulnerable to timing attacks. In a setup where attackers can
18*ebfedea0SLionel Sambucmeasure the time of RSA decryption or signature operations, blinding
19*ebfedea0SLionel Sambucmust be used to protect the RSA operation from that attack.
20*ebfedea0SLionel Sambuc
21*ebfedea0SLionel SambucRSA_blinding_on() turns blinding on for key B<rsa> and generates a
22*ebfedea0SLionel Sambucrandom blinding factor. B<ctx> is B<NULL> or a pre-allocated and
23*ebfedea0SLionel Sambucinitialized B<BN_CTX>. The random number generator must be seeded
24*ebfedea0SLionel Sambucprior to calling RSA_blinding_on().
25*ebfedea0SLionel Sambuc
26*ebfedea0SLionel SambucRSA_blinding_off() turns blinding off and frees the memory used for
27*ebfedea0SLionel Sambucthe blinding factor.
28*ebfedea0SLionel Sambuc
29*ebfedea0SLionel Sambuc=head1 RETURN VALUES
30*ebfedea0SLionel Sambuc
31*ebfedea0SLionel SambucRSA_blinding_on() returns 1 on success, and 0 if an error occurred.
32*ebfedea0SLionel Sambuc
33*ebfedea0SLionel SambucRSA_blinding_off() returns no value.
34*ebfedea0SLionel Sambuc
35*ebfedea0SLionel Sambuc=head1 SEE ALSO
36*ebfedea0SLionel Sambuc
37*ebfedea0SLionel SambucL<rsa(3)|rsa(3)>, L<rand(3)|rand(3)>
38*ebfedea0SLionel Sambuc
39*ebfedea0SLionel Sambuc=head1 HISTORY
40*ebfedea0SLionel Sambuc
41*ebfedea0SLionel SambucRSA_blinding_on() and RSA_blinding_off() appeared in SSLeay 0.9.0.
42*ebfedea0SLionel Sambuc
43*ebfedea0SLionel Sambuc=cut
44