See ChangeLog: Fri Nov 27 12:39:29 CET 1998 Werner Koch

This commit is contained in:
Werner Koch 1998-11-27 11:42:49 +00:00
parent 558baedbe8
commit a7d13c0d80
34 changed files with 922 additions and 3006 deletions

1
THANKS
View File

@ -16,6 +16,7 @@ Christopher Oliver oliver@fritz.traverse.net
Daniel Eisenbud eisenbud@cs.swarthmore.edu
David Ellement ellement@sdd.hp.com
Detlef Lannert lannert@lannert.rz.uni-duesseldorf.de
Dirk Lattermann dlatt@t-online.de
Ed Boraas ecxjo@esperanto.org
Ernst Molitor ernst.molitor@uni-bonn.de
Fabio Coatti cova@felix.unife.it

11
TODO
View File

@ -5,17 +5,12 @@
* preferences of hash algorithms are not yet used.
* Hash calculation for cleartext sigs without a "Hash: xxx" line
does it work as specified in the RFC? - Hmmm, I think so
* Check Berkeley BD - it is in glibc -any licensing problems?
* I noticed, that we sometimes have only 3 items in a trustrecord, but
a next pointer ro more records - check wehther the reuse code really
works. Maybe this is the reason for the "Hmmm public key lost"
* check support for mpi/powerpc (see Brian's mail)
* use zlib 1.1.13 to avoid a bug with 13 bit windows
but there are more problems with large files
@ -55,9 +50,6 @@
* add test cases for invalid data (scrambled armor or other random data)
* add some sanity checks to read_keyblock, so that we are sure that
the minimal requirements are met (?)
* rewrite --list-packets or put it into another tool.
* Burn the buffers used by fopen(), or use read(2). Does this
@ -70,11 +62,10 @@
* add an option to re-create a public key from a secret key; we
can do this in trustdb.c:verify_own_keys.
(special tool?)
* change the fake_data stuff to mpi_set_opaque
* Is it okay to use gettext for the help system?
* Add some stuff for DU cc
* Use "user ID", "trustdb", "NOTE" and "WARNING".

View File

@ -59,6 +59,9 @@ twofish: $(srcdir)/twofish.c
rndunix: $(srcdir)/rndunix.c
$(COMPILE) $(DYNLINK_MOD_CFLAGS) -o rndunix $(srcdir)/rndunix.c
rndlinux: $(srcdir)/rndlinux.c
$(COMPILE) $(DYNLINK_MOD_CFLAGS) -o rndlinux $(srcdir)/rndlinux.c
install-exec-hook:

View File

@ -39,15 +39,27 @@
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include "util.h"
#include "ttyio.h"
#include "i18n.h"
/* #define IS_MODULE 1 */
#include "types.h"
#ifdef IS_MODULE
#include "g10lib.h"
#define _(a) (a)
#else
#include "util.h"
#include "ttyio.h"
#include "i18n.h"
#include "dynload.h"
#endif
static int open_device( const char *name, int minor );
static int gather_random( byte *buffer, size_t *r_length, int level );
#ifdef IS_MODULE
static void tty_printf(const char *fmt, ... )
{
g10_log_info("tty_printf not available (%s)\n", fmt );
}
#endif
static void
fast_poll( void (*add)(const void*, size_t, int) )
@ -93,14 +105,14 @@ open_device( const char *name, int minor )
fd = open( name, O_RDONLY );
if( fd == -1 )
log_fatal("can't open %s: %s\n", name, strerror(errno) );
g10_log_fatal("can't open %s: %s\n", name, strerror(errno) );
if( fstat( fd, &sb ) )
log_fatal("stat() off %s failed: %s\n", name, strerror(errno) );
g10_log_fatal("stat() off %s failed: %s\n", name, strerror(errno) );
#if defined(__sparc__) && defined(__linux__)
#warning something is wrong with UltraPenguin /dev/random
#else
if( !S_ISCHR(sb.st_mode) )
log_fatal("invalid random device!\n" );
g10_log_fatal("invalid random device!\n" );
#endif
return fd;
}
@ -153,12 +165,12 @@ gather_random( byte *buffer, size_t *r_length, int level )
do {
n = read(fd, buffer, length );
if( n >= 0 && n > length ) {
log_error("bogus read from random device (n=%d)\n", n );
g10_log_error("bogus read from random device (n=%d)\n", n );
n = length;
}
} while( n == -1 && errno == EINTR );
if( n == -1 )
log_fatal("read error on random device: %s\n", strerror(errno) );
g10_log_fatal("read error on random device: %s\n", strerror(errno));
assert( n <= length );
buffer += n;
length -= n;
@ -169,7 +181,7 @@ gather_random( byte *buffer, size_t *r_length, int level )
#ifndef IS_MODULES
#ifndef IS_MODULE
static
#endif
const char * const gnupgext_version = "RNDLINUX ($Revision$)";

View File

@ -14,7 +14,7 @@ AM_CONFIG_HEADER(config.h)
VERSION=`cat $srcdir/VERSION`
PACKAGE=gnupg
ALL_LINGUAS="en de it fr ru es_ES"
ALL_LINGUAS="de it fr ru es_ES"
AC_SUBST(VERSION)
AC_SUBST(PACKAGE)
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")

View File

