Module: wine
Branch: master
Commit: 149ee9bf3ba89069e0e579c8fb7caae45b61fd24
URL: http://source.winehq.org/git/wine.git/?a=commit;h=149ee9bf3ba89069e0e579c8f…
Author: Andrew Talbot <andrew.talbot(a)talbotville.com>
Date: Thu Jan 22 22:07:54 2009 +0000
rsaenh: Declare some functions static.
---
dlls/rsaenh/mpi.c | 278 ++++++++++++++++++++++++------------------------
dlls/rsaenh/tomcrypt.h | 29 -----
2 files changed, 139 insertions(+), 168 deletions(-)
diff --git a/dlls/rsaenh/mpi.c b/dlls/rsaenh/mpi.c
index 1a5affd..0eb91f3 100644
--- a/dlls/rsaenh/mpi.c
+++ b/dlls/rsaenh/mpi.c
@@ -232,6 +232,28 @@ mp_zero (mp_int * a)
memset (a->dp, 0, sizeof (mp_digit) * a->alloc);
}
+/* b = |a|
+ *
+ * Simple function copies the input and fixes the sign to positive
+ */
+static int
+mp_abs (const mp_int * a, mp_int * b)
+{
+ int res;
+
+ /* copy a to b */
+ if (a != b) {
+ if ((res = mp_copy (a, b)) != MP_OKAY) {
+ return res;
+ }
+ }
+
+ /* force the sign of b to positive */
+ b->sign = MP_ZPOS;
+
+ return MP_OKAY;
+}
+
/* computes the modular inverse via binary extended euclidean algorithm,
* that is c = 1/a mod b
*
@@ -793,7 +815,7 @@ static int fast_s_mp_sqr (const mp_int * a, mp_int * b)
* Simple algorithm which zeroes the int, grows it then just sets one bit
* as required.
*/
-int
+static int
mp_2expt (mp_int * a, int b)
{
int res;
@@ -815,28 +837,6 @@ mp_2expt (mp_int * a, int b)
return MP_OKAY;
}
-/* b = |a|
- *
- * Simple function copies the input and fixes the sign to positive
- */
-int
-mp_abs (const mp_int * a, mp_int * b)
-{
- int res;
-
- /* copy a to b */
- if (a != b) {
- if ((res = mp_copy (a, b)) != MP_OKAY) {
- return res;
- }
- }
-
- /* force the sign of b to positive */
- b->sign = MP_ZPOS;
-
- return MP_OKAY;
-}
-
/* high level addition (handles signs) */
int mp_add (mp_int * a, mp_int * b, mp_int * c)
{
@@ -870,7 +870,7 @@ int mp_add (mp_int * a, mp_int * b, mp_int * c)
/* single digit addition */
-int
+static int
mp_add_d (mp_int * a, mp_digit b, mp_int * c)
{
int res, ix, oldused;
@@ -1205,6 +1205,57 @@ mp_mod_2d (const mp_int * a, int b, mp_int * c)
return MP_OKAY;
}
+/* shift right a certain amount of digits */
+static void mp_rshd (mp_int * a, int b)
+{
+ int x;
+
+ /* if b <= 0 then ignore it */
+ if (b <= 0) {
+ return;
+ }
+
+ /* if b > used then simply zero it and return */
+ if (a->used <= b) {
+ mp_zero (a);
+ return;
+ }
+
+ {
+ register mp_digit *bottom, *top;
+
+ /* shift the digits down */
+
+ /* bottom */
+ bottom = a->dp;
+
+ /* top [offset into digits] */
+ top = a->dp + b;
+
+ /* this is implemented as a sliding window where
+ * the window is b-digits long and digits from
+ * the top of the window are copied to the bottom
+ *
+ * e.g.
+
+ b-2 | b-1 | b0 | b1 | b2 | ... | bb | ---->
+ /\ | ---->
+ \-------------------/ ---->
+ */
+ for (x = 0; x < (a->used - b); x++) {
+ *bottom++ = *top++;
+ }
+
+ /* zero the top digits */
+ for (; x < a->used; x++) {
+ *bottom++ = 0;
+ }
+ }
+
+ /* remove excess digits */
+ a->used -= b;
+}
+
/* shift right by a certain bit count (store quotient in c, optional remainder in d) */
static int mp_div_2d (const mp_int * a, int b, mp_int * c, mp_int * d)
{
@@ -3096,7 +3147,7 @@ static const mp_digit __prime_tab[] = {
*
* sets result to 0 if not, 1 if yes
*/
-int mp_prime_is_divisible (const mp_int * a, int *result)
+static int mp_prime_is_divisible (const mp_int * a, int *result)
{
int err, ix;
mp_digit res;
@@ -3120,68 +3171,6 @@ int mp_prime_is_divisible (const mp_int * a, int *result)
return MP_OKAY;
}
-/* performs a variable number of rounds of Miller-Rabin
- *
- * Probability of error after t rounds is no more than
-
- *
- * Sets result to 1 if probably prime, 0 otherwise
- */
-int mp_prime_is_prime (mp_int * a, int t, int *result)
-{
- mp_int b;
- int ix, err, res;
-
- /* default to no */
- *result = MP_NO;
-
- /* valid value of t? */
- if (t <= 0 || t > PRIME_SIZE) {
- return MP_VAL;
- }
-
- /* is the input equal to one of the primes in the table? */
- for (ix = 0; ix < PRIME_SIZE; ix++) {
- if (mp_cmp_d(a, __prime_tab[ix]) == MP_EQ) {
- *result = 1;
- return MP_OKAY;
- }
- }
-
- /* first perform trial division */
- if ((err = mp_prime_is_divisible (a, &res)) != MP_OKAY) {
- return err;
- }
-
- /* return if it was trivially divisible */
- if (res == MP_YES) {
- return MP_OKAY;
- }
-
- /* now perform the miller-rabin rounds */
- if ((err = mp_init (&b)) != MP_OKAY) {
- return err;
- }
-
- for (ix = 0; ix < t; ix++) {
- /* set the prime */
- mp_set (&b, __prime_tab[ix]);
-
- if ((err = mp_prime_miller_rabin (a, &b, &res)) != MP_OKAY) {
- goto __B;
- }
-
- if (res == MP_NO) {
- goto __B;
- }
- }
-
- /* passed the test */
- *result = MP_YES;
-__B:mp_clear (&b);
- return err;
-}
-
/* Miller-Rabin test of "a" to the base of "b" as described in
* HAC pp. 139 Algorithm 4.24
*
@@ -3189,7 +3178,7 @@ __B:mp_clear (&b);
* Randomly the chance of error is no more than 1/4 and often
* very much lower.
*/
-int mp_prime_miller_rabin (mp_int * a, const mp_int * b, int *result)
+static int mp_prime_miller_rabin (mp_int * a, const mp_int * b, int *result)
{
mp_int n1, y, r;
int s, j, err;
@@ -3264,6 +3253,68 @@ __N1:mp_clear (&n1);
return err;
}
+/* performs a variable number of rounds of Miller-Rabin
+ *
+ * Probability of error after t rounds is no more than
+
+ *
+ * Sets result to 1 if probably prime, 0 otherwise
+ */
+static int mp_prime_is_prime (mp_int * a, int t, int *result)
+{
+ mp_int b;
+ int ix, err, res;
+
+ /* default to no */
+ *result = MP_NO;
+
+ /* valid value of t? */
+ if (t <= 0 || t > PRIME_SIZE) {
+ return MP_VAL;
+ }
+
+ /* is the input equal to one of the primes in the table? */
+ for (ix = 0; ix < PRIME_SIZE; ix++) {
+ if (mp_cmp_d(a, __prime_tab[ix]) == MP_EQ) {
+ *result = 1;
+ return MP_OKAY;
+ }
+ }
+
+ /* first perform trial division */
+ if ((err = mp_prime_is_divisible (a, &res)) != MP_OKAY) {
+ return err;
+ }
+
+ /* return if it was trivially divisible */
+ if (res == MP_YES) {
+ return MP_OKAY;
+ }
+
+ /* now perform the miller-rabin rounds */
+ if ((err = mp_init (&b)) != MP_OKAY) {
+ return err;
+ }
+
+ for (ix = 0; ix < t; ix++) {
+ /* set the prime */
+ mp_set (&b, __prime_tab[ix]);
+
+ if ((err = mp_prime_miller_rabin (a, &b, &res)) != MP_OKAY) {
+ goto __B;
+ }
+
+ if (res == MP_NO) {
+ goto __B;
+ }
+ }
+
+ /* passed the test */
+ *result = MP_YES;
+__B:mp_clear (&b);
+ return err;
+}
+
static const struct {
int k, t;
} sizes[] = {
@@ -3574,57 +3625,6 @@ int mp_reduce_setup (mp_int * a, const mp_int * b)
return mp_div (a, b, a, NULL);
}
-/* shift right a certain amount of digits */
-void mp_rshd (mp_int * a, int b)
-{
- int x;
-
- /* if b <= 0 then ignore it */
- if (b <= 0) {
- return;
- }
-
- /* if b > used then simply zero it and return */
- if (a->used <= b) {
- mp_zero (a);
- return;
- }
-
- {
- register mp_digit *bottom, *top;
-
- /* shift the digits down */
-
- /* bottom */
- bottom = a->dp;
-
- /* top [offset into digits] */
- top = a->dp + b;
-
- /* this is implemented as a sliding window where
- * the window is b-digits long and digits from
- * the top of the window are copied to the bottom
- *
- * e.g.
-
- b-2 | b-1 | b0 | b1 | b2 | ... | bb | ---->
- /\ | ---->
- \-------------------/ ---->
- */
- for (x = 0; x < (a->used - b); x++) {
- *bottom++ = *top++;
- }
-
- /* zero the top digits */
- for (; x < a->used; x++) {
- *bottom++ = 0;
- }
- }
-
- /* remove excess digits */
- a->used -= b;
-}
-
/* set to a digit */
void mp_set (mp_int * a, mp_digit b)
{
diff --git a/dlls/rsaenh/tomcrypt.h b/dlls/rsaenh/tomcrypt.h
index 0efa086..aaaac98 100644
--- a/dlls/rsaenh/tomcrypt.h
+++ b/dlls/rsaenh/tomcrypt.h
@@ -275,12 +275,6 @@ void mp_clamp(mp_int *a);
/* ---> digit manipulation <--- */
-/* right shift by "b" digits */
-void mp_rshd(mp_int *a, int b);
-
-/* computes a = 2**b */
-int mp_2expt(mp_int *a, int b);
-
/* Counts the number of lsbs which are zero before the first zero bit */
int mp_cnt_lsb(const mp_int *a);
@@ -304,9 +298,6 @@ int mp_and(mp_int *a, mp_int *b, mp_int *c);
/* b = -a */
int mp_neg(mp_int *a, mp_int *b);
-/* b = |a| */
-int mp_abs(const mp_int *a, mp_int *b);
-
/* compare a to b */
int mp_cmp(const mp_int *a, const mp_int *b);
@@ -333,9 +324,6 @@ int mp_mod(const mp_int *a, mp_int *b, mp_int *c);
/* compare against a single digit */
int mp_cmp_d(const mp_int *a, mp_digit b);
-/* c = a + b */
-int mp_add_d(mp_int *a, mp_digit b, mp_int *c);
-
/* c = a - b */
int mp_sub_d(mp_int *a, mp_digit b, mp_int *c);
@@ -427,33 +415,16 @@ int mp_exptmod(const mp_int *a, const mp_int *b, mp_int *c, mp_int *d);
/* number of primes */
#define PRIME_SIZE 256
-/* result=1 if a is divisible by one of the first PRIME_SIZE primes */
-int mp_prime_is_divisible(const mp_int *a, int *result);
-
/* performs one Fermat test of "a" using base "b".
* Sets result to 0 if composite or 1 if probable prime
*/
int mp_prime_fermat(mp_int *a, mp_int *b, int *result);
-/* performs one Miller-Rabin test of "a" using base "b".
- * Sets result to 0 if composite or 1 if probable prime
- */
-int mp_prime_miller_rabin(mp_int *a, const mp_int *b, int *result);
-
/* This gives [for a given bit size] the number of trials required
* such that Miller-Rabin gives a prob of failure lower than 2^-96
*/
int mp_prime_rabin_miller_trials(int size);
-/* performs t rounds of Miller-Rabin on "a" using the first
- * t prime bases. Also performs an initial sieve of trial
- * division. Determines if "a" is prime with probability
- * of error no more than (1/4)**t.
- *
- * Sets result to 1 if probably prime, 0 otherwise
- */
-int mp_prime_is_prime(mp_int *a, int t, int *result);
-
/* finds the next prime after the number "a" using "t" trials
* of Miller-Rabin.
*
Module: website
Branch: master
Commit: 41789eaf9e4ff50717138d09cc0b4a7ca824b440
URL: http://source.winehq.org/git/website.git/?a=commit;h=41789eaf9e4ff50717138d…
Author: Christoph Korn <c_korn(a)gmx.de>
Date: Thu Jan 22 16:45:50 2009 +0100
German deb.template: Fix dimensions of screenshots.
This fixes the height and width properties of the screenshots.
Best regards
Christoph Korn
>From 3e8edf259cdfa4fd3c065c0f69e565d4e57d7d9d Mon Sep 17 00:00:00 2001
From: Christoph Korn <c_korn(a)gmx.de>
Date: Thu, 22 Jan 2009 16:42:15 +0100
Subject: German deb.template: Fix dimensions of screenshots.
---
templates/de/download/deb.template | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/templates/de/download/deb.template b/templates/de/download/deb.template
index f59e568..5b0bbcd 100644
--- a/templates/de/download/deb.template
+++ b/templates/de/download/deb.template
@@ -27,7 +27,7 @@ wahrscheinlich nicht benutzen.</i></p>
<b>System->Systemverwaltung->Software-Paketquellen</b>. Wähle dann den <b>Software
von Drittanbietern</b>-Reiter und klicke auf <b>Hinzufügen</b>.</p>
-<img src="{$root}/images/distro/de_ubuntu-softwaresources1.png" width="531" height="509" alt="System->Systemverwaltung->Software-Paketquellen" border="0">
+<img src="{$root}/images/distro/de_ubuntu-softwaresources1.png" width="686" height="516" alt="System->Systemverwaltung->Software-Paketquellen" border="0">
<p>Dann, <b>copy-paste eine der unteren Zeilen</b> in Abhängigkeit welche
Version du benutzt.</p>
@@ -48,7 +48,7 @@ und speichere Scott Ritchie's Schlüssel</a></b> auf deinen Desktop. Ö
Schlüsseldatei, die du gerade gespeichert hast (<i>Scott Ritchie.gpg</i>). Es ist sicher,
diese Datei nach diesem Schritt zu löschen.</p>
-<img src="{$root}/images/distro/de_ubuntu-softwaresources2.png" width="531" height="509" alt="System->Systemverwaltung->Software-Paketquellen" border="0">
+<img src="{$root}/images/distro/de_ubuntu-softwaresources2.png" width="686" height="514" alt="System->Systemverwaltung->Software-Paketquellen" border="0">
<p>Klick auf Schließen zum Beenden, anschließend <b>lade die Paketinformationen neu</b>, wenn
Du dazu aufgefordert wirst. Wenn Du Wine installiert hast, wird die Aktualisierungsverwaltung