source: EcnlProtoTool/trunk/openssl-1.1.0e/crypto/bn/bn_depr.c@ 331

Last change on this file since 331 was 331, checked in by coas-nagasima, 6 years ago

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-csrc
File size: 1.9 KB
Line 
1/*
2 * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the OpenSSL license (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10/*
11 * Support for deprecated functions goes here - static linkage will only
12 * slurp this code if applications are using them directly.
13 */
14
15#include <openssl/opensslconf.h>
16#if OPENSSL_API_COMPAT >= 0x00908000L
17NON_EMPTY_TRANSLATION_UNIT
18#else
19
20# include <stdio.h>
21# include <time.h>
22# include "internal/cryptlib.h"
23# include "bn_lcl.h"
24
25BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,
26 const BIGNUM *add, const BIGNUM *rem,
27 void (*callback) (int, int, void *), void *cb_arg)
28{
29 BN_GENCB cb;
30 BIGNUM *rnd = NULL;
31
32 BN_GENCB_set_old(&cb, callback, cb_arg);
33
34 if (ret == NULL) {
35 if ((rnd = BN_new()) == NULL)
36 goto err;
37 } else
38 rnd = ret;
39 if (!BN_generate_prime_ex(rnd, bits, safe, add, rem, &cb))
40 goto err;
41
42 /* we have a prime :-) */
43 return ret;
44 err:
45 BN_free(rnd);
46 return NULL;
47}
48
49int BN_is_prime(const BIGNUM *a, int checks,
50 void (*callback) (int, int, void *), BN_CTX *ctx_passed,
51 void *cb_arg)
52{
53 BN_GENCB cb;
54 BN_GENCB_set_old(&cb, callback, cb_arg);
55 return BN_is_prime_ex(a, checks, ctx_passed, &cb);
56}
57
58int BN_is_prime_fasttest(const BIGNUM *a, int checks,
59 void (*callback) (int, int, void *),
60 BN_CTX *ctx_passed, void *cb_arg,
61 int do_trial_division)
62{
63 BN_GENCB cb;
64 BN_GENCB_set_old(&cb, callback, cb_arg);
65 return BN_is_prime_fasttest_ex(a, checks, ctx_passed,
66 do_trial_division, &cb);
67}
68#endif
Note: See TracBrowser for help on using the repository browser.