@ -1,3 +1,10 @@
Fri Nov 27 12:39:29 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
* status.c (display_help): Removed.
* helptext.c: New and removed the N_() from all cpr_gets.
Fri Nov 20 16:54:52 1998 Werner Koch (wk@isil.d.shuttle.de)
* g10.c (main): New option --not-dash-escaped

View File

@ -55,7 +55,8 @@ common_source = \
revoke.c \
keylist.c \
sig-check.c \
signal.c
signal.c \
helptext.c
gpg_SOURCES = g10.c \
$(common_source) \

View File

@ -128,8 +128,8 @@ delete_key( const char *username, int secret )
m_free(p);
tty_printf("\n\n");
yes = cpr_get_answer_is_yes( secret? N_("delete_key.secret.okay")
: N_("delete_key.okay"),
yes = cpr_get_answer_is_yes( secret? "delete_key.secret.okay"
: "delete_key.okay",
_("Delete this key from the keyring? "));
if( !cpr_enabled() && secret && yes ) {
/* I think it is not required to check a passphrase; if
@ -137,7 +137,7 @@ delete_key( const char *username, int secret )
* (and has no backup) - it is up him to read some very
* basic texts about security.
*/
yes = cpr_get_answer_is_yes(N_("delete_key.secret.okay"),
yes = cpr_get_answer_is_yes("delete_key.secret.okay",
_("This is a secret key! - really delete? "));
}
if( yes )

214
g10/helptext.c Normal file
View File

@ -0,0 +1,214 @@
/* helptext.c - English help texts
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
* GnuPG is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* GnuPG 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 General Public License for more details.
*
* You should have received a copy of the GNU 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 <string.h>
#include "util.h"
#include "ttyio.h"
#include "main.h"
#include "i18n.h"
/****************
* These helptexts are used for the "online" help feature. We use
* a key consisting of words and dots. Because the lookup is only
* done in an interactive mode on a user request (when she enters a "?"
* as response to a prompt) we can use a simple search through the list.
* Translators should use the key as msgid, this is to keep the msgid short
* and to allow for easy changing of the helptexts.
*/
static struct helptexts { const char *key; const char *help; } helptexts[] = {
/* begin of list */
{ N_("edit_ownertrust.value"),
"It's up to you to assign a value here; this value will never be exported\n"
"to any 3rd party. We need it to implement the web-of-trust; it has nothing\n"
"to do with the (implicitly created) web-of-certificates."
},
{ N_("revoked_key.override"),
"If you want to use this revoked key anyway, answer \"yes\"."
},
{ N_("untrusted_key.override"),
"If you want to use this untrusted key anyway, answer \"yes\"."
},
{ N_("pklist.user_id.enter"),
"Enter the user id of the addresse to whom you want to send the message."
},
{ N_("keygen.algo"),
"Select the algorithm to use.\n"
"DSA (aka DSS) is the digital signature algorithm which can only be used\n"
"for signatures. This is the suggested algorithm because verification of\n"
"DSA signatures are much faster than those of ElGamal\n"
"ElGamal is a algorithm which can be used for signatures and encryption.\n"
"OpenPGP distunguishs between two flavors of this algorithms: a encrypt only\n"
"and a sign+encrypt; actually it is the same, but some parameters must be\n"
"selected in a special way to create a safe key for signatures: this program\n"
"does this but other OpenPGP implemenations are not required to understand\n"
"the signature+encryption flavor.\n"
"The first (primary) key must always be a key which is capable of signing;\n"
"this is the reason why the ecrytion only ElGamal key is disabled in this.\n"
"You should not select the \"ElGamal in a v3 packet\", because that key is\n"
"not compatible to other OpenPGP implementations."
},
{ N_("keygen.size"),
""
},
{ N_("keygen.size.huge.okay"),
""
},
{ N_("keygen.size.large.okay"),
""
},
{ N_("keygen.valid"),
""
},
{ N_("keygen.valid.okay"),
""
},
{ N_("keygen.name"),
""
},
{ N_("keygen.email"),
""
},
{ N_("keygen.comment"),
""
},
{ N_("keygen.userid.cmd"),
""
"N to change the name.\n"
"C to change the comment.\n"
"E to change the email address.\n"
"O to continue with key generation.\n"
"Q to to quit the key generation."
},
{ N_("keygen.sub.okay"),
"Answer \"yes\" (or just \"y\") if it is okay to generate the sub key."
},
{ N_("sign_uid.okay"),
""
},
{ N_("change_passwd.empty.okay"),
""
},
{ N_("keyedit.cmd"),
"Please enter \"help\" to see the list of commands."
},
{ N_("keyedit.save.okay"),
""
},
{ N_("keyedit.cancel.okay"),
""
},
{ N_("keyedit.sign_all.okay"),
""
},
{ N_("keyedit.remove.uid.okay"),
""
},
{ N_("keyedit.remove.subkey.okay"),
""
},
{ N_("passphrase.enter"),
""
"Please enter the passhrase; this is a secret sentence \n"
" Blurb, blurb,.... "
},
{ N_("passphrase.repeat"),
"Please repeat the last passphrase, so you are sure what you typed in."
},
{ N_("detached_signature.filename"),
""
},
{ N_("openfile.overwrite.okay"),
""
},
/* end of list */
{ NULL, NULL } };
void
display_online_help( const char *keyword )
{
tty_kill_prompt();
if( !keyword )
tty_printf(_("No help available") );
else {
const char *p = _(keyword);
if( strcmp( p, keyword ) )
tty_printf("%s", p );
else {
int i;
for(i=0; (p=helptexts[i].key) && strcmp( p, keyword ); i++ )
;
if( !p || !*helptexts[i].help )
tty_printf(_("No help available for '%s'"), keyword );
else
tty_printf("%s", helptexts[i].help );
}
}
tty_printf("\n");
}

View File

@ -279,7 +279,7 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified )
m_free(p); p = NULL;
tty_printf("\"\n\n");
if( !cpr_get_answer_is_yes(N_("sign_uid.okay"), _("Really sign? ")) )
if( !cpr_get_answer_is_yes("sign_uid.okay", _("Really sign? ")) )
continue;;
/* now we can sign the user ids */
reloop: /* (must use this, because we are modifing the list) */
@ -392,7 +392,7 @@ change_passphrase( KBNODE keyblock )
rc = 0;
tty_printf(_( "You don't want a passphrase -"
" this is probably a *bad* idea!\n\n"));
if( cpr_get_answer_is_yes(N_("change_passwd.empty.okay"),
if( cpr_get_answer_is_yes("change_passwd.empty.okay",
_("Do you really want to do this? ")))
changed++;
break;
@ -587,7 +587,7 @@ keyedit_menu( const char *username, STRLIST locusr, STRLIST commands )
have_commands = 0;
}
if( !have_commands ) {
answer = cpr_get(N_("keyedit.cmd"), _("Command> "));
answer = cpr_get("keyedit.cmd", _("Command> "));
cpr_kill_prompt();
}
trim_spaces(answer);
@ -635,10 +635,10 @@ keyedit_menu( const char *username, STRLIST locusr, STRLIST commands )
goto leave;
if( !modified && !sec_modified )
goto leave;
if( !cpr_get_answer_is_yes(N_("keyedit.save.okay"),
if( !cpr_get_answer_is_yes("keyedit.save.okay",
_("Save changes? ")) ) {
if( cpr_enabled()
|| cpr_get_answer_is_yes(N_("keyedit.cancel.okay"),
|| cpr_get_answer_is_yes("keyedit.cancel.okay",
_("Quit without saving? ")) )
goto leave;
break;
@ -697,7 +697,7 @@ keyedit_menu( const char *username, STRLIST locusr, STRLIST commands )
case cmdSIGN: /* sign (only the public key) */
if( count_uids(keyblock) > 1 && !count_selected_uids(keyblock) ) {
if( !cpr_get_answer_is_yes(N_("keyedit.sign_all.okay"),
if( !cpr_get_answer_is_yes("keyedit.sign_all.okay",
_("Really sign all user ids? ")) ) {
tty_printf(_("Hint: Select the user ids to sign\n"));
break;
@ -739,7 +739,7 @@ keyedit_menu( const char *username, STRLIST locusr, STRLIST commands )
else if( count_uids(keyblock) - n1 < 1 )
tty_printf(_("You can't delete the last user id!\n"));
else if( cpr_get_answer_is_yes(
N_("keyedit.remove.uid.okay"),
"keyedit.remove.uid.okay",
n1 > 1? _("Really remove all selected user ids? ")
: _("Really remove this user id? ")
) ) {
@ -766,7 +766,7 @@ keyedit_menu( const char *username, STRLIST locusr, STRLIST commands )
if( !(n1=count_selected_keys( keyblock )) )
tty_printf(_("You must select at least one key.\n"));
else if( sec_keyblock && !cpr_get_answer_is_yes(
N_("keyedit.remove.subkey.okay"),
"keyedit.remove.subkey.okay",
n1 > 1?
_("Do you really want to delete the selected keys? "):
_("Do you really want to delete this key? ")

View File

@ -396,7 +396,7 @@ ask_algo( int *ret_v4, int addmode )
*ret_v4 = 1;
for(;;) {
answer = cpr_get(N_("keygen.algo"),_("Your selection? "));
answer = cpr_get("keygen.algo",_("Your selection? "));
cpr_kill_prompt();
algo = *answer? atoi(answer): 1;
m_free(answer);
@ -440,7 +440,7 @@ ask_keysize( int algo )
" highest suggested keysize is 2048 bits\n"),
pubkey_algo_to_string(algo) );
for(;;) {
answer = cpr_get(N_("keygen.size"),
answer = cpr_get("keygen.size",
_("What keysize do you want? (1024) "));
cpr_kill_prompt();
nbits = *answer? atoi(answer): 1024;
@ -453,7 +453,7 @@ ask_keysize( int algo )
tty_printf(
_("Keysizes larger than 2048 are not suggested because\n"
"computations take REALLY long!\n"));
if( cpr_get_answer_is_yes(N_("keygen.size.huge.okay"),_(
if( cpr_get_answer_is_yes("keygen.size.huge.okay",_(
"Are you sure that you want this keysize? ")) ) {
tty_printf(_("Okay, but keep in mind that your monitor "
"and keyboard radiation is also very vulnerable "
@ -462,7 +462,7 @@ ask_keysize( int algo )
}
}
else if( nbits > 1536 && !cpr_enabled() ) {
if( cpr_get_answer_is_yes(N_("keygen.size.large.okay"),_(
if( cpr_get_answer_is_yes("keygen.size.large.okay",_(
"Do you really need such a large keysize? ")) )
break;
}
@ -504,7 +504,7 @@ ask_expire_interval()
int mult;
m_free(answer);
answer = cpr_get(N_("keygen.valid"),_("Key is valid for? (0) "));
answer = cpr_get("keygen.valid",_("Key is valid for? (0) "));
cpr_kill_prompt();
trim_spaces(answer);
if( !*answer )
@ -531,7 +531,7 @@ ask_expire_interval()
}
if( !cpr_enabled()
&& cpr_get_answer_is_yes(N_("keygen.valid.okay"),
&& cpr_get_answer_is_yes("keygen.valid.okay",
_("Is this correct (y/n)? ")) )
break;
}
@ -585,7 +585,7 @@ ask_user_id( int mode )
if( !aname ) {
for(;;) {
m_free(aname);
aname = cpr_get(N_("keygen.name"),_("Real name: "));
aname = cpr_get("keygen.name",_("Real name: "));
trim_spaces(aname);
cpr_kill_prompt();
if( strpbrk( aname, "<([])>" ) )
@ -601,7 +601,7 @@ ask_user_id( int mode )
if( !amail ) {
for(;;) {
m_free(amail);
amail = cpr_get(N_("keygen.email"),_("Email address: "));
amail = cpr_get("keygen.email",_("Email address: "));
trim_spaces(amail);
strlwr(amail);
cpr_kill_prompt();
@ -621,7 +621,7 @@ ask_user_id( int mode )
if( !acomment ) {
for(;;) {
m_free(acomment);
acomment = cpr_get(N_("keygen.comment"),_("Comment: "));
acomment = cpr_get("keygen.comment",_("Comment: "));
trim_spaces(acomment);
cpr_kill_prompt();
if( !*acomment )
@ -659,7 +659,7 @@ ask_user_id( int mode )
answer[1] = 0;
}
else {
answer = cpr_get(N_("keygen.userid.cmd"),_(
answer = cpr_get("keygen.userid.cmd",_(
"Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? "));
cpr_kill_prompt();
}
@ -997,7 +997,7 @@ generate_subkeypair( KBNODE pub_keyblock, KBNODE sec_keyblock )
assert(algo);
nbits = ask_keysize( algo );
expire = ask_expire_interval();
if( !cpr_enabled() && !cpr_get_answer_is_yes(N_("keygen.sub.okay"),
if( !cpr_enabled() && !cpr_get_answer_is_yes("keygen.sub.okay",
_("Really create? ") ) )
goto leave;

View File

@ -56,6 +56,9 @@ u16 checksum_mpi( MPI a );
u16 checksum_mpi_counted_nbits( MPI a );
u32 buffer_to_u32( const byte *buffer );
/*-- helptext.c --*/
void display_online_help( const char *keyword );
/*-- encode.c --*/
int encode_symmetric( const char *filename );
int encode_store( const char *filename );

View File

@ -56,7 +56,7 @@ overwrite_filep( const char *fname )
return 0; /* do not overwrite */
tty_printf(_("File '%s' exists. "), fname);
if( cpr_get_answer_is_yes(N_("openfile.overwrite.okay"),
if( cpr_get_answer_is_yes("openfile.overwrite.okay",
_("Overwrite (y/N)? ")) )
return 1;
return 0;

View File

@ -171,10 +171,10 @@ passphrase_to_dek( u32 *keyid, int cipher_algo, STRING2KEY *s2k, int mode )
else if( opt.batch )
log_fatal("Can't query password in batchmode\n");
else {
pw = cpr_get_hidden(N_("passphrase.enter"), _("Enter passphrase: ") );
pw = cpr_get_hidden("passphrase.enter", _("Enter passphrase: ") );
tty_kill_prompt();
if( mode == 2 && !cpr_enabled() ) {
char *pw2 = cpr_get_hidden(N_("passphrase.repeat"),
char *pw2 = cpr_get_hidden("passphrase.repeat",
_("Repeat passphrase: ") );
tty_kill_prompt();
if( strcmp(pw, pw2) ) {

View File

@ -146,7 +146,7 @@ edit_ownertrust( ulong lid, int mode )
if( strlen(ans) != 4 )
BUG();
p = cpr_get(N_("edit_ownertrust.value"),_("Your decision? "));
p = cpr_get("edit_ownertrust.value",_("Your decision? "));
trim_spaces(p);
cpr_kill_prompt();
if( *p && p[1] )
@ -240,7 +240,7 @@ do_we_trust( PKT_public_key *pk, int trustlevel )
if( opt.batch )
return 0;
if( !cpr_get_answer_is_yes(N_("revoked_key.override"),
if( !cpr_get_answer_is_yes("revoked_key.override",
_("Use this key anyway? ")) )
return 0;
}
@ -331,8 +331,8 @@ do_we_trust_pre( PKT_public_key *pk, int trustlevel )
"If you *really* know what you are doing, you may answer\n"
"the next question with yes\n\n") );
if( cpr_get_answer_is_yes(N_("untrusted_key.override"),
_("Use this key anyway? ")) )
if( cpr_get_answer_is_yes("untrusted_key.override",
_("Use this key anyway? ")) )
rc = 1;
}
else if( opt.always_trust && !rc ) {
@ -478,7 +478,7 @@ build_pk_list( STRLIST remusr, PK_LIST *ret_pk_list, unsigned usage )
for(;;) {
rc = 0;
m_free(answer);
answer = cpr_get_utf8(N_("pklist.user_id.enter"),
answer = cpr_get_utf8("pklist.user_id.enter",
_("Enter the user ID: "));
trim_spaces(answer);
cpr_kill_prompt();

View File

@ -211,8 +211,8 @@ ask_for_detached_datafile( md_filter_context_t *mfx, const char *inname )
tty_printf("Detached signature.\n");
do {
m_free(answer);
answer = cpr_get(N_("detached_signature.filename"),
_("Please enter name of data file: "));
answer = cpr_get("detached_signature.filename",
_("Please enter name of data file: "));
cpr_kill_prompt();
if( any && !*answer ) {
rc = G10ERR_READ_FILE;

View File

@ -117,7 +117,7 @@ gen_revoke( const char *uname )
}
tty_printf("\n");
if( !cpr_get_answer_is_yes(N_("gen_revoke.okay"),
if( !cpr_get_answer_is_yes("gen_revoke.okay",
_("Create a revocation certificate for this key? ")) ){
rc = 0;
goto leave;

View File

@ -235,31 +235,6 @@ do_shm_get( const char *keyword, int hidden, int bool )
#endif /* USE_SHM_COPROCESSING */
static void
display_help( const char *keyword )
{
const char *p;
int hint = 0;
tty_kill_prompt();
if( !keyword ) {
tty_printf(_("No help available") );
hint++;
}
else {
p = _(keyword);
if( !strcmp( p, keyword ) ) {
tty_printf(_("No help available for '%s'"), keyword );
hint++;
}
else
tty_printf("%s", p );
}
tty_printf("\n");
if( hint )
tty_printf("You should set your LANG variable to a valid value.\n"
"Set LANG to \"en\" to see the English help texts.\n" );
}
int
@ -285,7 +260,7 @@ cpr_get( const char *keyword, const char *prompt )
p = tty_get( prompt );
if( *p == '?' && !p[1] ) {
m_free(p);
display_help( keyword );
display_online_help( keyword );
}
else
return p;
@ -318,7 +293,7 @@ cpr_get_hidden( const char *keyword, const char *prompt )
p = tty_get_hidden( prompt );
if( *p == '?' && !p[1] ) {
m_free(p);
display_help( keyword );
display_online_help( keyword );
}
else
return p;
@ -350,7 +325,7 @@ cpr_get_answer_is_yes( const char *keyword, const char *prompt )
trim_spaces(p); /* it is okay to do this here */
if( *p == '?' && !p[1] ) {
m_free(p);
display_help( keyword );
display_online_help( keyword );
}
else {
tty_kill_prompt();

View File

@ -1,3 +1,9 @@
Thu Nov 26 07:27:52 1998 Werner Koch <werner.koch@guug.de>
* config.links: Support for ppc with ELF
* powerpc32/syntax.h: New.
* powerpc32/*.S: Applied ELF patches (glibc patches)
Tue Nov 10 19:31:37 1998 Werner Koch (wk@isil.d.shuttle.de)
* power*/ : Started with stuff for PPC

View File

@ -146,6 +146,12 @@ case "${target}" in
mpi_sflags="-Wa,-mppc"
path="powerpc64"
;;
powerpc*-*-linux*)
echo '/* configured for powerpc/ELF */' >>./mpi/asm-syntax.h
echo '#define ELF_SYNTAX' >>asm-syntax.h
cat $srcdir/powerpc32/syntax.h >>./mpi/asm-syntax.h
path="powerpc32"
;;
*)
echo '/* No assembler modules configured */' >>./mpi/asm-syntax.h

View File

@ -5,4 +5,5 @@ mpih-mul2.S
mpih-mul3.S
mpih-lshift.S
mpih-rshift.S
syntax.h

View File

@ -19,8 +19,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include "sysdep.h"
#include "asm-syntax.h"
#ifndef USE_PPC_PATCHES
/*******************
* mpi_limb_t
* mpihelp_add_n( mpi_ptr_t res_ptr, (r3)
@ -57,4 +61,76 @@ Lend: stw 7,4(3) # store ultimate result limb
addze 3,3 # ... return value register
blr
#else
/* Add two limb vectors of equal, non-zero length for PowerPC.
Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "sysdep.h"
#include "asm-syntax.h"
/* mp_limb_t mpn_add_n (mp_ptr res_ptr, mp_srcptr s1_ptr, mp_srcptr s2_ptr,
mp_size_t size)
Calculate s1+s2 and put result in res_ptr; return carry, 0 or 1. */
/* Note on optimisation: This code is optimal for the 601. Almost every other
possible 2-unrolled inner loop will not be. Also, watch out for the
alignment... */
EALIGN(_mpihelp_add_n,3,0)
/* Set up for loop below. */
mtcrf 0x01,%r6
srwi. %r7,%r6,1
li %r10,0
mtctr %r7
bt 31,2f
/* Clear the carry. */
addic %r0,%r0,0
/* Adjust pointers for loop. */
addi %r3,%r3,-4
addi %r4,%r4,-4
addi %r5,%r5,-4
b 0f
2: lwz %r7,0(%r5)
lwz %r6,0(%r4)
addc %r6,%r6,%r7
stw %r6,0(%r3)
beq 1f
/* The loop. */
/* Align start of loop to an odd word boundary to guarantee that the
last two words can be fetched in one access (for 601). */
0: lwz %r9,4(%r4)
lwz %r8,4(%r5)
lwzu %r6,8(%r4)
lwzu %r7,8(%r5)
adde %r8,%r9,%r8
stw %r8,4(%r3)
adde %r6,%r6,%r7
stwu %r6,8(%r3)
bdnz 0b
/* Return the carry. */
1: addze %r3,%r10
blr
END(_mpihelp_add_n)
#endif

View File

@ -19,6 +19,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include "sysdep.h"
#include "asm-syntax.h"
#ifndef USE_PPC_PATCHES
/*******************
* mpi_limb_t
@ -68,4 +73,126 @@ Lend2: slw 0,10,6
stw 0,-4(7)
blr
#else
/* Shift a limb left, low level routine.
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* mp_limb_t mpn_lshift (mp_ptr wp, mp_srcptr up, mp_size_t usize,
unsigned int cnt) */
EALIGN(_mpihelp_lshift,3,0)
mtctr %r5 # copy size into CTR
cmplwi %cr0,%r5,16 # is size < 16
slwi %r0,%r5,2
add %r7,%r3,%r0 # make r7 point at end of res
add %r4,%r4,%r0 # make r4 point at end of s1
lwzu %r11,-4(%r4) # load first s1 limb
subfic %r8,%r6,32
srw %r3,%r11,%r8 # compute function return value
bge %cr0,L(big) # branch if size >= 16
bdz L(end1)
0: lwzu %r10,-4(%r4)
slw %r9,%r11,%r6
srw %r12,%r10,%r8
or %r9,%r9,%r12
stwu %r9,-4(%r7)
bdz L(end2)
lwzu %r11,-4(%r4)
slw %r9,%r10,%r6
srw %r12,%r11,%r8
or %r9,%r9,%r12
stwu %r9,-4(%r7)
bdnz 0b
L(end1):slw %r0,%r11,%r6
stw %r0,-4(%r7)
blr
/* Guaranteed not to succeed. */
L(boom): tweq %r0,%r0
/* We imitate a case statement, by using (yuk!) fixed-length code chunks,
of size 4*12 bytes. We have to do this (or something) to make this PIC. */
L(big): mflr %r9
bltl- %cr0,L(boom) # Never taken, only used to set LR.
slwi %r10,%r6,4
mflr %r12
add %r10,%r12,%r10
slwi %r8,%r6,5
add %r10,%r8,%r10
mtctr %r10
addi %r5,%r5,-1
mtlr %r9
bctr
L(end2):slw %r0,%r10,%r6
stw %r0,-4(%r7)
blr
#define DO_LSHIFT(n) \
mtctr %r5; \
0: lwzu %r10,-4(%r4); \
slwi %r9,%r11,n; \
inslwi %r9,%r10,n,32-n; \
stwu %r9,-4(%r7); \
bdz- L(end2); \
lwzu %r11,-4(%r4); \
slwi %r9,%r10,n; \
inslwi %r9,%r11,n,32-n; \
stwu %r9,-4(%r7); \
bdnz 0b; \
b L(end1)
DO_LSHIFT(1)
DO_LSHIFT(2)
DO_LSHIFT(3)
DO_LSHIFT(4)
DO_LSHIFT(5)
DO_LSHIFT(6)
DO_LSHIFT(7)
DO_LSHIFT(8)
DO_LSHIFT(9)
DO_LSHIFT(10)
DO_LSHIFT(11)
DO_LSHIFT(12)
DO_LSHIFT(13)
DO_LSHIFT(14)
DO_LSHIFT(15)
DO_LSHIFT(16)
DO_LSHIFT(17)
DO_LSHIFT(18)
DO_LSHIFT(19)
DO_LSHIFT(20)
DO_LSHIFT(21)
DO_LSHIFT(22)
DO_LSHIFT(23)
DO_LSHIFT(24)
DO_LSHIFT(25)
DO_LSHIFT(26)
DO_LSHIFT(27)
DO_LSHIFT(28)
DO_LSHIFT(29)
DO_LSHIFT(30)
DO_LSHIFT(31)
END(_mpihelp_lshift)
#endif

View File

@ -20,6 +20,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include "sysdep.h"
#include "asm-syntax.h"
#ifndef USE_PPC_PATCHES
/*******************
* mpi_limb_t
@ -65,3 +70,50 @@ Lend: stw 7,4(3)
addze 3,10
blr
#else
/* Multiply a limb vector by a limb, for PowerPC.
Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* mp_limb_t mpn_mul_1 (mp_ptr res_ptr, mp_srcptr s1_ptr,
mp_size_t s1_size, mp_limb_t s2_limb)
Calculate s1*s2 and put result in res_ptr; return carry. */
ENTRY(_mpihelp_mul_1)
mtctr %r5
lwz %r0,0(%r4)
mullw %r7,%r0,%r6
mulhwu %r10,%r0,%r6
addi %r3,%r3,-4 # adjust res_ptr
addic %r5,%r5,0 # clear cy with dummy insn
bdz 1f
0: lwzu %r0,4(%r4)
stwu %r7,4(%r3)
mullw %r8,%r0,%r6
adde %r7,%r8,%r10
mulhwu %r10,%r0,%r6
bdnz 0b
1: stw %r7,4(%r3)
addze %r3,%r10
blr
END(_mpihelp_mul_1)
#endif

View File

@ -1,6 +1,6 @@
/* PowerPC-32 addmul_1 -- Multiply a limb vector with a limb and add
* the result to a second limb vector.
*
* Copyright (C) 1995, 1998 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
@ -20,6 +20,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include "sysdep.h"
#include "asm-syntax.h"
#ifndef USE_PPC_PATCHES
/*******************
* mpi_limb_t
@ -70,4 +75,53 @@ Lend: stw 8,4(3)
addze 3,10
blr
#else
/* Multiply a limb vector by a single limb, for PowerPC.
Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* mp_limb_t mpn_addmul_1 (mp_ptr res_ptr, mp_srcptr s1_ptr,
mp_size_t s1_size, mp_limb_t s2_limb)
Calculate res+s1*s2 and put result back in res; return carry. */
ENTRY(_mpihelp_addmul_1)
mtctr %r5
lwz %r0,0(%r4)
mullw %r7,%r0,%r6
mulhwu %r10,%r0,%r6
lwz %r9,0(%r3)
addc %r8,%r7,%r9
addi %r3,%r3,-4 /* adjust res_ptr */
bdz 1f
0: lwzu %r0,4(%r4)
stwu %r8,4(%r3)
mullw %r8,%r0,%r6
adde %r7,%r8,%r10
mulhwu %r10,%r0,%r6
lwz %r9,4(%r3)
addze %r10,%r10
addc %r8,%r7,%r9
bdnz 0b
1: stw %r8,4(%r3)
addze %r3,%r10
blr
END(_mpihelp_addmul_1)
#endif

View File

@ -20,6 +20,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include "sysdep.h"
#include "asm-syntax.h"
#ifndef USE_PPC_PATCHES
/*******************
* mpi_limb_t
@ -71,4 +76,55 @@ Lend: stw 8,4(3)
addze 3,10
blr
#else
/* Multiply a limb vector by a single limb, for PowerPC.
Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* mp_limb_t mpn_submul_1 (mp_ptr res_ptr, mp_srcptr s1_ptr,
mp_size_t s1_size, mp_limb_t s2_limb)
Calculate res-s1*s2 and put result back in res; return carry. */
ENTRY(_mpihelp_submul_1)
mtctr %r5
lwz %r0,0(%r4)
mullw %r7,%r0,%r6
mulhwu %r10,%r0,%r6
lwz %r9,0(%r3)
subf %r8,%r7,%r9
addc %r7,%r7,%r8 # invert cy (r7 is junk)
addi %r3,%r3,-4 # adjust res_ptr
bdz 1f
0: lwzu %r0,4(%r4)
stwu %r8,4(%r3)
mullw %r8,%r0,%r6
adde %r7,%r8,%r10
mulhwu %r10,%r0,%r6
lwz %r9,4(%r3)
addze %r10,%r10
subf %r8,%r7,%r9
addc %r7,%r7,%r8 # invert cy (r7 is junk)
bdnz 0b
1: stw %r8,4(%r3)
addze %r3,%r10
blr
END(_mpihelp_submul_1)
#endif

View File

@ -20,6 +20,12 @@
*/
#include "sysdep.h"
#include "asm-syntax.h"
#ifndef USE_PPC_PATCHES
/*******************
* mpi_limb_t
* mpihelp_rshift( mpi_ptr_t wp, (r3)
@ -66,3 +72,60 @@ Lend2: srw 0,10,6
stw 0,4(7)
blr
#else
/* Shift a limb right, low level routine.
Copyright (C) 1995, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* INPUT PARAMETERS
res_ptr r3
s1_ptr r4
size r5
cnt r6 */
ENTRY(_mpihelp_rshift)
mtctr 5 # copy size into CTR
addi 7,3,-4 # move adjusted res_ptr to free return reg
subfic 8,6,32
lwz 11,0(4) # load first s1 limb
slw 3,11,8 # compute function return value
bdz 1f
0: lwzu 10,4(4)
srw 9,11,6
slw 12,10,8
or 9,9,12
stwu 9,4(7)
bdz 2f
lwzu 11,4(4)
srw 9,10,6
slw 12,11,8
or 9,9,12
stwu 9,4(7)
bdnz 0b
1: srw 0,11,6
stw 0,4(7)
blr
2: srw 0,10,6
stw 0,4(7)
blr
END(_mpihelp_rshift)
#endif

View File

@ -20,6 +20,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#include "sysdep.h"
#include "asm-syntax.h"
#ifndef USE_PPC_PATCHES
/*******************
* mpi_limb_t
@ -57,4 +62,71 @@ Lend: stw 7,4(3) # store ultimate result limb
subfic 3,3,0 # ... return value register
blr
#else
/* Subtract two limb vectors of equal, non-zero length for PowerPC.
Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* mp_limb_t mpn_sub_n (mp_ptr res_ptr, mp_srcptr s1_ptr, mp_srcptr s2_ptr,
mp_size_t size)
Calculate s1-s2 and put result in res_ptr; return borrow, 0 or 1. */
/* Note on optimisation: This code is optimal for the 601. Almost every other
possible 2-unrolled inner loop will not be. Also, watch out for the
alignment... */
EALIGN(_mpihelp_sub_n,3,1)
/* Set up for loop below. */
mtcrf 0x01,%r6
srwi. %r7,%r6,1
mtctr %r7
bt 31,2f
/* Set the carry (clear the borrow). */
subfc %r0,%r0,%r0
/* Adjust pointers for loop. */
addi %r3,%r3,-4
addi %r4,%r4,-4
addi %r5,%r5,-4
b 0f
2: lwz %r7,0(%r5)
lwz %r6,0(%r4)
subfc %r6,%r7,%r6
stw %r6,0(%r3)
beq 1f
/* Align start of loop to an odd word boundary to guarantee that the
last two words can be fetched in one access (for 601). This turns
out to be important. */
0:
lwz %r9,4(%r4)
lwz %r8,4(%r5)
lwzu %r6,8(%r4)
lwzu %r7,8(%r5)
subfe %r8,%r8,%r9
stw %r8,4(%r3)
subfe %r6,%r7,%r6
stwu %r6,8(%r3)
bdnz 0b
/* Return the borrow. */
1: subfe %r3,%r3,%r3
neg %r3,%r3
blr
END(_mpihelp_sub_n)
#endif

75
mpi/powerpc32/syntax.h Normal file
View File

@ -0,0 +1,75 @@
/* gmp2-2.0.2-ppc/mpn/powerpc-linux/syntax.h Tue Oct 6 19:27:01 1998 */
/* From glibc's sysdeps/unix/sysv/linux/powerpc/sysdep.h */
/* Copyright (C) 1992, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#define USE_PPC_PATCHES 1
/* This seems to always be the case on PPC. */
#define ALIGNARG(log2) log2
/* For ELF we need the `.type' directive to make shared libs work right. */
#define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg;
#define ASM_SIZE_DIRECTIVE(name) .size name,.-name
#define ASM_GLOBAL_DIRECTIVE .globl
#ifdef __STDC__
# define C_LABEL(name) C_SYMBOL_NAME(name)##:
#else
# define C_LABEL(name) C_SYMBOL_NAME(name)/**/:
#endif
#ifdef __STDC__
# define L(body) .L##body
#else
# define L(body) .L/**/body
#endif
/* No profiling of gmp's assembly for now... */
#define CALL_MCOUNT /* no profiling */
#define ENTRY(name) \
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
.align ALIGNARG(2); \
C_LABEL(name) \
CALL_MCOUNT
#define EALIGN_W_0 /* No words to insert. */
#define EALIGN_W_1 nop
#define EALIGN_W_2 nop;nop
#define EALIGN_W_3 nop;nop;nop
#define EALIGN_W_4 EALIGN_W_3;nop
#define EALIGN_W_5 EALIGN_W_4;nop
#define EALIGN_W_6 EALIGN_W_5;nop
#define EALIGN_W_7 EALIGN_W_6;nop
/* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes
past a 2^align boundary. */
#define EALIGN(name, alignt, words) \
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
.align ALIGNARG(alignt); \
EALIGN_W_##words; \
C_LABEL(name)
#undef END
#define END(name) \
ASM_SIZE_DIRECTIVE(name)

View File

@ -1,3 +1,9 @@
Fri Nov 27 12:39:29 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
* en.po: Removed
Fri Nov 20 11:46:22 1998 Werner Koch (wk@isil.d.shuttle.de)
* de.po: Imported new version

View File

@ -45,5 +45,6 @@ g10/pubkey-enc.c
g10/openfile.c
g10/encr-data.c
g10/seskey.c
g10/helptext.c
#---end--

2920
po/en.po

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,12 @@
Fri Nov 27 12:39:29 CET 1998 Werner Koch <wk@isil.d.shuttle.de>
* commit: New
Fri Nov 20 12:01:57 1998 Werner Koch (wk@isil.d.shuttle.de)
* mkdiff: signs the pacth file
* mkdiff: signs the patch file
Sat Oct 17 16:10:16 1998 Werner Koch (wk@isil.d.shuttle.de)

28
scripts/commit Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
# need a Posix shell, so we simply use bash
set -e
uid=`id -u`
date=`date`
name=$(awk -F: "\$3==$uid { print \$5 }" /etc/passwd )
addr="<`id -un`@`hostname -d`>"
for i in `find . -name Changes -print`; do
dir=`dirname $i`
if [ -s $dir/Changes ]; then
lines=`wc -l <$dir/Changes`
echo "$date $name $addr" >$dir/ChangeLog.new
echo >>$dir/ChangeLog.new
cat $dir/Changes >>$dir/ChangeLog.new
echo >>$dir/ChangeLog.new
[ -f $dir/ChangeLog ] && cat $dir/ChangeLog >>$dir/ChangeLog.new
echo -n > $dir/Changes
[ -f $dir/ChangeLog ] && rm $dir/ChangeLog
mv $dir/ChangeLog.new $dir/ChangeLog
echo "$lines new lines in $dir/ChangeLog"
fi
done
cvs commit -m "See ChangeLog: $date $name" $*