Skip to content
Snippets Groups Projects
Select Git revision
  • f682df42dcc6949182d977acdd296ebda712efeb
  • master default protected
  • 9.0
  • 8.0
  • 7.8
  • 7.6
  • 7.4
  • 7.2
  • 7.0
  • 0.6
  • rosuav/latex-markdown-renderer
  • rxnpatch/rxnpatch
  • marcus/gobject-introspection
  • rxnpatch/8.0
  • rosuav/pre-listening-ports
  • nt-tools
  • rosuav/async-annotations
  • rosuav/pgsql-ssl
  • rxnpatch/rxnpatch-broken/2023-10-06T094250
  • grubba/fdlib
  • grubba/wip/sakura/8.0
  • v8.0.2000
  • v8.0.1998
  • v8.0.1996
  • v8.0.1994
  • v8.0.1992
  • v8.0.1990
  • v8.0.1988
  • v8.0.1986
  • rxnpatch/clusters/8.0/2025-04-29T124414
  • rxnpatch/2025-04-29T124414
  • v8.0.1984
  • v8.0.1982
  • v8.0.1980
  • v8.0.1978
  • v8.0.1976
  • v8.0.1974
  • v8.0.1972
  • v8.0.1970
  • v8.0.1968
  • v8.0.1966
41 results

encode.c

Blame
    • Martin Stjernholm's avatar
      265d60b1
      Fixed some warnings. · 265d60b1
      Martin Stjernholm authored
      Rev: src/dmalloc.h:1.65
      Rev: src/encode.c:1.282
      Rev: src/modules/Mysql/mysql.c:1.113
      Rev: src/modules/_Image_TIFF/image_tiff.c:1.46
      Rev: src/modules/spider/spider.c:1.135
      265d60b1
      History
      Fixed some warnings.
      Martin Stjernholm authored
      Rev: src/dmalloc.h:1.65
      Rev: src/encode.c:1.282
      Rev: src/modules/Mysql/mysql.c:1.113
      Rev: src/modules/_Image_TIFF/image_tiff.c:1.46
      Rev: src/modules/spider/spider.c:1.135
    dsa.c 1.88 KiB
    /* dsa.h
     *
     * The DSA publickey algorithm.
     */
    
    /* nettle, low-level cryptographics library
     *
     * Copyright (C) 2002 Niels Mller
     *  
     * The nettle library 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.
     * 
     * The nettle 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 Lesser General Public
     * License for more details.
     * 
     * You should have received a copy of the GNU Lesser General Public License
     * along with the nettle 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.
     */
    
    #if HAVE_CONFIG_H
    #include "config.h"
    #endif
    
    #if WITH_PUBLIC_KEY
    
    #include "dsa.h"
    
    #include "bignum.h"
    
    void
    dsa_public_key_init(struct dsa_public_key *key)
    {
      mpz_init(key->p);
      mpz_init(key->q);
      mpz_init(key->g);
      mpz_init(key->y);
    }
    
    void
    dsa_public_key_clear(struct dsa_public_key *key)
    {
      mpz_clear(key->p);
      mpz_clear(key->q);
      mpz_clear(key->g);
      mpz_clear(key->y);
    }
    
    
    void
    dsa_private_key_init(struct dsa_private_key *key)
    {
      mpz_init(key->x);
    }
    
    void
    dsa_private_key_clear(struct dsa_private_key *key)
    {
      mpz_clear(key->x);
    }
    
    
    void
    dsa_signature_init(struct dsa_signature *signature)
    {
      mpz_init(signature->r);
      mpz_init(signature->s);
    }
    
    void
    dsa_signature_clear(struct dsa_signature *signature)
    {
      mpz_clear(signature->r);
      mpz_clear(signature->s);
    }
    
    void
    _dsa_hash(mpz_t x, struct sha1_ctx *hash)
    {
      uint8_t digest[SHA1_DIGEST_SIZE];
      sha1_digest(hash, sizeof(digest), digest);
    
      nettle_mpz_set_str_256(x, sizeof(digest), digest);
    }
    
    #endif /* WITH_PUBLIC_KEY */