Deprecate the flags that switch off constant time
[openssl.git] / test / rsa_test.c
index 2bc21b045a85ac6fd5c40d353c1b15c387ad03ef..7d06394c6c6d7713228ec5348f6b0d92dca961de 100644 (file)
@@ -1,3 +1,12 @@
+/*
+ * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the OpenSSL license (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
 /* test vectors from p1ovect1.txt */
 
 #include <stdio.h>
@@ -232,9 +241,9 @@ int main(int argc, char *argv[])
 
     plen = sizeof(ptext_ex) - 1;
 
-    for (v = 0; v < 6; v++) {
+    for (v = 0; v < 3; v++) {
         key = RSA_new();
-        switch (v % 3) {
+        switch (v) {
         case 0:
             clen = key1(key, ctext_ex);
             break;
@@ -245,8 +254,6 @@ int main(int argc, char *argv[])
             clen = key3(key, ctext_ex);
             break;
         }
-        if (v / 3 >= 1)
-            RSA_set_flags(key, RSA_FLAG_NO_CONSTTIME);
 
         num = RSA_public_encrypt(plen, ptext_ex, ctext, key,
                                  RSA_PKCS1_PADDING);