/*
- * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
*
- * Licensed under the OpenSSL license (the "License"). You may not use
+ * Licensed under the Apache License 2.0 (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
*/
+/*
+ * RC5 low level APIs are deprecated for public use, but still ok for internal
+ * use.
+ */
+#include "internal/deprecated.h"
+
#include <string.h>
-#include "../e_os.h"
+#include "internal/nelem.h"
#include "testutil.h"
#ifndef OPENSSL_NO_RC5
RC5_32_KEY key;
unsigned char buf[8], buf2[8];
- RC5_32_set_key(&key, 16, &RC5key[n][0], 12);
+ if (!TEST_true(RC5_32_set_key(&key, 16, &RC5key[n][0], 12)))
+ return 0;
RC5_32_ecb_encrypt(&RC5plain[n][0], buf, &key, RC5_ENCRYPT);
if (!TEST_mem_eq(&RC5cipher[n][0], sizeof(RC5cipher[0]), buf, sizeof(buf)))
i = rc5_cbc_rounds[n];
if (i >= 8) {
- RC5_32_set_key(&key, rc5_cbc_key[n][0], &rc5_cbc_key[n][1], i);
+ if (!TEST_true(RC5_32_set_key(&key, rc5_cbc_key[n][0],
+ &rc5_cbc_key[n][1], i)))
+ return 0;
memcpy(ivb, &rc5_cbc_iv[n][0], 8);
RC5_32_cbc_encrypt(&rc5_cbc_plain[n][0], buf, 8,