LNXPWRBN/button/input0
     ˆÃÈƒ]{ÁÆ ‚    " Vim syntax file
" Language:     TSS (Thermal Synthesizer System) Optics
" Maintainer:   Adrian Nagle, anagle@ball.com
" Last Change:  2003 May 11
" Filenames:    *.tssop
" URL:		http://www.naglenet.org/vim/syntax/tssop.vim
" MAIN URL:     http://www.naglenet.org/vim/



" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
  syntax clear
elseif exists("b:current_syntax")
  finish
endif



" Ignore case
syn case ignore



"
"
" Begin syntax definitions for tss optics file.
"

" Define keywords for TSS
syn keyword tssopParam  ir_eps ir_trans ir_spec ir_tspec ir_refract
syn keyword tssopParam  sol_eps sol_trans sol_spec sol_tspec sol_refract
syn keyword tssopParam  color

"syn keyword tssopProp   property

syn keyword tssopArgs   white red blue green yellow orange violet pink
syn keyword tssopArgs   turquoise grey black



" Define matches for TSS
syn match  tssopComment       /comment \+= \+".*"/ contains=tssopParam,tssopCommentString
syn match  tssopCommentString /".*"/ contained

syn match  tssopProp	    "property "
syn match  tssopProp	    "edit/optic "
syn match  tssopPropName    "^property \S\+" contains=tssopProp
syn match  tssopPropName    "^edit/optic \S\+$" contains=tssopProp

syn match  tssopInteger     "-\=\<[0-9]*\>"
syn match  tssopFloat       "-\=\<[0-9]*\.[0-9]*"
syn match  tssopScientific  "-\=\<[0-9]*\.[0-9]*E[-+]\=[0-9]\+\>"



" Define the default highlighting
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_tssop_syntax_inits")
  if version < 508
    let did_tssop_syntax_inits = 1
    command -nargs=+ HiLink hi link <args>
  else
    command -nargs=+ HiLink hi def link <args>
  endif

  HiLink tssopParam		Statement
  HiLink tssopProp		Identifier
  HiLink tssopArgs		Special

  HiLink tssopComment		Statement
  HiLink tssopCommentString	Comment
  HiLink tssopPropName		Typedef

  HiLink tssopInteger		Number
  HiLink tssopFloat		Float
  HiLink tssopScientific	Float

  delcommand HiLink
endif


let b:current_syntax = "tssop"

" vim: ts=8 sw=2
  #   ˆl–ß=¿J	¥4Ò‚ D Eq¶î21hßÉ„BóŸÂÇ ?÷     # rfc1751.py : Converts between 128-bit strings and a human-readable
# sequence of words, as defined in RFC1751: "A Convention for
# Human-Readable 128-bit Keys", by Daniel L. McDonald.
#
# Part of the Python Cryptography Toolkit
#
# Written by Andrew M. Kuchling and others
#
# ===================================================================
# The contents of this file are dedicated to the public domain.  To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to exercise all rights associated with the
# contents of this file for any purpose whatsoever.
# No rights are reserved.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# ===================================================================

__revision__ = "$Id$"


import binascii
from Crypto.Util.py3compat import *

binary={0:'0000', 1:'0001', 2:'0010', 3:'0011', 4:'0100', 5:'0101',
        6:'0110', 7:'0111', 8:'1000', 9:'1001', 10:'1010', 11:'1011',
        12:'1100', 13:'1101', 14:'1110', 15:'1111'}

def _key2bin(s):
    "Convert a key into a string of binary digits"
    kl=map(lambda x: bord(x), s)
    kl=map(lambda x: binary[x>>4]+binary[x&15], kl)
    return ''.join(kl)

def _extract(key, start, length):
    """Extract a bitstring(2.x)/bytestring(2.x) from a string of binary digits, and return its
 