summary refs log tree commit diff stats
path: root/plugins/sysinfo/sysinfo.cpp
AgeCommit message (Expand)Author
2013-06-01be more specific about sysinfo menu entryTingPing
2013-05-10Added help text for sysinfo plugin.Rahat Ahmed
2013-04-14Relocate plugin iconsBerke Viktor
2012-10-30Some final rebrandingBerke Viktor
2012-10-30Rebranding for the rest of plugin*Berke Viktor
2012-10-30Rebranding for XCHAT_EAT_*Berke Viktor
2012-10-30Rebranding for XCHAT_PRI_*Berke Viktor
2012-10-24A lot more rebrandingBerke Viktor
2012-10-21Rename WinSys on the code levelBerke Viktor
2012-10-21Rename WinSys filesBerke Viktor
ic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/* mpi-gcd.c  -  MPI functions
 *	Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
 *
 * This file is part of Libgcrypt.
 *
 * Libgcrypt is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * Libgcrypt is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 */

#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include "mpi-internal.h"

/****************
 * Find the greatest common divisor G of A and B.
 * Return: true if this 1, false in all other cases
 */
int
_gcry_mpi_gcd (gcry_mpi_t g, gcry_mpi_t xa, gcry_mpi_t xb)
{
    gcry_mpi_t a, b;

    a = mpi_copy(xa);
    b = mpi_copy(xb);

    /* TAOCP Vol II, 4.5.2, Algorithm A */
    a->sign = 0;
    b->sign = 0;
    while (mpi_cmp_ui (b, 0))
      {
	_gcry_mpi_fdiv_r( g, a, b ); /* G is used as temporary variable. */
	mpi_set(a,b);
	mpi_set(b,g);
      }
    mpi_set(g, a);

    mpi_free(a);
    mpi_free(b);
    return !mpi_cmp_ui( g, 1);
}
pan>* published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * Libgcrypt is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ /******************* * mpi_limb_t * _gcry_mpih_submul_1( mpi_ptr_t res_ptr, (r4) * mpi_ptr_t s1_ptr, (r5) * mpi_size_t s1_size, (r6) * mpi_limb_t s2_limb) (r7) */ .text .align 4 .globl _gcry_mpih_submul_1 .ent _gcry_mpih_submul_1 _gcry_mpih_submul_1: .set noreorder .set nomacro /* # warm up phase 0 */ ld $8,0($5) /* # warm up phase 1 */ daddiu $5,$5,8 dmultu $8,$7 daddiu $6,$6,-1 beq $6,$0,$LC0 move $2,$0 # zero cy2 daddiu $6,$6,-1 beq $6,$0,$LC1 ld $8,0($5) # load new s1 limb as early as possible Loop: ld $10,0($4) mflo $3 mfhi $9 daddiu $5,$5,8 daddu $3,$3,$2 # add old carry limb to low product limb dmultu $8,$7 ld $8,0($5) # load new s1 limb as early as possible daddiu $6,$6,-1 # decrement loop counter sltu $2,$3,$2 # carry from previous addition -> $2 dsubu $3,$10,$3 sgtu $10,$3,$10 daddu $2,$2,$10 sd $3,0($4) daddiu $4,$4,8 bne $6,$0,Loop daddu $2,$9,$2 # add high product limb and carry from addition /* # cool down phase 1 */ $LC1: ld $10,0($4) mflo $3 mfhi $9 daddu $3,$3,$2 sltu $2,$3,$2 dmultu $8,$7 dsubu $3,$10,$3 sgtu $10,$3,$10 daddu $2,$2,$10 sd $3,0($4) daddiu $4,$4,8 daddu $2,$9,$2 # add high product limb and carry from addition /* # cool down phase 0 */ $LC0: ld $10,0($4) mflo $3 mfhi $9 daddu $3,$3,$2 sltu $2,$3,$2 dsubu $3,$10,$3 sgtu $10,$3,$10 daddu $2,$2,$10 sd $3,0($4) j $31 daddu $2,$9,$2 # add high product limb and carry from addition .end _gcry_mpih_submul_1