~ubuntu-branches/ubuntu/trusty/jsch/trusty-proposed

« back to all changes in this revision

Viewing changes to src/com/jcraft/jsch/jce/HMACSHA196.java

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2008-03-21 11:41:01 UTC
  • mfrom: (3.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080321114101-2g9w5l8ynwf6pbsq
Tags: 0.1.37-3
Add OSGi manifest patch. Thanks to Roberto Jimenoca. Closes: #471209.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2
2
/*
3
 
Copyright (c) 2002,2003,2004,2005,2006 ymnk, JCraft,Inc. All rights reserved.
 
3
Copyright (c) 2002-2008 ymnk, JCraft,Inc. All rights reserved.
4
4
 
5
5
Redistribution and use in source and binary forms, with or without
6
6
modification, are permitted provided that the following conditions are met:
59
59
  public void update(byte foo[], int s, int l){
60
60
    mac.update(foo, s, l);      
61
61
  }
62
 
  private final byte[] buf=new byte[12];
63
 
  public byte[] doFinal(){
64
 
    System.arraycopy(mac.doFinal(), 0, buf, 0, 12);
65
 
    return buf;
 
62
 
 
63
  private final byte[] _buf20=new byte[20];
 
64
  public void doFinal(byte[] buf, int offset){
 
65
    try{
 
66
      mac.doFinal(_buf20, 0);
 
67
    }
 
68
    catch(ShortBufferException e){
 
69
    }
 
70
    System.arraycopy(_buf20, 0, buf, 0, 12);
66
71
  }
 
72
 
67
73
  public String getName(){
68
74
    return name;
69
75
  }